Hard
An unrolled kernel with 256 simultaneously live per-thread values
A kernel is aggressively unrolled and keeps many simultaneously-live local variables, pushing its register requirement past the architectural per-thread register cap (e.g., 255 on many recent architectures) or past a compiler/launch_bounds-imposed limit. What happens to the variables that don't fit, and what's the performance implication?
kernel.cu
__global__ void __launch_bounds__(128, 1) heavyUnroll(float* out, const float* in) {
float acc[256]; // 256 simultaneously-live locals, heavily used throughout
#pragma unroll
for (int i = 0; i < 256; ++i) acc[i] = in[threadIdx.x * 256 + i];
// ... extensive per-element compute reusing all 256 values repeatedly ...
}28 of 46 in GPU / CUDA