I want to get a human readable description of result returned by cuInit. Every single page I've found recommnend using cudaGetErrorString for this purpose, but this results in error:
error: cannot convert CUresult {aka cudaError_enum} to cudaError_t
{aka cudaError} for argument 1 to const char* cudaGetErrorString(cudaError_t)
What's the difference between CUresult and cudaError and what function can I use to interpret the former?
The current driver API as time of writing does support translating an CUresult to its string representation and description.
From the Driver API doc:
CUresult cuGetErrorName ( CUresult error, const char** pStr )
Gets the string representation of an error code enum name.
CUresult cuGetErrorString ( CUresult error, const char** pStr )
Gets the string description of an error code.
http://docs.nvidia.com/cuda/cuda-driver-api/index.html
LIBRARY RETURN TYPE VALUES
CUDA Driver CUresult enum cudaError_enum in cuda.h
CUDA Runtime cudaError_t enum cudaError in driver_types.h
The CUDA Runtime provides the function cudaGetErrorString to convert a cudaError enum value to a string.
The CUDA Driver API does not provide a function to return string.
The error names and values for CUresult and cudaError_t do not match.
NVIDIA does not currently supply a library for returning an error string for CUresult. It should only take a few minutes to convert the data in cuda.h into a function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With