Hi, i’ve run into a very very weird issue.
First of all my app is quite large and split into quite some files. I’m mentioning this in case this could be related to my prob. All my kernels are in one place cu file, all my constant variables are located in a .h file which is included in my main and my kernel cu files, and of course one main cu file that invokes the kernels. I’m importing the kernels to the main app using an .cuh file.
Constant variables are just defined in the header file using the following code:
//Define constants for CUDA __device__ __constant__ double d_invertn; __device__ __constant__ double d_dt; __device__ __constant__ double d_epsilon2; __device__ __constant__ double d_pi; __device__ __constant__ double d_Deff; __device__ __constant__ double d_curv; __device__ __constant__ double d_phis;
They are afterwards initialized in the main code file and are passed on the device using cudaMemcpyToSymbol().
The problem is that for some reason, all the constant variables within the kernels are 0.0…
I’ve even tried to get the constant variables back from the device using cudaMemcpyFromSymbol() function and it returns the correct value.
Do i need to define or setup the constants otherwise?
I have no idea where to start looking, and i would really appreciate some advice
thanks in advance
EDIT: I tried to assemble a sample program, putting everything into one file and this worked fine. Could this be happening because of my multifile approach?
I’m running on a GTX750 btw.