Skip to content

Commit 3e16283

Browse files
Georgi Mirazchiyskiomarahmed1111
authored andcommitted
Check explicitly if the queue member of ur_event is null instead of backend ownership
1 parent e2af0d1 commit 3e16283

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

source/adapters/cuda/event.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventGetInfo(ur_event_handle_t hEvent,
167167
case UR_EVENT_INFO_COMMAND_QUEUE: {
168168
// If the runtime owns the native handle, we have reference to the queue.
169169
// Otherwise, the event handle comes from an interop API with no RT refs.
170-
if (!hEvent->backendHasOwnership()) {
170+
if (!hEvent->getQueue()) {
171171
setErrorMessage("Command queue info cannot be queried for the event. The "
172172
"event object was created from a native event and has no "
173173
"valid reference to a command queue.",
174174
UR_RESULT_ERROR_INVALID_VALUE);
175175
return UR_RESULT_ERROR_ADAPTER_SPECIFIC;
176176
}
177-
assert(hEvent->getQueue());
178177
return ReturnValue(hEvent->getQueue());
179178
}
180179
case UR_EVENT_INFO_COMMAND_TYPE:

source/adapters/hip/event.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventGetInfo(ur_event_handle_t hEvent,
181181
case UR_EVENT_INFO_COMMAND_QUEUE: {
182182
// If the runtime owns the native handle, we have reference to the queue.
183183
// Otherwise, the event handle comes from an interop API with no RT refs.
184-
if (!hEvent->backendHasOwnership()) {
184+
if (!hEvent->getQueue()) {
185185
setErrorMessage("Command queue info cannot be queried for the event. The "
186186
"event object was created from a native event and has no "
187187
"valid reference to a command queue.",
188188
UR_RESULT_ERROR_INVALID_VALUE);
189189
return UR_RESULT_ERROR_ADAPTER_SPECIFIC;
190190
}
191-
assert(hEvent->getQueue());
192191
return ReturnValue(hEvent->getQueue());
193192
}
194193
case UR_EVENT_INFO_COMMAND_TYPE:

0 commit comments

Comments
 (0)