File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
source/adapters/level_zero Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ static auto getUrResultString = [](ur_result_t Result) {
168168 }
169169};
170170
171- // Trace an internal PI call; returns in case of an error.
171+ // Trace an internal UR call; returns in case of an error.
172172#define UR_CALL (Call ) \
173173 { \
174174 if (PrintTrace) \
@@ -180,6 +180,18 @@ static auto getUrResultString = [](ur_result_t Result) {
180180 return Result; \
181181 }
182182
183+ // Trace an internal UR call; throw in case of an error.
184+ #define UR_CALL_THROWS (Call ) \
185+ { \
186+ if (PrintTrace) \
187+ logger::always (" UR ---> {}" , #Call); \
188+ ur_result_t Result = (Call); \
189+ if (PrintTrace) \
190+ logger::always (" UR <--- {}({})" , #Call, getUrResultString (Result)); \
191+ if (Result != UR_RESULT_SUCCESS) \
192+ throw Result; \
193+ }
194+
183195// Controls UR L0 calls tracing.
184196enum UrDebugLevel {
185197 UR_L0_DEBUG_NONE = 0x0 ,
You can’t perform that action at this time.
0 commit comments