I have a single .cu file. I have a array which will be used by all threads in all the blocks per grid. So i wanted to declare it as device constant.
I have done like this:-
device constant int* conarray;
global void readTexels(int n, int* oarray)
int ind=blockIdx.x + blockDim.x + threadIdx.x;
int N = 10;
int data = (int)malloc(Nsizeof(int));
for (int i = 0; i < N; i++)
data[i] = i;
//Kernel Call goes here
I am just trying to copy the value of constant array ( carray) to the argument passed to the kernel call.
But i am not getting the same value as there is data.
What am i doing wrong?