Medium
Launching with 64 KB of dynamic shared memory on an A100
An A100 has 164 KB of shared memory per SM, and the spec sheet lists up to 163 KB per block. A stencil kernel is moved from a 32 KB tile to a 64 KB tile by changing only the launch's third argument. No other host code changes. What does cudaGetLastError() report right after the launch?
stencil.cu
extern __shared__ float tile[]; // sized by the launch
__global__ void stencil(const float* in, float* out, int n) {
// ... loads a halo'd tile into 'tile', __syncthreads(), computes ...
}
size_t smem = 64 * 1024; // was 32 * 1024
stencil<<<grid, 256, smem>>>(d_in, d_out, n);
cudaError_t err = cudaGetLastError();42 of 46 in GPU / CUDA