Difference between cuda.h, cuda_runtime.h, cuda_runtime_api.h

In very broad terms:

  • cuda.h defines the public host
    functions and types for the CUDA
    driver API.
  • cuda_runtime_api.h defines the public
    host functions and types for the
    CUDA runtime API
  • cuda_runtime.h defines everything cuda_runtime_api.h does, as well as built-in type
    definitions and function overlays for the CUDA language extensions and
    device intrinsic functions.

If you were writing host code to be compiled with the host compiler which includes API calls, you would include either cuda.h or cuda_runtime_api.h. If you needed other CUDA language built-ins, like types, and were using the runtime API and compiling with the host compiler, you would include cuda_runtime.h. If you are writing code which will be compiled using nvcc, it is all irrelevant, because nvcc takes care of inclusion of all the required headers automatically without programmer intervention.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)