I have a CUDA kernel function like this:
__global__ void kernel(int a, int b)
{
extern __shared__ unsigned char array[];
//int size = /*size of array*/; = 16
}
and in function main I called it:
sharedMemSize = 16;
kernel<<<gridSize, blockSize, sharedMemSize>>>(1, 2);
How can I get size of shared memory array? This is the first time I have a question on StackOverflow :) Thank you!!!
You can get the size in bytes of your array using: sizeof(array).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With