1
我想调用cudppSort来排序一组键/值。我使用下面的代码来设置排序算法:CUDAPP 1.1 cudppSort配置错误(无效的配置参数)
CUDPPConfiguration config;
config.op = CUDPP_ADD;
config.datatype = CUDPP_UINT;
config.algorithm = CUDPP_SORT_RADIX;
config.options = CUDPP_OPTION_KEY_VALUE_PAIRS | CUDPP_OPTION_FORWARD | CUDPP_OPTION_EXCLUSIVE;
CUDPPHandle planHandle;
CUDPPResult result = cudppPlan(&planHandle, config, number_points, 1, 0);
if (CUDPP_SUCCESS != result) {
printf("ERROR creating CUDPPPlan\n");
exit(-1);
}
退出程序,但是上线:
CUDPPResult result = cudppPlan(&planHandle, config, number_points, 1, 0);
,并打印到stdout:
Cuda error: allocScanStorage in file 'c:/the/path/to/release1.1/cudpp/src/app/scan_app.cu' in line 279 : invalid configuration argument.
我看着scan_app.cu中的一行。它是,
CUT_CHECK_ERROR("allocScanStorage");
因此,显然我的配置有一个错误,导致allocScanStorage炸弹。在函数中只有两次调用CUDA_SAFE_CALL,我没有看到与配置有关的原因。
我的配置有什么问题?
只是为了后人:我想通了(我现在还在学习CUDA。)因为错误检查是异步错误,如果您不时检查它们,它们会出现在奇怪的地方。我的代码在我调用cudppPlan之前导致了一个错误,但是因为我没有检查错误,cudppPlan报告了错误,就好像它在cudppPlan中一样。 – jcb 2009-10-15 00:09:13