Skip to content

Commit f1d6536

Browse files
committed
[SYCL][UR][L0 v2] Handle possible expceptions from
getSyncCommandListForCopy
1 parent 60a4c26 commit f1d6536

File tree

1 file changed

+3
-1
lines changed
  • unified-runtime/source/adapters/level_zero/v2

1 file changed

+3
-1
lines changed

unified-runtime/source/adapters/level_zero/v2/memory.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,15 @@ getSyncCommandListForCopy(ur_context_handle_t hContext,
158158

159159
static ur_result_t synchronousZeCopy(ur_context_handle_t hContext,
160160
ur_device_handle_t hDevice, void *dst,
161-
const void *src, size_t size) {
161+
const void *src, size_t size) try {
162162
auto commandList = getSyncCommandListForCopy(hContext, hDevice);
163163

164164
ZE2UR_CALL(zeCommandListAppendMemoryCopy,
165165
(commandList.get(), dst, src, size, nullptr, 0, nullptr));
166166

167167
return UR_RESULT_SUCCESS;
168+
} catch (...) {
169+
return exceptionToResult(std::current_exception());
168170
}
169171

170172
void *ur_discrete_buffer_handle_t::allocateOnDevice(ur_device_handle_t hDevice,

0 commit comments

Comments
 (0)