Refer to the sample code I should be able to dynamically allocate shared memory inside the kernel as:
shared int* s_i_data;
if (threadIdx.x == 0)
s_i_data = (int*)malloc(blockDim.x * 4);
but the compiler (CUDA 5.0) show error on this as:
“…error: calling a host function(“malloc”) from a global function(“kernelPersistenceAlgorithm”) is not allowed…”
It is allowed to use malloc() inside the kernel function. Anyone knows why or what should I set right in the projet/compiler?