We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 066341f commit c19383bCopy full SHA for c19383b
source/adapters/hip/event.cpp
@@ -330,8 +330,17 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventCreateWithNativeHandle(
330
ur_event_handle_t *phEvent) {
331
std::ignore = pProperties;
332
333
- *phEvent = ur_event_handle_t_::makeWithNative(
334
- hContext, reinterpret_cast<hipEvent_t>(hNativeEvent));
+ try {
+ EventPtr =
335
+ std::unique_ptr<ur_event_handle_t_>(ur_event_handle_t_::makeWithNative(
336
+ hContext, reinterpret_cast<hipEvent_t>(hNativeEvent)));
337
+ } catch (const std::bad_alloc &) {
338
+ return UR_RESULT_ERROR_OUT_OF_HOST_MEMORY;
339
+ } catch (...) {
340
+ return UR_RESULT_ERROR_UNKNOWN;
341
+ }
342
+
343
+ *phEvent = EventPtr.release();
344
345
return UR_RESULT_SUCCESS;
346
}
0 commit comments