cudaGetLastError After Launch
Catching invalid launch configurations.
Catching the Silent Launch
Since a kernel launch returns nothing, you need a helper to ask the GPU what just happened. That helper is cudaGetLastError. 🔎
What It Returns
cudaGetLastError hands back the most recent error code recorded by the runtime, or cudaSuccess if everything is fine so far.
myKernel<<<g, b>>>(d);
cudaError_t e = cudaGetLastError();All lessons in this course
- Return Codes vs Async Errors
- cudaGetLastError After Launch
- A Reusable CUDA_CHECK Macro
- Decoding cudaGetErrorString