cudaError/CUresult升级到CUDA 11时不兼容



我正在尝试将一个项目从VS2013/CUDA 8.0升级到VS2019/CUDA11.1。

在VS2013/CUDA8中一切都很好,但当我试图用VS2019/CUDA11构建项目时,我收到了关于cuda_helper的兼容性错误:

1>C:ProgramDataNVIDIA CorporationCUDA Samplesv11.1commoninchelper_cuda.h(571): error : argument of type "CUresult" is incompatible with parameter of type "cudaError_t"
1>          detected during instantiation of "void check(T, const char *, const char *, int) [with T=CUresult]"
1>C:ProgramDataNVIDIA CorporationCUDA Samplesv11.1commoninchelper_cuda_drvapi.h(123): here

CUDA 11中发生了什么变化,可能导致此错误?如何查找并更正项目中的错误?

我能够解决导入<helper_cuda.h>而不是<helper_cuda_drvapi.h>的问题

事实上,CUDA驱动程序返回一个CUresult,而CUDA运行时返回一个cudaError_t。它可能会从一个CUDA版本更改为另一个版本。

否则,正如talonmies所提到的,在我的项目中包含一些CUDA样本可能不是一个好主意。