e.ping
1
Hi everyone,
I am getting a strange compiler error. The code is very simple inside my kernel function:
int MW_BLOCK_SIZE = 15;
__shared__ unsigned char Is[MW_BLOCK_SIZE * MW_BLOCK_SIZE * 3]; //Image in the shared memory
Compiler throws:
line 43: internal error: assertion failed:
add_dyn_init_cleanup: missing destructible entity descr
(lower_init.c, line 4799)
__attribute__((__shared__)) unsigned char Is[MW_BLOCK_SIZE * MW_BLOCK_SIZE * 3]; //Image in the shared memory
^
1 catastrophic error detected in the compilation of "/tmp/tmp_00003033-3.ii".
Compilation aborted.
However if I write the value of MW_BLOCK_SIZE, 15, inside the brackets, it doesn’t complain.
One final question: Is the shared memory Is, big enough? I think 15153 = 675 should be fine. I just want to make sure. Thanks in advance.
benoit
2
shared array can’t have dynamic allocation you need to give a constant value for the size.
check you these post it will be very helpful
http://forums.nvidia.com/index.php?showtopic=28588
e.ping
3
Thanks for the reply. I will make it constant.