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