From b3f8f97789426c1612609a9218f05eee2c86dc47 Mon Sep 17 00:00:00 2001 From: Tomas Kulhanek Date: Mon, 17 Dec 2018 11:54:19 +0000 Subject: UPDATE: return -1 in case of error --- Core/regularisers_GPU/PatchSelect_GPU_core.cu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/regularisers_GPU/PatchSelect_GPU_core.cu b/Core/regularisers_GPU/PatchSelect_GPU_core.cu index 74f59ca..d173124 100644 --- a/Core/regularisers_GPU/PatchSelect_GPU_core.cu +++ b/Core/regularisers_GPU/PatchSelect_GPU_core.cu @@ -397,7 +397,7 @@ extern "C" int PatchSelect_GPU_main(float *A, unsigned short *H_i, unsigned shor cudaGetDeviceCount(&deviceCount); if (deviceCount == 0) { fprintf(stderr, "No CUDA devices found\n"); - return; + return -1; } int SearchW_full, SimilW_full, counterG, i, j; @@ -440,7 +440,7 @@ extern "C" int PatchSelect_GPU_main(float *A, unsigned short *H_i, unsigned shor else if (SearchWindow == 13) IndexSelect2D_13_kernel<<>>(Ad, H_i_d, H_j_d, Weights_d, Eucl_Vec_d, N, M, SearchWindow, SearchW_full, SimilarWin, NumNeighb, h2); else { fprintf(stderr, "Select the searching window size from 5, 7, 9, 11 or 13\n"); - return;} + return -1;} checkCudaErrors(cudaPeekAtLastError() ); checkCudaErrors(cudaDeviceSynchronize()); /***************************************************************/ -- cgit v1.2.3