summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend/nvidia/nvcc_code
diff options
context:
space:
mode:
authorpsychocrypt <psychocryptHPC@gmail.com>2017-12-10 20:39:47 +0100
committerpsychocrypt <psychocryptHPC@gmail.com>2017-12-10 20:39:47 +0100
commitfd0c9db6e8da7acdab6881ade4d57923b7081e4c (patch)
tree1d3ca79711ff4149667ca74f4e9c283706a6c9fd /xmrstak/backend/nvidia/nvcc_code
parent24df7e0f0e5eb37aa001ef255b12b628331a4aee (diff)
downloadxmr-stak-fd0c9db6e8da7acdab6881ade4d57923b7081e4c.zip
xmr-stak-fd0c9db6e8da7acdab6881ade4d57923b7081e4c.tar.gz
handle cuda error codes
handle all error codes from the cuda api calls.
Diffstat (limited to 'xmrstak/backend/nvidia/nvcc_code')
-rw-r--r--xmrstak/backend/nvidia/nvcc_code/cuda_extra.cu16
1 files changed, 8 insertions, 8 deletions
diff --git a/xmrstak/backend/nvidia/nvcc_code/cuda_extra.cu b/xmrstak/backend/nvidia/nvcc_code/cuda_extra.cu
index 734426c..10f43c4 100644
--- a/xmrstak/backend/nvidia/nvcc_code/cuda_extra.cu
+++ b/xmrstak/backend/nvidia/nvcc_code/cuda_extra.cu
@@ -188,24 +188,24 @@ extern "C" int cryptonight_extra_cpu_init(nvid_ctx* ctx)
return 0;
}
- cudaDeviceReset();
+ CUDA_CHECK(ctx->device_id, cudaDeviceReset());
switch(ctx->syncMode)
{
case 0:
- cudaSetDeviceFlags(cudaDeviceScheduleAuto);
+ CUDA_CHECK(ctx->device_id, cudaSetDeviceFlags(cudaDeviceScheduleAuto));
break;
case 1:
- cudaSetDeviceFlags(cudaDeviceScheduleSpin);
+ CUDA_CHECK(ctx->device_id, cudaSetDeviceFlags(cudaDeviceScheduleSpin));
break;
case 2:
- cudaSetDeviceFlags(cudaDeviceScheduleYield);
+ CUDA_CHECK(ctx->device_id, cudaSetDeviceFlags(cudaDeviceScheduleYield));
break;
case 3:
- cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
+ CUDA_CHECK(ctx->device_id, cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
break;
};
- cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
+ CUDA_CHECK(ctx->device_id, cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
size_t hashMemSize;
if(::jconf::inst()->IsCurrencyMonero())
@@ -464,9 +464,9 @@ extern "C" int cuda_get_deviceinfo(nvid_ctx* ctx)
size_t totalMemory = 0;
CUDA_CHECK(ctx->device_id, cudaMemGetInfo(&freeMemory, &totalMemory));
- cudaFree(tmp);
+ CUDA_CHECK(ctx->device_id, cudaFree(tmp));
// delete created context on the gpu
- cudaDeviceReset();
+ CUDA_CHECK(ctx->device_id, cudaDeviceReset());
ctx->total_device_memory = totalMemory;
ctx->free_device_memory = freeMemory;
OpenPOWER on IntegriCloud