From 26a862c7f6fb4ed83a822e66c74ae7685e4d25ba Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Fri, 8 Jul 2016 20:04:45 +0200 Subject: [PATCH] neoscrypt: reduce a bit the cpu usage --- neoscrypt/neoscrypt.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/neoscrypt/neoscrypt.cpp b/neoscrypt/neoscrypt.cpp index b710cdc..d8fc3a2 100644 --- a/neoscrypt/neoscrypt.cpp +++ b/neoscrypt/neoscrypt.cpp @@ -32,8 +32,12 @@ int scanhash_neoscrypt(int thr_id, struct work* work, uint32_t max_nonce, unsign { cudaDeviceSynchronize(); cudaSetDevice(dev_id); - cudaDeviceSetCacheConfig(cudaFuncCachePreferL1); - cudaGetLastError(); // reset errors if device is not "reset" + if (opt_cudaschedule == -1 && gpu_threads == 1) { + cudaDeviceReset(); + // reduce cpu usage + cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync); + cudaGetLastError(); // reset errors if device is not "reset" + } if (device_sm[dev_id] <= 300) { gpulog(LOG_ERR, thr_id, "Sorry neoscrypt is not supported on SM 3.0 devices");