SAMPUN
#1
Hello,
I have some static arrays declared in the C header file.
static unsigned int abc[4][2] = {{0,1},{0,1},{1,0},{1,0}};
Is there any way to declare this type of static arrays in Cuda C.
Please suggest me a best way to access such defined arrays globally in GPU.
Thanks!
Make it a flat array such as this:
int abc[8];
and copy the contents to constant memory. If there are too many items/arrays use flat arrays in global memory and
in the kernel read it to shared memory.
Hope this helps,
eyal
tera
#3
What’s wrong with
[font=“Courier New”]constant static unsigned int abc[4][2] = {{0,1},{0,1},{1,0},{1,0}};[/font]
or
[font=“Courier New”]device static unsigned int abc[4][2] = {{0,1},{0,1},{1,0},{1,0}};[/font]
?