01
cudaSetDevice(0);02
float* state;03
cudaMalloc(&state, 24_GB);04
train<<<grid, block>>>(state);ALLOCATE→KERNEL
STEP 01 · CAPACITY
cudaSetDevice(0);float* state;cudaMalloc(&state, 24_GB);train<<<grid, block>>>(state);24 GB / 16 GB is a teaching scenario that expresses the capacity relationship, not a specification for every P100 configuration.