You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but function definition does not: inline void MC_Particle::Move_Particle( const DirectionCosine &my_direction_cosine, …
In file ParticleVault.hh: putParticle is declared as HOST_DEVICE_CUDA, but the function definition does not use HOST_DEVICE_CUDA. invalidateParticle is declared as HOST_DEVICE_CUDA, but the function definition does not use HOST_DEVICE_CUDA.
The text was updated successfully, but these errors were encountered:
This is an interesting point. Do you think that the reason it currently compiles/works is due to them being inline functions, negating the compilers need to specify __host__ __device__ ?
NVCC is silent on this issue, but clang generates an error. Here's the error I get when compiling with clang:
./ParticleVault.hh:175:1: error: __host__ function 'putParticle' cannot overload __host__ __device__ function 'putParticle'
putParticle(MC_Particle particle, int index)
^
./ParticleVault.hh:62:9: note: previous declaration is here
bool putParticle(MC_Particle particle, int index);
When I add HOST_DEVICE_CUDA to the function definition the error is solved.
I'm not sure why in nvcc it works, but generally speaking clang is more strict on these language/semantics issues.
In MC_Particle.hh:
Function declaration of Move_Particle uses HOST_DEVICE_CUDA:
but function definition does not:
inline void MC_Particle::Move_Particle( const DirectionCosine &my_direction_cosine, …
In file ParticleVault.hh:
putParticle
is declared as HOST_DEVICE_CUDA, but the function definition does not use HOST_DEVICE_CUDA.invalidateParticle
is declared as HOST_DEVICE_CUDA, but the function definition does not use HOST_DEVICE_CUDA.The text was updated successfully, but these errors were encountered: