@@ -134,14 +134,23 @@ static int CeedCompileCore_Hip(Ceed ceed, const char *source, const bool throw_e
134134 }
135135 CeedCallBackend (CeedFree (&opts));
136136 *is_compile_good = result == HIPRTC_SUCCESS;
137- if (!*is_compile_good && throw_error ) {
137+ if (!*is_compile_good) {
138138 size_t log_size;
139139 char *log;
140140
141141 CeedChk_hiprtc (ceed, hiprtcGetProgramLogSize (prog, &log_size));
142142 CeedCallBackend (CeedMalloc (log_size, &log));
143143 CeedCallHiprtc (ceed, hiprtcGetProgramLog (prog, log));
144- return CeedError (ceed, CEED_ERROR_BACKEND, " %s\n %s" , hiprtcGetErrorString (result), log);
144+ if (throw_error) {
145+ return CeedError (ceed, CEED_ERROR_BACKEND, " %s\n %s" , hiprtcGetErrorString (result), log);
146+ } else {
147+ CeedDebug256 (ceed, CEED_DEBUG_COLOR_ERROR, " ---------- COMPILE ERROR DETECTED ----------\n " );
148+ CeedDebug (ceed, " Error: %s\n Compile log:\n %s\n " , hiprtcGetErrorString (result), log);
149+ CeedDebug256 (ceed, CEED_DEBUG_COLOR_ERROR, " ---------- BACKEND MAY FALLBACK ----------\n " );
150+ CeedCallBackend (CeedFree (&log));
151+ CeedCallHiprtc (ceed, hiprtcDestroyProgram (&prog));
152+ return CEED_ERROR_SUCCESS;
153+ }
145154 }
146155
147156 CeedCallHiprtc (ceed, hiprtcGetCodeSize (prog, &ptx_size));
0 commit comments