Medium
Block residency for a 256-thread kernel with a 40 KB shared tile
An SM has 96 KB of shared memory available per SM and supports up to 32 resident thread blocks and 2048 resident threads. A kernel is launched with 256 threads/block and statically declares 40 KB of shared memory per block. Registers are not a limiting factor. How many blocks can actually be resident on the SM simultaneously, and what limits it?
kernel.cu
__global__ void __launch_bounds__(256) heavySmem(float* data) {
__shared__ float buf[10240]; // 40 KB per block
// ... kernel body ...
}
// launch: heavySmem<<<numBlocks, 256>>>(data);10 of 46 in GPU / CUDA