I am writing some CUDA code to run on the device. The code will use two lookup tables of constant values. The first of these is an array of 256 unsigned ints and I declare it as :
__constant__
uint16_t edgeTable[256]={
0x000,
0x019,
... etc.
};
And this seems to compile fine.
The second is a fixed size array of dim3 and I tried this:
__constant__
dim3 offsets[8] = {
{0, 0, 0}, {0, 0, 1}, {0, 1, 0},
... etc
};
Which the compiler objects to. with the error message:
error: dynamic initialization is not supported for __device__, __constant__ and __shared__ variables.
Perhaps I misunderstand dynamic initialisation but it seems to me that this is static initialisation, the compiler can work out the sizes of everything and all values are provided.
What am I missing here ?
How can I achieve what I'm trying to do ?
Thanks
I'm using CUDA7.5 toolkit on Ubuntu 14.04 with gcc 4.8.4