Using both dynamically-allocated and statically-allocated shared memory
<p>Suppose I have two <code>__device__</code> CUDA function, each having the following local variable:</p>

<pre><code>__shared__ int a[123];
</code></pre>

<p>and another function (say it's my kernel, i.e. a <code>__global__</code> function), with:</p>

<pre><code>extern __shared__ int b[];
</code></pre>

<p>Is this explicitly allowed/forbidden by nVIDIA? (I don't see it in the <a href="http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html" rel="nofollow noreferrer">programming guide</a> section B.2.3 on <code>__shared__</code>) Do the sizes all count together together towards the shared memory limit, or is it the maximum possibly in use at a single time? Or some other rule?</p>

<p><sub>This can be considered a follow-up question to <a href="https://stackoverflow.com/q/15435559/1593077">this one</a>.</sub></p>