Skip to content

Commit 32aaa06

Browse files
committed
[L0 v2] add missing getInfo support to enable USM tests
1 parent d0f03f8 commit 32aaa06

File tree

4 files changed

+34
-9
lines changed

4 files changed

+34
-9
lines changed

source/adapters/level_zero/v2/api.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -299,13 +299,6 @@ ur_result_t urKernelGetSuggestedLocalWorkSize(ur_kernel_handle_t hKernel,
299299
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
300300
}
301301

302-
ur_result_t urEventGetInfo(ur_event_handle_t hEvent, ur_event_info_t propName,
303-
size_t propSize, void *pPropValue,
304-
size_t *pPropSizeRet) {
305-
logger::error("{} function not implemented!", __FUNCTION__);
306-
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
307-
}
308-
309302
ur_result_t urEventGetProfilingInfo(ur_event_handle_t hEvent,
310303
ur_profiling_info_t propName,
311304
size_t propSize, void *pPropValue,

source/adapters/level_zero/v2/context.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ ur_result_t urContextGetInfo(ur_context_handle_t hContext,
103103
return ReturnValue(uint32_t(hContext->getDevices().size()));
104104
case UR_CONTEXT_INFO_REFERENCE_COUNT:
105105
return ReturnValue(uint32_t{hContext->RefCount.load()});
106+
case UR_CONTEXT_INFO_USM_MEMCPY2D_SUPPORT:
107+
// TODO: this is currently not implemented
108+
return ReturnValue(uint8_t{false});
109+
case UR_CONTEXT_INFO_USM_FILL2D_SUPPORT:
110+
// 2D USM fill is not supported.
111+
return ReturnValue(uint8_t{false});
106112
default:
107113
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
108114
}

source/adapters/level_zero/v2/event.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,32 @@ ur_result_t urEventWait(uint32_t numEvents,
6060
}
6161
return UR_RESULT_SUCCESS;
6262
}
63+
64+
ur_result_t urEventGetInfo(ur_event_handle_t hEvent, ur_event_info_t propName,
65+
size_t propValueSize, void *pPropValue,
66+
size_t *pPropValueSizeRet) {
67+
UrReturnHelper returnValue(propValueSize, pPropValue, pPropValueSizeRet);
68+
69+
switch (propName) {
70+
case UR_EVENT_INFO_COMMAND_EXECUTION_STATUS: {
71+
auto zeStatus = ZE_CALL_NOCHECK(zeEventQueryStatus, (hEvent->getZeEvent()));
72+
73+
if (zeStatus == ZE_RESULT_NOT_READY) {
74+
return returnValue(UR_EVENT_STATUS_SUBMITTED);
75+
} else {
76+
return returnValue(UR_EVENT_STATUS_COMPLETE);
77+
}
78+
}
79+
case UR_EVENT_INFO_REFERENCE_COUNT: {
80+
return returnValue(hEvent->RefCount.load());
81+
}
82+
default:
83+
logger::error(
84+
"Unsupported ParamName in urEventGetInfo: ParamName=ParamName={}(0x{})",
85+
propName, logger::toHex(propName));
86+
return UR_RESULT_ERROR_INVALID_VALUE;
87+
}
88+
89+
return UR_RESULT_SUCCESS;
90+
}
6391
} // namespace ur::level_zero
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
urContextCreateWithNativeHandleTest.InvalidNullHandleAdapter/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}__
22
urContextCreateWithNativeHandleTest.InvalidNullPointerContext/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}__
3-
urContextGetInfoTestWithInfoParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}____UR_CONTEXT_INFO_USM_MEMCPY2D_SUPPORT
4-
urContextGetInfoTestWithInfoParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}____UR_CONTEXT_INFO_USM_FILL2D_SUPPORT
53
urContextSetExtendedDeleterTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}__

0 commit comments

Comments
 (0)