@@ -152,12 +152,14 @@ static int CeedCompileCore_Cuda(Ceed ceed, const char *source, const bool throw_
152
152
if (throw_error) {
153
153
return CeedError (ceed, CEED_ERROR_BACKEND, " %s\n %s" , nvrtcGetErrorString (result), log);
154
154
} else {
155
+ // LCOV_EXCL_START
155
156
CeedDebug256 (ceed, CEED_DEBUG_COLOR_ERROR, " ---------- COMPILE ERROR DETECTED ----------\n " );
156
157
CeedDebug (ceed, " Error: %s\n Compile log:\n %s\n " , nvrtcGetErrorString (result), log);
157
158
CeedDebug256 (ceed, CEED_DEBUG_COLOR_ERROR, " ---------- BACKEND MAY FALLBACK ----------\n " );
158
159
CeedCallBackend (CeedFree (&log));
159
160
CeedCallNvrtc (ceed, nvrtcDestroyProgram (&prog));
160
161
return CEED_ERROR_SUCCESS;
162
+ // LCOV_EXCL_STOP
161
163
}
162
164
}
163
165
@@ -250,17 +252,24 @@ static int CeedRunKernelDimSharedCore_Cuda(Ceed ceed, CUfunction kernel, CUstrea
250
252
CUresult result = cuLaunchKernel (kernel, grid_size, 1 , 1 , block_size_x, block_size_y, block_size_z, shared_mem_size, stream, args, NULL );
251
253
252
254
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;
256
256
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) {
260
261
return CeedError (ceed, CEED_ERROR_BACKEND,
261
262
" CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES: max_threads_per_block %d on block size (%d,%d,%d), shared_size %d, num_regs %d" ,
262
263
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
263
271
}
272
+ *is_good_run = false ;
264
273
} else CeedChk_Cu (ceed, result);
265
274
return CEED_ERROR_SUCCESS;
266
275
}
0 commit comments