Problem with big integers

Hi all,

I encountered a strange problem:

My CUDA kernel starts with the following lines of code:

__global__ void cudaDecomp(unsigned char* g_prevFrame, unsigned char* g_currFrame, unsigned char* g_compPixels, unsigned char* g_index, unsigned int* g_memIndex, unsigned int width, unsigned int height, unsigned int bpp)


	unsigned char* g_pixelSet = g_compPixels+g_memIndex[bid]*4;


g_memIndex holds integers for memory positions which can get quite big, the more blocks I use. For small amount of blocks everything works fine in device and emulation mode. But when the values in g_memIndex come close to 32000 and above the programm crashes in device mode. No problems in Emulation mode. The only error I get from cudaGetLastError is “unspecified launch failure”. Somtimes the system freezes completly.

I’am really stuck here and would be very glad if someone could help.Are there possibly hardware restrictions which limit the integers to a certain size?



There are no restrictions on integer size in the device.

“Unspecified launch error” sometimes means that you have read/written outside of an allocated array. Check all your accesses and memory allocations. If you are running on linux, running your emulation build through valgrind can be invaluable.