From 4ef9779ad17321fe85b31da9f764088b7bdf540d Mon Sep 17 00:00:00 2001 From: Krzysztof Swiecicki Date: Fri, 17 Jan 2025 16:29:40 +0100 Subject: [PATCH] [L0 v2] Add dependency on UR_DPCXX for kernel tests --- test/adapters/level_zero/v2/CMakeLists.txt | 45 +++++++++++++--------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/test/adapters/level_zero/v2/CMakeLists.txt b/test/adapters/level_zero/v2/CMakeLists.txt index 2bc53669c5..43932463cd 100644 --- a/test/adapters/level_zero/v2/CMakeLists.txt +++ b/test/adapters/level_zero/v2/CMakeLists.txt @@ -63,25 +63,32 @@ add_adapter_test(level_zero_memory_residency ) if(NOT WIN32) - add_adapter_test(level_zero_deferred_kernel - FIXTURE KERNELS - SOURCES - deferred_kernel.cpp - ENVIRONMENT - "UR_ADAPTERS_FORCE_LOAD=\"$\"" - ) + if (NOT UR_DPCXX) + # Tests that require kernels can't be used if we aren't generating + # device binaries + message(WARNING + "UR_DPCXX is not defined, skipping some tests for level_zero_v2 adapter") + else() + add_adapter_test(level_zero_deferred_kernel + FIXTURE KERNELS + SOURCES + deferred_kernel.cpp + ENVIRONMENT + "UR_ADAPTERS_FORCE_LOAD=\"$\"" + ) - set(backend level_zero) - add_adapter_memcheck_test(level_zero_deferred_kernel - FIXTURE KERNELS - SOURCES - deferred_kernel.cpp - ENVIRONMENT - "UR_ADAPTERS_FORCE_LOAD=\"$\"" - ) + set(backend level_zero) + add_adapter_memcheck_test(level_zero_deferred_kernel + FIXTURE KERNELS + SOURCES + deferred_kernel.cpp + ENVIRONMENT + "UR_ADAPTERS_FORCE_LOAD=\"$\"" + ) - target_link_libraries(test-adapter-level_zero_deferred_kernel PRIVATE - LevelZeroLoader - LevelZeroLoader-Headers - ) + target_link_libraries(test-adapter-level_zero_deferred_kernel PRIVATE + LevelZeroLoader + LevelZeroLoader-Headers + ) + endif() endif()