Skip to content

Commit

Permalink
Fix gcc and nvc++ builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesp-epcc committed Jul 31, 2023
1 parent 7f9d35c commit 7855c7d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def all_files_from(dir, ext=''):
}
lopt = {
'gcc' : ['-fopenmp'],
'gcc w/ GPU' : ['-fopenmp','-foffload=nvptx-none'],
'gcc w/ GPU' : ['-fopenmp','-foffload=nvptx-none', '-foffload=-lm'],
'icc' : ['-openmp'],
'clang' : ['-stdlib=libc++'],
'clang w/ OpenMP' : ['-stdlib=libc++','-fopenmp'],
Expand Down
8 changes: 8 additions & 0 deletions src/Silicon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,9 @@ namespace galsim {
// Get the location where the photon strikes the silicon:
double x0 = photonsX[i]; // in pixels
double y0 = photonsY[i]; // in pixels
#ifdef DEBUGLOGGING
xdbg<<"x0,y0 = "<<x0<<','<<y0;
#endif

// get uniform random number for conversion depth from randomArray
// (4th of 4 numbers for this photon)
Expand All @@ -1390,10 +1392,14 @@ namespace galsim {
x0 += dxdz * dz_pixel; // dx in pixels
y0 += dydz * dz_pixel; // dy in pixels
}
#ifdef DEBUGLOGGING
xdbg<<" => "<<x0<<','<<y0;
#endif
// This is the reverse of depth. zconv is how far above the substrate the e- converts.
double zconv = _sensorThickness - dz;
#ifdef DEBUGLOGGING
xdbg<<"zconv = "<<zconv<<std::endl;
#endif
if (zconv < 0.0) continue; // Throw photon away if it hits the bottom
// TODO: Do something more realistic if it hits the bottom.

Expand All @@ -1405,7 +1411,9 @@ namespace galsim {
x0 += diffStep * randomArray[(i-i1)*4];
y0 += diffStep * randomArray[(i-i1)*4+1];
}
#ifdef DEBUGLOGGING
xdbg<<" => "<<x0<<','<<y0<<std::endl;
#endif
double flux = photonsFlux[i];

#ifdef DEBUGLOGGING
Expand Down

0 comments on commit 7855c7d

Please sign in to comment.