Skip to content

Commit eca5184

Browse files
committed
Add ULTs for testing multiple drivers and legacy and ddi ext
Signed-off-by: Neil R. Spruit <[email protected]>
1 parent 10bd422 commit eca5184

File tree

4 files changed

+187
-30
lines changed

4 files changed

+187
-30
lines changed

source/drivers/null/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ target_include_directories(ze_null_test2
6565
${CMAKE_CURRENT_SOURCE_DIR}
6666
)
6767

68+
target_compile_definitions(ze_null_test1 PUBLIC ZEL_NULL_DRIVER_ID=1)
69+
target_compile_definitions(ze_null_test2 PUBLIC ZEL_NULL_DRIVER_ID=2)
70+
target_compile_definitions(ze_null PUBLIC ZEL_NULL_DRIVER_ID=1)
71+
6872
if(INSTALL_NULL_DRIVER)
6973
install(TARGETS ze_null_test1
7074
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT level-zero-devel

source/drivers/null/ze_null.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@ namespace driver
6969
auto pNext = reinterpret_cast<ze_base_properties_t *>(pDriverProperties->pNext);
7070
while (pNext) {
7171
auto ddi_test_disable = getenv_string( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT" );
72-
if (pNext->stype == ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES && ddi_test_disable != "1") {
72+
#ifndef ZEL_NULL_DRIVER_ID
73+
#define ZEL_NULL_DRIVER_ID 1
74+
#endif
75+
std::string null_driver_id_str = std::to_string(ZEL_NULL_DRIVER_ID);
76+
if (pNext->stype == ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES && (ddi_test_disable != null_driver_id_str && ddi_test_disable != "3")) {
77+
printf("ldr ddi pfnGetProperties, null driver id %d ddi ext\n", ZEL_NULL_DRIVER_ID);
7378
ze_driver_ddi_handles_ext_properties_t *pDdiHandlesExtProperties = reinterpret_cast<ze_driver_ddi_handles_ext_properties_t *>(pNext);
7479
pDdiHandlesExtProperties->flags = ze_driver_ddi_handle_ext_flag_t::ZE_DRIVER_DDI_HANDLE_EXT_FLAG_DDI_HANDLE_EXT_SUPPORTED;
7580
context.ddiExtensionRequested = true;

0 commit comments

Comments
 (0)