multidimensional array problem

Hi

I have this code on a device function

global static void P7Viterbi_cuda_device_loop_one(int **imx_d, int **mmx_d, int **dmx_d, int *index_device){

		const int tx = threadIdx.x  + (*index_device);
		
		mmx_d[0][tx] = imx_d[0][tx] = dmx_d[0][tx] = -INFTY;
		
		__syncthreads();  

}

and i get this

3>“D:\DOCUME~1\joaquin\LOCALS~1\Temp/tmpxft_00000d2c_00000000-8.i”, line 50: Advisory: Cannot tell what pointer points to, assuming global memory space

I do not know why. Can use 2d arrays working on the device? is there any other way to do it?

there are no example of multidimensional array usage on the CUDA examples

can some one points me to some example.

You didn’t tell which line is #50, but it is an advisory, so there is no error compiling the code. As far as I can see all your memory is global memory, so the compiler made the right assumption.

There are some posts about how to make pointers to pointers (you have to make sure the pointers are pointers to device memory.

Question: why not do have int index_device and do const int tx = threadIdx.x + index_device; ? (Just wondering, I am no C guru)

“Question: why not do have int index_device and do const int tx = threadIdx.x + index_device; ? (Just wondering, I am no C guru)”

hey thanks.

yeah i did already…I am treating it a s a linear array rather than a 2d array

thanks