title: How to get size of an array in CUDA kernel function?
body: <p>I have a CUDA kernel function like this:</p>
  
  <pre><code>__global__ void kernel(int a, int b)
  {
  extern __shared__ unsigned char array[];
  //int size = /*size of array*/; = 16
  }
  </code></pre>
  
  <p>and in function main I called it:</p>
  
  <pre><code>sharedMemSize = 16;
  kernel&lt;&lt;&lt;gridSize, blockSize, sharedMemSize&gt;&gt;&gt;(1, 2);
  </code></pre>
  
  <p>How can I get size of shared memory array?
  This is the first time I have a question on StackOverflow :) Thank you!!!</p>