@@ -152,12 +152,14 @@ static int CeedCompileCore_Cuda(Ceed ceed, const char *source, const bool throw_
152152 if (throw_error) {
153153 return CeedError (ceed, CEED_ERROR_BACKEND, " %s\n %s" , nvrtcGetErrorString (result), log);
154154 } else {
155+ // LCOV_EXCL_START
155156 CeedDebug256 (ceed, CEED_DEBUG_COLOR_ERROR, " ---------- COMPILE ERROR DETECTED ----------\n " );
156157 CeedDebug (ceed, " Error: %s\n Compile log:\n %s\n " , nvrtcGetErrorString (result), log);
157158 CeedDebug256 (ceed, CEED_DEBUG_COLOR_ERROR, " ---------- BACKEND MAY FALLBACK ----------\n " );
158159 CeedCallBackend (CeedFree (&log));
159160 CeedCallNvrtc (ceed, nvrtcDestroyProgram (&prog));
160161 return CEED_ERROR_SUCCESS;
162+ // LCOV_EXCL_STOP
161163 }
162164 }
163165
@@ -250,17 +252,24 @@ static int CeedRunKernelDimSharedCore_Cuda(Ceed ceed, CUfunction kernel, CUstrea
250252 CUresult result = cuLaunchKernel (kernel, grid_size, 1 , 1 , block_size_x, block_size_y, block_size_z, shared_mem_size, stream, args, NULL );
251253
252254 if (result == CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES) {
253- *is_good_run = false ;
254- if (throw_error) {
255- int max_threads_per_block, shared_size_bytes, num_regs;
255+ int max_threads_per_block, shared_size_bytes, num_regs;
256256
257- cuFuncGetAttribute (&max_threads_per_block, CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, kernel);
258- cuFuncGetAttribute (&shared_size_bytes, CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES, kernel);
259- cuFuncGetAttribute (&num_regs, CU_FUNC_ATTRIBUTE_NUM_REGS, kernel);
257+ cuFuncGetAttribute (&max_threads_per_block, CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, kernel);
258+ cuFuncGetAttribute (&shared_size_bytes, CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES, kernel);
259+ cuFuncGetAttribute (&num_regs, CU_FUNC_ATTRIBUTE_NUM_REGS, kernel);
260+ if (throw_error) {
260261 return CeedError (ceed, CEED_ERROR_BACKEND,
261262 " CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES: max_threads_per_block %d on block size (%d,%d,%d), shared_size %d, num_regs %d" ,
262263 max_threads_per_block, block_size_x, block_size_y, block_size_z, shared_size_bytes, num_regs);
264+ } else {
265+ // LCOV_EXCL_START
266+ CeedDebug256 (ceed, CEED_DEBUG_COLOR_ERROR, " ---------- LAUNCH ERROR DETECTED ----------\n " );
267+ CeedDebug (ceed, " CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES: max_threads_per_block %d on block size (%d,%d,%d), shared_size %d, num_regs %d\n " ,
268+ max_threads_per_block, block_size_x, block_size_y, block_size_z, shared_size_bytes, num_regs);
269+ CeedDebug256 (ceed, CEED_DEBUG_COLOR_ERROR, " ---------- BACKEND MAY FALLBACK ----------\n " );
270+ // LCOV_EXCL_STOP
263271 }
272+ *is_good_run = false ;
264273 } else CeedChk_Cu (ceed, result);
265274 return CEED_ERROR_SUCCESS;
266275}
0 commit comments