Skip to content

Commit 7c78d8e

Browse files
committed
[L0] Implement throwing variant of ZE2UR_CALL
1 parent fe8a06a commit 7c78d8e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

source/adapters/level_zero/common.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,14 @@ ur_result_t ze2urResult(ze_result_t ZeResult);
325325
return ze2urResult(Result); \
326326
}
327327

328+
// Trace a call to Level-Zero RT, throw on error
329+
#define ZE2UR_CALL_THROWS(ZeName, ZeArgs) \
330+
{ \
331+
ze_result_t ZeResult = ZeName ZeArgs; \
332+
if (auto Result = ZeCall().doCall(ZeResult, #ZeName, #ZeArgs, true)) \
333+
throw ze2urResult(Result); \
334+
}
335+
328336
// Perform traced call to L0 without checking for errors
329337
#define ZE_CALL_NOCHECK(ZeName, ZeArgs) \
330338
ZeCall().doCall(ZeName ZeArgs, #ZeName, #ZeArgs, false)

0 commit comments

Comments
 (0)