0Pricing
CUDA Academy · Lesson

Return Codes vs Async Errors

Why kernels fail silently by default.

Two Ways CUDA Fails

CUDA reports trouble in two flavors: an immediate return code from API calls, and delayed async errors from kernels. Knowing both is key. 🧭

API Calls Return a Code

Most CUDA runtime calls hand back a cudaError_t. A value of cudaSuccess means all good; anything else signals a problem you can act on.

cudaError_t err = cudaMalloc(&d, n);

All lessons in this course

  1. Return Codes vs Async Errors
  2. cudaGetLastError After Launch
  3. A Reusable CUDA_CHECK Macro
  4. Decoding cudaGetErrorString
← Back to CUDA Academy