|
@@ -20,6 +20,9 @@ |
|
|
#ifndef AVUTIL_CUDA_CHECK_H |
|
|
#ifndef AVUTIL_CUDA_CHECK_H |
|
|
#define AVUTIL_CUDA_CHECK_H |
|
|
#define AVUTIL_CUDA_CHECK_H |
|
|
|
|
|
|
|
|
|
|
|
typedef CUresult CUDAAPI cuda_check_GetErrorName(CUresult error, const char** pstr); |
|
|
|
|
|
typedef CUresult CUDAAPI cuda_check_GetErrorString(CUresult error, const char** pstr); |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Wrap a CUDA function call and print error information if it fails. |
|
|
* Wrap a CUDA function call and print error information if it fails. |
|
|
*/ |
|
|
*/ |
|
@@ -35,8 +38,8 @@ static inline int ff_cuda_check(void *avctx, |
|
|
if (err == CUDA_SUCCESS) |
|
|
if (err == CUDA_SUCCESS) |
|
|
return 0; |
|
|
return 0; |
|
|
|
|
|
|
|
|
((tcuGetErrorName *)cuGetErrorName_fn)(err, &err_name); |
|
|
|
|
|
((tcuGetErrorString *)cuGetErrorString_fn)(err, &err_string); |
|
|
|
|
|
|
|
|
((cuda_check_GetErrorName *)cuGetErrorName_fn)(err, &err_name); |
|
|
|
|
|
((cuda_check_GetErrorString *)cuGetErrorString_fn)(err, &err_string); |
|
|
|
|
|
|
|
|
av_log(avctx, AV_LOG_ERROR, "%s failed", func); |
|
|
av_log(avctx, AV_LOG_ERROR, "%s failed", func); |
|
|
if (err_name && err_string) |
|
|
if (err_name && err_string) |
|
|