Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions source/adapters/cuda/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,17 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventCreateWithNativeHandle(

std::unique_ptr<ur_event_handle_t_> EventPtr{nullptr};

*phEvent = ur_event_handle_t_::makeWithNative(
hContext, reinterpret_cast<CUevent>(hNativeEvent));
try {
EventPtr =
std::unique_ptr<ur_event_handle_t_>(ur_event_handle_t_::makeWithNative(
hContext, reinterpret_cast<CUevent>(hNativeEvent)));
} catch (const std::bad_alloc &) {
return UR_RESULT_ERROR_OUT_OF_HOST_MEMORY;
} catch (...) {
return UR_RESULT_ERROR_UNKNOWN;
}

*phEvent = EventPtr.release();

return UR_RESULT_SUCCESS;
}
Loading