Skip to content

Commit 94169b1

Browse files
author
Anudeep Kambapu
authored
Merge pull request #16 from oneapi-src/quicksilver/add_cstdint_header
[Quicksilver] Add cstdint header
2 parents 9e2b5c6 + 9129b13 commit 94169b1

File tree

6 files changed

+360
-354
lines changed

6 files changed

+360
-354
lines changed

QuickSilver/CUDA/src/EnergySpectrum.hh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
#define ENERGYSPECTRUM_HH
33
#include <string>
44
#include <vector>
5+
#include <cstdint>
56

67
class MonteCarlo;
78

89
class EnergySpectrum
910
{
10-
public:
11-
EnergySpectrum(std::string name, uint64_t size) : _fileName(std::move(name)), _censusEnergySpectrum(size,0) {};
12-
void UpdateSpectrum(MonteCarlo* monteCarlo);
13-
void PrintSpectrum(MonteCarlo* monteCarlo);
11+
public:
12+
EnergySpectrum(std::string name, uint64_t size) : _fileName(std::move(name)), _censusEnergySpectrum(size, 0){};
13+
void UpdateSpectrum(MonteCarlo *monteCarlo);
14+
void PrintSpectrum(MonteCarlo *monteCarlo);
1415

15-
private:
16-
std::string _fileName;
17-
std::vector<uint64_t> _censusEnergySpectrum;
16+
private:
17+
std::string _fileName;
18+
std::vector<uint64_t> _censusEnergySpectrum;
1819
};
1920

2021
#endif
21-

QuickSilver/CUDA/src/Parameters.hh

Lines changed: 112 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,30 @@
88
#include <vector>
99
#include <map>
1010
#include <iostream>
11+
#include <cstdint>
1112

1213
struct GeometryParameters
1314
{
14-
enum Shape{UNDEFINED, BRICK, SPHERE};
15+
enum Shape
16+
{
17+
UNDEFINED,
18+
BRICK,
19+
SPHERE
20+
};
1521

1622
GeometryParameters()
17-
: materialName(),
18-
shape(UNDEFINED),
19-
radius(0.0),
20-
xCenter(0.0),
21-
yCenter(0.0),
22-
zCenter(0.0),
23-
xMin(0.0),
24-
yMin(0.0),
25-
zMin(0.0),
26-
xMax(0.0),
27-
yMax(0.0),
28-
zMax(0.0)
29-
{};
23+
: materialName(),
24+
shape(UNDEFINED),
25+
radius(0.0),
26+
xCenter(0.0),
27+
yCenter(0.0),
28+
zCenter(0.0),
29+
xMin(0.0),
30+
yMin(0.0),
31+
zMin(0.0),
32+
xMax(0.0),
33+
yMax(0.0),
34+
zMax(0.0){};
3035

3136
std::string materialName;
3237
Shape shape;
@@ -45,19 +50,18 @@ struct GeometryParameters
4550
struct MaterialParameters
4651
{
4752
MaterialParameters()
48-
: name(),
49-
mass(1000.0),
50-
totalCrossSection(1.0),
51-
nIsotopes(10),
52-
nReactions(9),
53-
sourceRate(0.0),
54-
scatteringCrossSection(),
55-
absorptionCrossSection(),
56-
fissionCrossSection(),
57-
scatteringCrossSectionRatio(1.0),
58-
absorptionCrossSectionRatio(1.0),
59-
fissionCrossSectionRatio(1.0)
60-
{};
53+
: name(),
54+
mass(1000.0),
55+
totalCrossSection(1.0),
56+
nIsotopes(10),
57+
nReactions(9),
58+
sourceRate(0.0),
59+
scatteringCrossSection(),
60+
absorptionCrossSection(),
61+
fissionCrossSection(),
62+
scatteringCrossSectionRatio(1.0),
63+
absorptionCrossSectionRatio(1.0),
64+
fissionCrossSectionRatio(1.0){};
6165

6266
std::string name;
6367
double mass;
@@ -76,14 +80,13 @@ struct MaterialParameters
7680
struct CrossSectionParameters
7781
{
7882
CrossSectionParameters()
79-
: name(),
80-
aa(0.0),
81-
bb(0.0),
82-
cc(0.0),
83-
dd(0.0),
84-
ee(1.0),
85-
nuBar(2.4)
86-
{};
83+
: name(),
84+
aa(0.0),
85+
bb(0.0),
86+
cc(0.0),
87+
dd(0.0),
88+
ee(1.0),
89+
nuBar(2.4){};
8790

8891
std::string name;
8992
double aa;
@@ -97,89 +100,88 @@ struct CrossSectionParameters
97100
struct SimulationParameters
98101
{
99102
SimulationParameters()
100-
: inputFile(),
101-
crossSectionsOut(""),
102-
boundaryCondition("reflect"),
103-
energySpectrum(""),
104-
loadBalance(0),
105-
cycleTimers(0),
106-
debugThreads(0),
107-
nParticles(1000000), // 10^6
108-
batchSize(0), // default to use nBatches
109-
nBatches(10),
110-
nSteps(10),
111-
nx(10), //speed up early testing
112-
ny(10),
113-
nz(10),
114-
// nx(100),
115-
// ny(100),
116-
// nz(100),
117-
seed(1029384756),
118-
xDom(0),
119-
yDom(0),
120-
zDom(0),
121-
dt(1e-8),
122-
fMax(0.1),
123-
lx(100.0),
124-
ly(100.0),
125-
lz(100.0),
126-
eMin(1e-9),
127-
eMax(20),
128-
nGroups(230),
129-
lowWeightCutoff(0.001),
130-
balanceTallyReplications(1),
131-
fluxTallyReplications(1),
132-
cellTallyReplications(1),
133-
coralBenchmark(0)
134-
{};
103+
: inputFile(),
104+
crossSectionsOut(""),
105+
boundaryCondition("reflect"),
106+
energySpectrum(""),
107+
loadBalance(0),
108+
cycleTimers(0),
109+
debugThreads(0),
110+
nParticles(1000000), // 10^6
111+
batchSize(0), // default to use nBatches
112+
nBatches(10),
113+
nSteps(10),
114+
nx(10), // speed up early testing
115+
ny(10),
116+
nz(10),
117+
// nx(100),
118+
// ny(100),
119+
// nz(100),
120+
seed(1029384756),
121+
xDom(0),
122+
yDom(0),
123+
zDom(0),
124+
dt(1e-8),
125+
fMax(0.1),
126+
lx(100.0),
127+
ly(100.0),
128+
lz(100.0),
129+
eMin(1e-9),
130+
eMax(20),
131+
nGroups(230),
132+
lowWeightCutoff(0.001),
133+
balanceTallyReplications(1),
134+
fluxTallyReplications(1),
135+
cellTallyReplications(1),
136+
coralBenchmark(0){};
135137

136-
std::string inputFile; //!< name of input file
137-
std::string energySpectrum; //!< enble computing and printing energy spectrum via of energy spectrum file
138-
std::string crossSectionsOut; //!< enable or disable printing cross section data to a file
139-
std::string boundaryCondition;//!< specifies boundary conditions
140-
int loadBalance; //!< enable or disable load balancing
141-
int cycleTimers; //!< enable or disable cycle timers
142-
int debugThreads; //!< enable or disable thread debugging lines
143-
uint64_t nParticles; //!< number of particles
144-
uint64_t batchSize; //!< number of particles in a batch
145-
uint64_t nBatches; //!< number of batches to start
146-
int nSteps; //!< number of time steps
147-
int nx; //!< number of mesh elements in x-direction
148-
int ny; //!< number of mesh elements in y-direction
149-
int nz; //!< number of mesh elements in z-direction
150-
int seed; //!< random number seed
151-
int xDom; //!< number of MPI ranks in x-direction
152-
int yDom; //!< number of MPI ranks in y-direction
153-
int zDom; //!< number of MPI ranks in z-direction
154-
double dt; //!< time step (seconds)
155-
double fMax; //!< max random fractional displacement of mesh
156-
double lx; //!< size of problem domain in x-direction (cm)
157-
double ly; //!< size of problem domain in y-direction (cm)
158-
double lz; //!< size of problem domain in z-direction (cm)
159-
double eMin; //!< min energy of cross section
160-
double eMax; //!< max energy of cross section
161-
int nGroups; //!< number of groups for cross sections
162-
double lowWeightCutoff; //!< low weight roulette cutoff
163-
int balanceTallyReplications; //!< Number of replications for the balance tallies
164-
int fluxTallyReplications; //!< Number of replications for the scalar flux tally
165-
int cellTallyReplications; //!< Number of replications for the scalar cell tally
166-
int coralBenchmark; //!< enable correctness check for Coral2 benchmark
138+
std::string inputFile; //!< name of input file
139+
std::string energySpectrum; //!< enble computing and printing energy spectrum via of energy spectrum file
140+
std::string crossSectionsOut; //!< enable or disable printing cross section data to a file
141+
std::string boundaryCondition; //!< specifies boundary conditions
142+
int loadBalance; //!< enable or disable load balancing
143+
int cycleTimers; //!< enable or disable cycle timers
144+
int debugThreads; //!< enable or disable thread debugging lines
145+
uint64_t nParticles; //!< number of particles
146+
uint64_t batchSize; //!< number of particles in a batch
147+
uint64_t nBatches; //!< number of batches to start
148+
int nSteps; //!< number of time steps
149+
int nx; //!< number of mesh elements in x-direction
150+
int ny; //!< number of mesh elements in y-direction
151+
int nz; //!< number of mesh elements in z-direction
152+
int seed; //!< random number seed
153+
int xDom; //!< number of MPI ranks in x-direction
154+
int yDom; //!< number of MPI ranks in y-direction
155+
int zDom; //!< number of MPI ranks in z-direction
156+
double dt; //!< time step (seconds)
157+
double fMax; //!< max random fractional displacement of mesh
158+
double lx; //!< size of problem domain in x-direction (cm)
159+
double ly; //!< size of problem domain in y-direction (cm)
160+
double lz; //!< size of problem domain in z-direction (cm)
161+
double eMin; //!< min energy of cross section
162+
double eMax; //!< max energy of cross section
163+
int nGroups; //!< number of groups for cross sections
164+
double lowWeightCutoff; //!< low weight roulette cutoff
165+
int balanceTallyReplications; //!< Number of replications for the balance tallies
166+
int fluxTallyReplications; //!< Number of replications for the scalar flux tally
167+
int cellTallyReplications; //!< Number of replications for the scalar cell tally
168+
int coralBenchmark; //!< enable correctness check for Coral2 benchmark
167169
};
168170

169171
struct Parameters
170172
{
171-
SimulationParameters simulationParams;
172-
std::vector<GeometryParameters> geometryParams;
173-
std::map<std::string, MaterialParameters> materialParams;
173+
SimulationParameters simulationParams;
174+
std::vector<GeometryParameters> geometryParams;
175+
std::map<std::string, MaterialParameters> materialParams;
174176
std::map<std::string, CrossSectionParameters> crossSectionParams;
175177
};
176178

177-
Parameters getParameters(int argc, char** argv);
178-
void printParameters(const Parameters& params, std::ostream& out);
179+
Parameters getParameters(int argc, char **argv);
180+
void printParameters(const Parameters &params, std::ostream &out);
179181

180-
std::ostream& operator<<(std::ostream& out, const SimulationParameters& pp);
181-
std::ostream& operator<<(std::ostream& out, const GeometryParameters& pp);
182-
std::ostream& operator<<(std::ostream& out, const MaterialParameters& pp);
183-
std::ostream& operator<<(std::ostream& out, const CrossSectionParameters& pp);
182+
std::ostream &operator<<(std::ostream &out, const SimulationParameters &pp);
183+
std::ostream &operator<<(std::ostream &out, const GeometryParameters &pp);
184+
std::ostream &operator<<(std::ostream &out, const MaterialParameters &pp);
185+
std::ostream &operator<<(std::ostream &out, const CrossSectionParameters &pp);
184186

185187
#endif

QuickSilver/HIP/src/EnergySpectrum.hh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
#define ENERGYSPECTRUM_HH
33
#include <string>
44
#include <vector>
5+
#include <cstdint>
56

67
class MonteCarlo;
78

89
class EnergySpectrum
910
{
10-
public:
11-
EnergySpectrum(std::string name, uint64_t size) : _fileName(std::move(name)), _censusEnergySpectrum(size,0) {};
12-
void UpdateSpectrum(MonteCarlo* monteCarlo);
13-
void PrintSpectrum(MonteCarlo* monteCarlo);
11+
public:
12+
EnergySpectrum(std::string name, uint64_t size) : _fileName(std::move(name)), _censusEnergySpectrum(size, 0){};
13+
void UpdateSpectrum(MonteCarlo *monteCarlo);
14+
void PrintSpectrum(MonteCarlo *monteCarlo);
1415

15-
private:
16-
std::string _fileName;
17-
std::vector<uint64_t> _censusEnergySpectrum;
16+
private:
17+
std::string _fileName;
18+
std::vector<uint64_t> _censusEnergySpectrum;
1819
};
1920

2021
#endif
21-

0 commit comments

Comments
 (0)