From c26d47e4f429061a6f5e870b667bb84528266a4a Mon Sep 17 00:00:00 2001 From: Ross Brunton Date: Wed, 11 Sep 2024 17:37:04 +0100 Subject: [PATCH] [CI] Add "loader" support to conformance testing This expands our CI to test the loader; the dispatcher that is used when multiple adapters are availabe. Previously, the unit tests forced a specific adapter, via `UR_ADAPTERS_FORCE_LOAD`. Now an extra "loader" target is created for each test suite, which doesn't set that variable and allows the loader to be used. In addition, the test runner's adapter selection logic has been rewritten to support a "--backend" variable, which allows you to select a backend (OpenCL, Level Zero, etc.). The platform selection has also been expanded to support filtering by a backend to match that platform only on that backend (e.g. `UR_CTS_ADAPTER_PLATFORM="opencl:Fictional Corp(R)"`). The old "run on hardware" jobs should behave the same (they have the loader tests disabled), but there is a new `combined-opencl-level-zero` job that tests a build with both OpenCL and Level Zero available. --- .github/workflows/build-hw-reusable.yml | 25 +- .github/workflows/cmake.yml | 9 + .github/workflows/multi_device.yml | 1 + CMakeLists.txt | 1 + scripts/templates/ldrddi.cpp.mako | 3 + source/loader/ur_ldrddi.cpp | 561 ++++++++++++++++++ test/adapters/CMakeLists.txt | 2 +- test/conformance/CMakeLists.txt | 43 +- .../adapter_adapter_native_cpu_loader.match | 1 + .../context_adapter_level_zero_loader.match | 1 + ...context_adapter_level_zero_v2_loader.match | 1 + .../context_adapter_native_cpu_loader.match | 1 + test/conformance/cts_exe.py | 4 +- .../device/device_adapter_cuda_loader.match | 1 + .../device/device_adapter_hip_loader.match | 1 + .../device_adapter_level_zero_loader.match | 1 + .../device_adapter_level_zero_v2_loader.match | 1 + .../device_adapter_native_cpu_loader.match | 1 + .../device/device_adapter_opencl_loader.match | 1 + test/conformance/device_code/single.cpp | 20 + .../enqueue/enqueue_adapter_cuda_loader.match | 1 + .../enqueue/enqueue_adapter_hip_loader.match | 1 + .../enqueue_adapter_level_zero_loader.match | 1 + ...enqueue_adapter_level_zero_v2_loader.match | 1 + .../enqueue_adapter_native_cpu_loader.match | 1 + .../enqueue_adapter_opencl_loader.match | 1 + .../event/event_adapter_cuda_loader.match | 1 + .../event/event_adapter_hip_loader.match | 1 + .../event_adapter_level_zero_loader.match | 1 + .../event_adapter_level_zero_v2_loader.match | 1 + .../event_adapter_native_cpu_loader.match | 1 + ...p_command_buffer_adapter_cuda_loader.match | 1 + ...xp_command_buffer_adapter_hip_loader.match | 1 + ..._buffer_adapter_level_zero_v2_loader.match | 1 + ...and_buffer_adapter_native_cpu_loader.match | 1 + ..._native_adapter_level_zero_v2_loader.match | 1 + ...properties_adapter_native_cpu_loader.match | 1 + ...ntegration_adapter_level_zero_loader.match | 1 + ...gration_adapter_level_zero_v2_loader.match | 1 + ...ntegration_adapter_native_cpu_loader.match | 1 + .../integration_adapter_opencl_loader.match | 1 + .../kernel/kernel_adapter_cuda_loader.match | 1 + .../kernel/kernel_adapter_hip_loader.match | 1 + .../kernel_adapter_level_zero_loader.match | 1 + .../kernel_adapter_level_zero_v2_loader.match | 1 + .../kernel_adapter_native_cpu_loader.match | 1 + .../kernel/kernel_adapter_opencl_loader.match | 1 + .../memory/memory_adapter_cuda_loader.match | 1 + .../memory/memory_adapter_hip_loader.match | 1 + .../memory_adapter_level_zero_loader.match | 1 + .../memory_adapter_level_zero_v2_loader.match | 1 + .../memory_adapter_native_cpu_loader.match | 1 + .../memory/memory_adapter_opencl_loader.match | 1 + .../platform_adapter_cuda_loader.match | 1 + .../platform_adapter_hip_loader.match | 1 + .../platform_adapter_native_cpu_loader.match | 1 + .../program/program_adapter_cuda_loader.match | 1 + .../program/program_adapter_hip_loader.match | 1 + .../program_adapter_level_zero_loader.match | 1 + ...program_adapter_level_zero_v2_loader.match | 1 + .../program_adapter_native_cpu_loader.match | 1 + .../program_adapter_opencl_loader.match | 1 + .../queue_adapter_level_zero_loader.match | 1 + .../queue_adapter_native_cpu_loader.match | 1 + .../sampler_adapter_level_zero_loader.match | 1 + ...sampler_adapter_level_zero_v2_loader.match | 1 + test/conformance/source/environment.cpp | 229 +++++-- .../testing/include/uur/environment.h | 4 +- .../usm/usm_adapter_cuda_loader.match | 1 + .../usm/usm_adapter_hip_loader.match | 1 + .../usm/usm_adapter_level_zero_loader.match | 1 + .../usm_adapter_level_zero_v2_loader.match | 1 + .../usm/usm_adapter_native_cpu_loader.match | 1 + .../usm/usm_adapter_opencl_loader.match | 1 + ...ual_memory_adapter_level_zero_loader.match | 1 + ..._memory_adapter_level_zero_v2_loader.match | 1 + 76 files changed, 897 insertions(+), 69 deletions(-) create mode 120000 test/conformance/adapter/adapter_adapter_native_cpu_loader.match create mode 120000 test/conformance/context/context_adapter_level_zero_loader.match create mode 120000 test/conformance/context/context_adapter_level_zero_v2_loader.match create mode 120000 test/conformance/context/context_adapter_native_cpu_loader.match create mode 120000 test/conformance/device/device_adapter_cuda_loader.match create mode 120000 test/conformance/device/device_adapter_hip_loader.match create mode 120000 test/conformance/device/device_adapter_level_zero_loader.match create mode 120000 test/conformance/device/device_adapter_level_zero_v2_loader.match create mode 120000 test/conformance/device/device_adapter_native_cpu_loader.match create mode 120000 test/conformance/device/device_adapter_opencl_loader.match create mode 100644 test/conformance/device_code/single.cpp create mode 120000 test/conformance/enqueue/enqueue_adapter_cuda_loader.match create mode 120000 test/conformance/enqueue/enqueue_adapter_hip_loader.match create mode 120000 test/conformance/enqueue/enqueue_adapter_level_zero_loader.match create mode 120000 test/conformance/enqueue/enqueue_adapter_level_zero_v2_loader.match create mode 120000 test/conformance/enqueue/enqueue_adapter_native_cpu_loader.match create mode 120000 test/conformance/enqueue/enqueue_adapter_opencl_loader.match create mode 120000 test/conformance/event/event_adapter_cuda_loader.match create mode 120000 test/conformance/event/event_adapter_hip_loader.match create mode 120000 test/conformance/event/event_adapter_level_zero_loader.match create mode 120000 test/conformance/event/event_adapter_level_zero_v2_loader.match create mode 120000 test/conformance/event/event_adapter_native_cpu_loader.match create mode 120000 test/conformance/exp_command_buffer/exp_command_buffer_adapter_cuda_loader.match create mode 120000 test/conformance/exp_command_buffer/exp_command_buffer_adapter_hip_loader.match create mode 120000 test/conformance/exp_command_buffer/exp_command_buffer_adapter_level_zero_v2_loader.match create mode 120000 test/conformance/exp_command_buffer/exp_command_buffer_adapter_native_cpu_loader.match create mode 120000 test/conformance/exp_enqueue_native/exp_enqueue_native_adapter_level_zero_v2_loader.match create mode 120000 test/conformance/exp_launch_properties/exp_launch_properties_adapter_native_cpu_loader.match create mode 120000 test/conformance/integration/integration_adapter_level_zero_loader.match create mode 120000 test/conformance/integration/integration_adapter_level_zero_v2_loader.match create mode 120000 test/conformance/integration/integration_adapter_native_cpu_loader.match create mode 120000 test/conformance/integration/integration_adapter_opencl_loader.match create mode 120000 test/conformance/kernel/kernel_adapter_cuda_loader.match create mode 120000 test/conformance/kernel/kernel_adapter_hip_loader.match create mode 120000 test/conformance/kernel/kernel_adapter_level_zero_loader.match create mode 120000 test/conformance/kernel/kernel_adapter_level_zero_v2_loader.match create mode 120000 test/conformance/kernel/kernel_adapter_native_cpu_loader.match create mode 120000 test/conformance/kernel/kernel_adapter_opencl_loader.match create mode 120000 test/conformance/memory/memory_adapter_cuda_loader.match create mode 120000 test/conformance/memory/memory_adapter_hip_loader.match create mode 120000 test/conformance/memory/memory_adapter_level_zero_loader.match create mode 120000 test/conformance/memory/memory_adapter_level_zero_v2_loader.match create mode 120000 test/conformance/memory/memory_adapter_native_cpu_loader.match create mode 120000 test/conformance/memory/memory_adapter_opencl_loader.match create mode 120000 test/conformance/platform/platform_adapter_cuda_loader.match create mode 120000 test/conformance/platform/platform_adapter_hip_loader.match create mode 120000 test/conformance/platform/platform_adapter_native_cpu_loader.match create mode 120000 test/conformance/program/program_adapter_cuda_loader.match create mode 120000 test/conformance/program/program_adapter_hip_loader.match create mode 120000 test/conformance/program/program_adapter_level_zero_loader.match create mode 120000 test/conformance/program/program_adapter_level_zero_v2_loader.match create mode 120000 test/conformance/program/program_adapter_native_cpu_loader.match create mode 120000 test/conformance/program/program_adapter_opencl_loader.match create mode 120000 test/conformance/queue/queue_adapter_level_zero_loader.match create mode 120000 test/conformance/queue/queue_adapter_native_cpu_loader.match create mode 120000 test/conformance/sampler/sampler_adapter_level_zero_loader.match create mode 120000 test/conformance/sampler/sampler_adapter_level_zero_v2_loader.match create mode 120000 test/conformance/usm/usm_adapter_cuda_loader.match create mode 120000 test/conformance/usm/usm_adapter_hip_loader.match create mode 120000 test/conformance/usm/usm_adapter_level_zero_loader.match create mode 120000 test/conformance/usm/usm_adapter_level_zero_v2_loader.match create mode 120000 test/conformance/usm/usm_adapter_native_cpu_loader.match create mode 120000 test/conformance/usm/usm_adapter_opencl_loader.match create mode 120000 test/conformance/virtual_memory/virtual_memory_adapter_level_zero_loader.match create mode 120000 test/conformance/virtual_memory/virtual_memory_adapter_level_zero_v2_loader.match diff --git a/.github/workflows/build-hw-reusable.yml b/.github/workflows/build-hw-reusable.yml index fa23c38248..49dc20ed4b 100644 --- a/.github/workflows/build-hw-reusable.yml +++ b/.github/workflows/build-hw-reusable.yml @@ -7,6 +7,10 @@ on: adapter_name: required: true type: string + other_adapter_name: + required: false + type: string + default: "" runner_name: required: true type: string @@ -14,6 +18,10 @@ on: required: false type: string default: "" + other_platform: + required: false + type: string + default: "" static_loader: required: false type: string @@ -39,9 +47,14 @@ jobs: if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks won't have the HW strategy: matrix: - adapter: [ - {name: "${{inputs.adapter_name}}", platform: "${{inputs.platform}}", static_Loader: "${{inputs.static_loader}}", static_adapter: "${{inputs.static_loader}}"}, - ] + adapter: [{ + name: "${{inputs.adapter_name}}", + other_name: "${{inputs.other_adapter_name}}", + platform: "${{inputs.platform}}", + other_platform: "${{inputs.other_platform}}", + static_Loader: "${{inputs.static_loader}}", + static_adapter: "${{inputs.static_loader}}" + }] build_type: [Debug, Release] compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}] # TODO: The latest L0 loader segfaults when built with clang. @@ -83,10 +96,12 @@ jobs: -DUR_DEVELOPER_MODE=ON -DUR_BUILD_TESTS=ON -DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON + ${{ matrix.adapter.other_name != '' && format('-DUR_BUILD_ADAPTER_{0}=ON', matrix.adapter.other_name) || '' }} -DUR_STATIC_LOADER=${{matrix.adapter.static_Loader}} -DUR_STATIC_ADAPTER_${{matrix.adapter.name}}=${{matrix.adapter.static_adapter}} -DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++ -DUR_SYCL_LIBRARY_DIR=${{github.workspace}}/dpcpp_compiler/lib + -DUR_CONFORMANCE_TEST_LOADER=${{ matrix.adapter.other_name != '' && 'ON' || 'OFF' }} ${{ matrix.adapter.name == 'HIP' && '-DUR_CONFORMANCE_AMD_ARCH=gfx1030' || '' }} ${{ matrix.adapter.name == 'HIP' && '-DUR_HIP_PLATFORM=AMD' || '' }} @@ -97,10 +112,12 @@ jobs: - name: Test adapter specific working-directory: ${{github.workspace}}/build run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" --timeout 180 + # Don't run adapter specific tests when building multiple adapters + if: ${{ matrix.adapter.other_name == '' }} - name: Test adapters working-directory: ${{github.workspace}}/build - run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" --timeout 180 + run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.name}}:${{matrix.adapter.platform}};${{matrix.adapter.other_name}}:${{matrix.adapter.other_platform}}" ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" --timeout 180 - name: Get information about platform if: ${{ always() }} diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 81fa01e2f0..bad7a1354f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -186,6 +186,15 @@ jobs: adapter_name: NATIVE_CPU runner_name: NATIVE_CPU + combined-opencl-level-zero: + name: OpenCL + Level Zero + uses: ./.github/workflows/build-hw-reusable.yml + with: + adapter_name: OPENCL + other_adapter_name: L0 + runner_name: L0 + platform: "Intel(R) OpenCL" + e2e-level-zero: name: E2E L0 permissions: diff --git a/.github/workflows/multi_device.yml b/.github/workflows/multi_device.yml index 87ec1932f4..700a3c1145 100644 --- a/.github/workflows/multi_device.yml +++ b/.github/workflows/multi_device.yml @@ -48,6 +48,7 @@ jobs: -DUR_DEVELOPER_MODE=ON -DUR_BUILD_TESTS=ON -DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON + -DUR_CONFORMANCE_TEST_LOADER=OFF -DUR_TEST_DEVICES_COUNT=2 - name: Build diff --git a/CMakeLists.txt b/CMakeLists.txt index a908a22d80..ea2c6586d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,6 +68,7 @@ set(UR_CONFORMANCE_TARGET_TRIPLES "" CACHE STRING "List of sycl targets to build CTS device binaries for") set(UR_CONFORMANCE_AMD_ARCH "" CACHE STRING "AMD device target ID to build CTS binaries for") option(UR_CONFORMANCE_ENABLE_MATCH_FILES "Enable CTS match files" ON) +option(UR_CONFORMANCE_TEST_LOADER "Also test the loader in the conformance tests" ON) set(UR_ADAPTER_LEVEL_ZERO_SOURCE_DIR "" CACHE PATH "Path to external 'level_zero' adapter source dir") set(UR_ADAPTER_OPENCL_SOURCE_DIR "" CACHE PATH diff --git a/scripts/templates/ldrddi.cpp.mako b/scripts/templates/ldrddi.cpp.mako index 9c797a0ec3..87417088a5 100644 --- a/scripts/templates/ldrddi.cpp.mako +++ b/scripts/templates/ldrddi.cpp.mako @@ -40,6 +40,9 @@ namespace ur_loader add_local = False %>${th.get_initial_null_set(obj)} + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); %if re.match(r"\w+AdapterGet$", th.make_func_name(n, tags, obj)): diff --git a/source/loader/ur_ldrddi.cpp b/source/loader/ur_ldrddi.cpp index 4d384dbb52..eca995d27b 100644 --- a/source/loader/ur_ldrddi.cpp +++ b/source/loader/ur_ldrddi.cpp @@ -30,6 +30,9 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGet( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); size_t adapterIndex = 0; @@ -70,6 +73,9 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRelease( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -95,6 +101,9 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRetain( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -126,6 +135,9 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGetLastError( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -161,6 +173,9 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGetInfo( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -200,6 +215,9 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGet( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); uint32_t total_platform_handle_count = 0; @@ -276,6 +294,9 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetInfo( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -304,6 +325,9 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetApiVersion( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -332,6 +356,9 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetNativeHandle( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -369,6 +396,9 @@ __urdlllocal ur_result_t UR_APICALL urPlatformCreateWithNativeHandle( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -414,6 +444,9 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetBackendOption( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -452,6 +485,9 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGet( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -504,6 +540,9 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetInfo( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -599,6 +638,9 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRetain( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -625,6 +667,9 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRelease( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -660,6 +705,9 @@ __urdlllocal ur_result_t UR_APICALL urDevicePartition( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -710,6 +758,9 @@ __urdlllocal ur_result_t UR_APICALL urDeviceSelectBinary( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -737,6 +788,9 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetNativeHandle( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -773,6 +827,9 @@ __urdlllocal ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -819,6 +876,9 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetGlobalTimestamps( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -850,6 +910,9 @@ __urdlllocal ur_result_t UR_APICALL urContextCreate( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -895,6 +958,9 @@ __urdlllocal ur_result_t UR_APICALL urContextRetain( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -921,6 +987,9 @@ __urdlllocal ur_result_t UR_APICALL urContextRelease( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -958,6 +1027,9 @@ __urdlllocal ur_result_t UR_APICALL urContextGetInfo( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1018,6 +1090,9 @@ __urdlllocal ur_result_t UR_APICALL urContextGetNativeHandle( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1058,6 +1133,9 @@ __urdlllocal ur_result_t UR_APICALL urContextCreateWithNativeHandle( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1110,6 +1188,9 @@ __urdlllocal ur_result_t UR_APICALL urContextSetExtendedDeleter( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1141,6 +1222,9 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreate( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1185,6 +1269,9 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreate( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1223,6 +1310,9 @@ __urdlllocal ur_result_t UR_APICALL urMemRetain( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1249,6 +1339,9 @@ __urdlllocal ur_result_t UR_APICALL urMemRelease( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1281,6 +1374,9 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferPartition( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1324,6 +1420,9 @@ __urdlllocal ur_result_t UR_APICALL urMemGetNativeHandle( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1364,6 +1463,9 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreateWithNativeHandle( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1412,6 +1514,9 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreateWithNativeHandle( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1463,6 +1568,9 @@ __urdlllocal ur_result_t UR_APICALL urMemGetInfo( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1532,6 +1640,9 @@ __urdlllocal ur_result_t UR_APICALL urMemImageGetInfo( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1561,6 +1672,9 @@ __urdlllocal ur_result_t UR_APICALL urSamplerCreate( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1600,6 +1714,9 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRetain( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1626,6 +1743,9 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRelease( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1659,6 +1779,9 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetInfo( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1719,6 +1842,9 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetNativeHandle( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1754,6 +1880,9 @@ __urdlllocal ur_result_t UR_APICALL urSamplerCreateWithNativeHandle( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1801,6 +1930,9 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1838,6 +1970,9 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1878,6 +2013,9 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1911,6 +2049,9 @@ __urdlllocal ur_result_t UR_APICALL urUSMFree( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -1946,6 +2087,9 @@ __urdlllocal ur_result_t UR_APICALL urUSMGetMemAllocInfo( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2021,6 +2165,9 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolCreate( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2059,6 +2206,9 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRetain( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2084,6 +2234,9 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRelease( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2116,6 +2269,9 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfo( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2189,6 +2345,9 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemGranularityGetInfo( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2229,6 +2388,9 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemReserve( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2257,6 +2419,9 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemFree( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2291,6 +2456,9 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemMap( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2323,6 +2491,9 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemUnmap( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2353,6 +2524,9 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemSetAccess( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2391,6 +2565,9 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemGetInfo( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2425,6 +2602,9 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemCreate( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2467,6 +2647,9 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRetain( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2495,6 +2678,9 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRelease( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2528,6 +2714,9 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithIL( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2574,6 +2763,9 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithBinary( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2619,6 +2811,9 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuild( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2651,6 +2846,9 @@ __urdlllocal ur_result_t UR_APICALL urProgramCompile( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2689,6 +2887,9 @@ __urdlllocal ur_result_t UR_APICALL urProgramLink( *phProgram = nullptr; } + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2734,6 +2935,9 @@ __urdlllocal ur_result_t UR_APICALL urProgramRetain( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2760,6 +2964,9 @@ __urdlllocal ur_result_t UR_APICALL urProgramRelease( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2794,6 +3001,9 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetFunctionPointer( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2833,6 +3043,9 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetGlobalVariablePointer( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2875,6 +3088,9 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetInfo( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2958,6 +3174,9 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetBuildInfo( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -2991,6 +3210,9 @@ __urdlllocal ur_result_t UR_APICALL urProgramSetSpecializationConstants( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3019,6 +3241,9 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetNativeHandle( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3054,6 +3279,9 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithNativeHandle( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3097,6 +3325,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelCreate( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3142,6 +3373,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgValue( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3172,6 +3406,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgLocal( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3209,6 +3446,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetInfo( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3289,6 +3529,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetGroupInfo( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3328,6 +3571,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetSubGroupInfo( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3357,6 +3603,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelRetain( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3383,6 +3632,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelRelease( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3414,6 +3666,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3446,6 +3701,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetExecInfo( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3476,6 +3734,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3508,6 +3769,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3541,6 +3805,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetSpecializationConstants( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3569,6 +3836,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetNativeHandle( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3606,6 +3876,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelCreateWithNativeHandle( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3665,6 +3938,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetSuggestedLocalWorkSize( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3704,6 +3980,9 @@ __urdlllocal ur_result_t UR_APICALL urQueueGetInfo( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3791,6 +4070,9 @@ __urdlllocal ur_result_t UR_APICALL urQueueCreate( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3833,6 +4115,9 @@ __urdlllocal ur_result_t UR_APICALL urQueueRetain( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3859,6 +4144,9 @@ __urdlllocal ur_result_t UR_APICALL urQueueRelease( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3888,6 +4176,9 @@ __urdlllocal ur_result_t UR_APICALL urQueueGetNativeHandle( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3924,6 +4215,9 @@ __urdlllocal ur_result_t UR_APICALL urQueueCreateWithNativeHandle( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3969,6 +4263,9 @@ __urdlllocal ur_result_t UR_APICALL urQueueFinish( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -3994,6 +4291,9 @@ __urdlllocal ur_result_t UR_APICALL urQueueFlush( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -4025,6 +4325,9 @@ __urdlllocal ur_result_t UR_APICALL urEventGetInfo( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -4104,6 +4407,9 @@ __urdlllocal ur_result_t UR_APICALL urEventGetProfilingInfo( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -4133,6 +4439,9 @@ __urdlllocal ur_result_t UR_APICALL urEventWait( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -4163,6 +4472,9 @@ __urdlllocal ur_result_t UR_APICALL urEventRetain( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -4188,6 +4500,9 @@ __urdlllocal ur_result_t UR_APICALL urEventRelease( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -4215,6 +4530,9 @@ __urdlllocal ur_result_t UR_APICALL urEventGetNativeHandle( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -4250,6 +4568,9 @@ __urdlllocal ur_result_t UR_APICALL urEventCreateWithNativeHandle( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -4294,6 +4615,9 @@ __urdlllocal ur_result_t UR_APICALL urEventSetCallback( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -4345,6 +4669,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunch( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -4410,6 +4737,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWait( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -4470,6 +4800,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrier( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -4536,6 +4869,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferRead( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -4607,6 +4943,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWrite( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -4688,6 +5027,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferReadRect( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -4773,6 +5115,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWriteRect( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -4844,6 +5189,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopy( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -4926,6 +5274,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopyRect( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -4999,6 +5350,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferFill( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -5073,6 +5427,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageRead( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -5148,6 +5505,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageWrite( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -5224,6 +5584,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageCopy( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -5298,6 +5661,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferMap( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -5364,6 +5730,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemUnmap( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -5434,6 +5803,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFill( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -5500,6 +5872,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMMemcpy( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -5564,6 +5939,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMPrefetch( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -5621,6 +5999,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMAdvise( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -5684,6 +6065,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFill2D( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -5756,6 +6140,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMMemcpy2D( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -5825,6 +6212,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableWrite( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -5898,6 +6288,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableRead( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -5975,6 +6368,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueReadHostPipe( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6051,6 +6447,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueWriteHostPipe( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6117,6 +6516,9 @@ __urdlllocal ur_result_t UR_APICALL urUSMPitchedAllocExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6154,6 +6556,9 @@ urBindlessImagesUnsampledImageHandleDestroyExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6187,6 +6592,9 @@ urBindlessImagesSampledImageHandleDestroyExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6222,6 +6630,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6259,6 +6670,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6295,6 +6709,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6338,6 +6755,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6399,6 +6819,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6455,6 +6878,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6487,6 +6913,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6524,6 +6953,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6560,6 +6992,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalMemoryExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6611,6 +7046,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6655,6 +7093,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalLinearMemoryExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6692,6 +7133,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseExternalMemoryExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6732,6 +7176,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6780,6 +7227,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseExternalSemaphoreExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6833,6 +7283,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesWaitExternalSemaphoreExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6907,6 +7360,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSignalExternalSemaphoreExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -6968,6 +7424,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferCreateExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7011,6 +7470,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferRetainExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7041,6 +7503,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferReleaseExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7071,6 +7536,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferFinalizeExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7129,6 +7597,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7201,6 +7672,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMMemcpyExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7246,6 +7720,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMFillExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7291,6 +7768,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7342,6 +7822,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7389,6 +7872,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7444,6 +7930,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyRectExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7509,6 +7998,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteRectExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7569,6 +8061,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadRectExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7619,6 +8114,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferFillExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7665,6 +8163,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMPrefetchExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7708,6 +8209,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMAdviseExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7751,6 +8255,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferEnqueueExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7808,6 +8315,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferRetainCommandExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7839,6 +8349,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferReleaseCommandExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7872,6 +8385,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateKernelLaunchExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7941,6 +8457,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferGetInfoExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -7981,6 +8500,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferCommandGetInfoExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -8038,6 +8560,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueCooperativeKernelLaunchExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -8101,6 +8626,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelSuggestMaxCooperativeGroupCountExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -8146,6 +8674,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueTimestampRecordingExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -8220,6 +8751,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunchCustomExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -8257,6 +8791,9 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuildExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -8295,6 +8832,9 @@ __urdlllocal ur_result_t UR_APICALL urProgramCompileExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -8341,6 +8881,9 @@ __urdlllocal ur_result_t UR_APICALL urProgramLinkExp( *phProgram = nullptr; } + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -8394,6 +8937,9 @@ __urdlllocal ur_result_t UR_APICALL urUSMImportExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -8420,6 +8966,9 @@ __urdlllocal ur_result_t UR_APICALL urUSMReleaseExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -8447,6 +8996,9 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PEnablePeerAccessExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -8479,6 +9031,9 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PDisablePeerAccessExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -8523,6 +9078,9 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PPeerAccessGetInfoExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table @@ -8575,6 +9133,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueNativeCommandExp( ) { ur_result_t result = UR_RESULT_SUCCESS; + // For testing + abort(); + [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table diff --git a/test/adapters/CMakeLists.txt b/test/adapters/CMakeLists.txt index 78f0306d7b..54f8f76a7b 100644 --- a/test/adapters/CMakeLists.txt +++ b/test/adapters/CMakeLists.txt @@ -63,7 +63,7 @@ function(add_adapter_memcheck_test name) add_test(NAME ${test_name} COMMAND ${CMAKE_COMMAND} -D TEST_FILE=valgrind - -D TEST_ARGS="--tool=memcheck --leak-check=full $ --devices_count=${UR_TEST_DEVICES_COUNT} --platforms_count=${UR_TEST_DEVICES_COUNT}" + -D TEST_ARGS="--tool=memcheck --leak-check=full $ --backend=${backend} --devices_count=${UR_TEST_DEVICES_COUNT} --platforms_count=${UR_TEST_DEVICES_COUNT}" -D MODE=stderr -D MATCH_FILE=${CMAKE_CURRENT_SOURCE_DIR}/${name}_memcheck.match -P ${PROJECT_SOURCE_DIR}/cmake/match.cmake diff --git a/test/conformance/CMakeLists.txt b/test/conformance/CMakeLists.txt index b45a3fc3da..815dee2ed5 100644 --- a/test/conformance/CMakeLists.txt +++ b/test/conformance/CMakeLists.txt @@ -9,7 +9,7 @@ set(UR_CONFORMANCE_DEVICE_BINARIES_DIR "${CMAKE_CURRENT_BINARY_DIR}/device_binaries" CACHE INTERNAL "Internal cache variable for device binaries directory") -function(add_test_adapter name adapter) +function(add_test_adapter name adapter backend force) if(NOT "${ARGN}" STREQUAL "") set(EXTRA_NAME "-${ARGN}") endif() @@ -17,7 +17,7 @@ function(add_test_adapter name adapter) set(TEST_NAME ${name}-${adapter}${EXTRA_NAME}) set(TEST_COMMAND - "${PROJECT_BINARY_DIR}/bin/${TEST_TARGET_NAME} --devices_count=${UR_TEST_DEVICES_COUNT} --platforms_count=${UR_TEST_PLATFORMS_COUNT}" + "${PROJECT_BINARY_DIR}/bin/${TEST_TARGET_NAME} --backend=${backend} --devices_count=${UR_TEST_DEVICES_COUNT} --platforms_count=${UR_TEST_PLATFORMS_COUNT}" ) set(MATCH_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${name}_${adapter}${EXTRA_NAME}.match") @@ -41,7 +41,9 @@ function(add_test_adapter name adapter) ) endif() - set(TEST_ENV UR_ADAPTERS_FORCE_LOAD="$") + if(${force}) + set(TEST_ENV UR_ADAPTERS_FORCE_LOAD="$") + endif() if(UR_CONFORMANCE_ENABLE_MATCH_FILES) list(APPEND TEST_ENV GTEST_COLOR=no) endif() @@ -66,29 +68,50 @@ function(add_conformance_test name) unit_tests_helpers) if(UR_BUILD_ADAPTER_CUDA OR UR_BUILD_ADAPTER_ALL) - add_test_adapter(${name} adapter_cuda) + add_test_adapter(${name} adapter_cuda CUDA ON) endif() if(UR_BUILD_ADAPTER_HIP OR UR_BUILD_ADAPTER_ALL) - add_test_adapter(${name} adapter_hip) + add_test_adapter(${name} adapter_hip HIP ON) endif() if(UR_BUILD_ADAPTER_L0 OR UR_BUILD_ADAPTER_ALL) - add_test_adapter(${name} adapter_level_zero) + add_test_adapter(${name} adapter_level_zero LEVEL_ZERO ON) endif() if(UR_BUILD_ADAPTER_L0_V2) - add_test_adapter(${name} adapter_level_zero_v2) + add_test_adapter(${name} adapter_level_zero_v2 LEVEL_ZERO ON) endif() if(UR_BUILD_ADAPTER_OPENCL OR UR_BUILD_ADAPTER_ALL) - add_test_adapter(${name} adapter_opencl) + add_test_adapter(${name} adapter_opencl OPENCL ON) endif() if(UR_BUILD_ADAPTER_NATIVE_CPU OR UR_BUILD_ADAPTER_ALL) - add_test_adapter(${name} adapter_native_cpu) + add_test_adapter(${name} adapter_native_cpu NATIVE_CPU ON) + endif() + + if(UR_CONFORMANCE_TEST_LOADER) + if(UR_BUILD_ADAPTER_CUDA OR UR_BUILD_ADAPTER_ALL) + add_test_adapter(${name} adapter_cuda_loader CUDA OFF) + endif() + if(UR_BUILD_ADAPTER_HIP OR UR_BUILD_ADAPTER_ALL) + add_test_adapter(${name} adapter_hip_loader HIP OFF) + endif() + if(UR_BUILD_ADAPTER_L0 OR UR_BUILD_ADAPTER_ALL) + add_test_adapter(${name} adapter_level_zero_loader LEVEL_ZERO OFF) + endif() + if(UR_BUILD_ADAPTER_L0_V2) + add_test_adapter(${name} adapter_level_zero_v2_loader LEVEL_ZERO OFF) + endif() + if(UR_BUILD_ADAPTER_OPENCL OR UR_BUILD_ADAPTER_ALL) + add_test_adapter(${name} adapter_opencl_loader OPENCL OFF) + endif() + if(UR_BUILD_ADAPTER_NATIVE_CPU OR UR_BUILD_ADAPTER_ALL) + add_test_adapter(${name} adapter_native_cpu_loader NATIVE_CPU OFF) + endif() endif() if(NOT (UR_BUILD_ADAPTER_CUDA OR UR_BUILD_ADAPTER_HIP OR UR_BUILD_ADAPTER_L0 OR UR_BUILD_ADAPTER_OPENCL OR UR_BUILD_ADAPTER_NATIVE_CPU OR UR_BUILD_ADAPTER_L0_V2 OR UR_BUILD_ADAPTER_ALL)) - add_test_adapter(${name} adapter_mock) + add_test_adapter(${name} adapter_mock MOCK ON) endif() endfunction() diff --git a/test/conformance/adapter/adapter_adapter_native_cpu_loader.match b/test/conformance/adapter/adapter_adapter_native_cpu_loader.match new file mode 120000 index 0000000000..6ea94ce644 --- /dev/null +++ b/test/conformance/adapter/adapter_adapter_native_cpu_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/adapter/adapter_adapter_native_cpu.match \ No newline at end of file diff --git a/test/conformance/context/context_adapter_level_zero_loader.match b/test/conformance/context/context_adapter_level_zero_loader.match new file mode 120000 index 0000000000..b36695adbe --- /dev/null +++ b/test/conformance/context/context_adapter_level_zero_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/context/context_adapter_level_zero.match \ No newline at end of file diff --git a/test/conformance/context/context_adapter_level_zero_v2_loader.match b/test/conformance/context/context_adapter_level_zero_v2_loader.match new file mode 120000 index 0000000000..5335ccdd3b --- /dev/null +++ b/test/conformance/context/context_adapter_level_zero_v2_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/context/context_adapter_level_zero_v2.match \ No newline at end of file diff --git a/test/conformance/context/context_adapter_native_cpu_loader.match b/test/conformance/context/context_adapter_native_cpu_loader.match new file mode 120000 index 0000000000..c4a02ab93a --- /dev/null +++ b/test/conformance/context/context_adapter_native_cpu_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/context/context_adapter_native_cpu.match \ No newline at end of file diff --git a/test/conformance/cts_exe.py b/test/conformance/cts_exe.py index 3434c1727c..4272509cd4 100644 --- a/test/conformance/cts_exe.py +++ b/test/conformance/cts_exe.py @@ -23,11 +23,13 @@ parser.add_argument("--test_command", help="Ctest test case") parser.add_argument("--devices_count", type=str, help="Number of devices on which tests will be run") parser.add_argument("--platforms_count", type=str, help="Number of platforms on which tests will be run") + parser.add_argument("--backend", type=str, help="Number of platforms on which tests will be run") args = parser.parse_args() result = subprocess.Popen([args.test_command, '--gtest_brief=1', # nosec B603 f'--devices_count={args.devices_count}', - f'--platforms_count={args.platforms_count}'], + f'--platforms_count={args.platforms_count}', + f'--backend={args.backend}'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True) pat = re.compile(r'\[( )*FAILED( )*\]') diff --git a/test/conformance/device/device_adapter_cuda_loader.match b/test/conformance/device/device_adapter_cuda_loader.match new file mode 120000 index 0000000000..54f2ad3d46 --- /dev/null +++ b/test/conformance/device/device_adapter_cuda_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/device/device_adapter_cuda.match \ No newline at end of file diff --git a/test/conformance/device/device_adapter_hip_loader.match b/test/conformance/device/device_adapter_hip_loader.match new file mode 120000 index 0000000000..2f476eb216 --- /dev/null +++ b/test/conformance/device/device_adapter_hip_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/device/device_adapter_hip.match \ No newline at end of file diff --git a/test/conformance/device/device_adapter_level_zero_loader.match b/test/conformance/device/device_adapter_level_zero_loader.match new file mode 120000 index 0000000000..bbf39f644d --- /dev/null +++ b/test/conformance/device/device_adapter_level_zero_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/device/device_adapter_level_zero.match \ No newline at end of file diff --git a/test/conformance/device/device_adapter_level_zero_v2_loader.match b/test/conformance/device/device_adapter_level_zero_v2_loader.match new file mode 120000 index 0000000000..e60a321899 --- /dev/null +++ b/test/conformance/device/device_adapter_level_zero_v2_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/device/device_adapter_level_zero_v2.match \ No newline at end of file diff --git a/test/conformance/device/device_adapter_native_cpu_loader.match b/test/conformance/device/device_adapter_native_cpu_loader.match new file mode 120000 index 0000000000..e40575190c --- /dev/null +++ b/test/conformance/device/device_adapter_native_cpu_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/device/device_adapter_native_cpu.match \ No newline at end of file diff --git a/test/conformance/device/device_adapter_opencl_loader.match b/test/conformance/device/device_adapter_opencl_loader.match new file mode 120000 index 0000000000..647d45c6a1 --- /dev/null +++ b/test/conformance/device/device_adapter_opencl_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/device/device_adapter_opencl.match \ No newline at end of file diff --git a/test/conformance/device_code/single.cpp b/test/conformance/device_code/single.cpp new file mode 100644 index 0000000000..5b9e617e1e --- /dev/null +++ b/test/conformance/device_code/single.cpp @@ -0,0 +1,20 @@ +// Copyright (C) 2023 Intel Corporation +// Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include + +class Single; + +int main() { + sycl::queue deviceQueue; + sycl::range<1> numOfItems{1}; + + deviceQueue.submit([&](sycl::handler &cgh) { + auto kern = [=]() {}; + cgh.single_task(kern); + }); + + return 0; +} diff --git a/test/conformance/enqueue/enqueue_adapter_cuda_loader.match b/test/conformance/enqueue/enqueue_adapter_cuda_loader.match new file mode 120000 index 0000000000..cb1657d41a --- /dev/null +++ b/test/conformance/enqueue/enqueue_adapter_cuda_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/enqueue/enqueue_adapter_cuda.match \ No newline at end of file diff --git a/test/conformance/enqueue/enqueue_adapter_hip_loader.match b/test/conformance/enqueue/enqueue_adapter_hip_loader.match new file mode 120000 index 0000000000..3a78dd23ce --- /dev/null +++ b/test/conformance/enqueue/enqueue_adapter_hip_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/enqueue/enqueue_adapter_hip.match \ No newline at end of file diff --git a/test/conformance/enqueue/enqueue_adapter_level_zero_loader.match b/test/conformance/enqueue/enqueue_adapter_level_zero_loader.match new file mode 120000 index 0000000000..baad4dd3ed --- /dev/null +++ b/test/conformance/enqueue/enqueue_adapter_level_zero_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/enqueue/enqueue_adapter_level_zero.match \ No newline at end of file diff --git a/test/conformance/enqueue/enqueue_adapter_level_zero_v2_loader.match b/test/conformance/enqueue/enqueue_adapter_level_zero_v2_loader.match new file mode 120000 index 0000000000..baf26ae9c9 --- /dev/null +++ b/test/conformance/enqueue/enqueue_adapter_level_zero_v2_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/enqueue/enqueue_adapter_level_zero_v2.match \ No newline at end of file diff --git a/test/conformance/enqueue/enqueue_adapter_native_cpu_loader.match b/test/conformance/enqueue/enqueue_adapter_native_cpu_loader.match new file mode 120000 index 0000000000..2629e69b3a --- /dev/null +++ b/test/conformance/enqueue/enqueue_adapter_native_cpu_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/enqueue/enqueue_adapter_native_cpu.match \ No newline at end of file diff --git a/test/conformance/enqueue/enqueue_adapter_opencl_loader.match b/test/conformance/enqueue/enqueue_adapter_opencl_loader.match new file mode 120000 index 0000000000..feb49e2b36 --- /dev/null +++ b/test/conformance/enqueue/enqueue_adapter_opencl_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/enqueue/enqueue_adapter_opencl.match \ No newline at end of file diff --git a/test/conformance/event/event_adapter_cuda_loader.match b/test/conformance/event/event_adapter_cuda_loader.match new file mode 120000 index 0000000000..f5cd9e5407 --- /dev/null +++ b/test/conformance/event/event_adapter_cuda_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/event/event_adapter_cuda.match \ No newline at end of file diff --git a/test/conformance/event/event_adapter_hip_loader.match b/test/conformance/event/event_adapter_hip_loader.match new file mode 120000 index 0000000000..1a9676725d --- /dev/null +++ b/test/conformance/event/event_adapter_hip_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/event/event_adapter_hip.match \ No newline at end of file diff --git a/test/conformance/event/event_adapter_level_zero_loader.match b/test/conformance/event/event_adapter_level_zero_loader.match new file mode 120000 index 0000000000..6db9e58231 --- /dev/null +++ b/test/conformance/event/event_adapter_level_zero_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/event/event_adapter_level_zero.match \ No newline at end of file diff --git a/test/conformance/event/event_adapter_level_zero_v2_loader.match b/test/conformance/event/event_adapter_level_zero_v2_loader.match new file mode 120000 index 0000000000..4e60d87a90 --- /dev/null +++ b/test/conformance/event/event_adapter_level_zero_v2_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/event/event_adapter_level_zero_v2.match \ No newline at end of file diff --git a/test/conformance/event/event_adapter_native_cpu_loader.match b/test/conformance/event/event_adapter_native_cpu_loader.match new file mode 120000 index 0000000000..bac12efac6 --- /dev/null +++ b/test/conformance/event/event_adapter_native_cpu_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/event/event_adapter_native_cpu.match \ No newline at end of file diff --git a/test/conformance/exp_command_buffer/exp_command_buffer_adapter_cuda_loader.match b/test/conformance/exp_command_buffer/exp_command_buffer_adapter_cuda_loader.match new file mode 120000 index 0000000000..0540fb598b --- /dev/null +++ b/test/conformance/exp_command_buffer/exp_command_buffer_adapter_cuda_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/exp_command_buffer/exp_command_buffer_adapter_cuda.match \ No newline at end of file diff --git a/test/conformance/exp_command_buffer/exp_command_buffer_adapter_hip_loader.match b/test/conformance/exp_command_buffer/exp_command_buffer_adapter_hip_loader.match new file mode 120000 index 0000000000..1a723b6905 --- /dev/null +++ b/test/conformance/exp_command_buffer/exp_command_buffer_adapter_hip_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/exp_command_buffer/exp_command_buffer_adapter_hip.match \ No newline at end of file diff --git a/test/conformance/exp_command_buffer/exp_command_buffer_adapter_level_zero_v2_loader.match b/test/conformance/exp_command_buffer/exp_command_buffer_adapter_level_zero_v2_loader.match new file mode 120000 index 0000000000..f88e397d02 --- /dev/null +++ b/test/conformance/exp_command_buffer/exp_command_buffer_adapter_level_zero_v2_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/exp_command_buffer/exp_command_buffer_adapter_level_zero_v2.match \ No newline at end of file diff --git a/test/conformance/exp_command_buffer/exp_command_buffer_adapter_native_cpu_loader.match b/test/conformance/exp_command_buffer/exp_command_buffer_adapter_native_cpu_loader.match new file mode 120000 index 0000000000..c2aa252b67 --- /dev/null +++ b/test/conformance/exp_command_buffer/exp_command_buffer_adapter_native_cpu_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/exp_command_buffer/exp_command_buffer_adapter_native_cpu.match \ No newline at end of file diff --git a/test/conformance/exp_enqueue_native/exp_enqueue_native_adapter_level_zero_v2_loader.match b/test/conformance/exp_enqueue_native/exp_enqueue_native_adapter_level_zero_v2_loader.match new file mode 120000 index 0000000000..7b663aa699 --- /dev/null +++ b/test/conformance/exp_enqueue_native/exp_enqueue_native_adapter_level_zero_v2_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/exp_enqueue_native/exp_enqueue_native_adapter_level_zero_v2.match \ No newline at end of file diff --git a/test/conformance/exp_launch_properties/exp_launch_properties_adapter_native_cpu_loader.match b/test/conformance/exp_launch_properties/exp_launch_properties_adapter_native_cpu_loader.match new file mode 120000 index 0000000000..b382d4fa48 --- /dev/null +++ b/test/conformance/exp_launch_properties/exp_launch_properties_adapter_native_cpu_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/exp_launch_properties/exp_launch_properties_adapter_native_cpu.match \ No newline at end of file diff --git a/test/conformance/integration/integration_adapter_level_zero_loader.match b/test/conformance/integration/integration_adapter_level_zero_loader.match new file mode 120000 index 0000000000..7cc969ea09 --- /dev/null +++ b/test/conformance/integration/integration_adapter_level_zero_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/integration/integration_adapter_level_zero.match \ No newline at end of file diff --git a/test/conformance/integration/integration_adapter_level_zero_v2_loader.match b/test/conformance/integration/integration_adapter_level_zero_v2_loader.match new file mode 120000 index 0000000000..3a66285047 --- /dev/null +++ b/test/conformance/integration/integration_adapter_level_zero_v2_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/integration/integration_adapter_level_zero_v2.match \ No newline at end of file diff --git a/test/conformance/integration/integration_adapter_native_cpu_loader.match b/test/conformance/integration/integration_adapter_native_cpu_loader.match new file mode 120000 index 0000000000..6555251476 --- /dev/null +++ b/test/conformance/integration/integration_adapter_native_cpu_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/integration/integration_adapter_native_cpu.match \ No newline at end of file diff --git a/test/conformance/integration/integration_adapter_opencl_loader.match b/test/conformance/integration/integration_adapter_opencl_loader.match new file mode 120000 index 0000000000..2015a5a4c7 --- /dev/null +++ b/test/conformance/integration/integration_adapter_opencl_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/integration/integration_adapter_opencl.match \ No newline at end of file diff --git a/test/conformance/kernel/kernel_adapter_cuda_loader.match b/test/conformance/kernel/kernel_adapter_cuda_loader.match new file mode 120000 index 0000000000..da21e3c14e --- /dev/null +++ b/test/conformance/kernel/kernel_adapter_cuda_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/kernel/kernel_adapter_cuda.match \ No newline at end of file diff --git a/test/conformance/kernel/kernel_adapter_hip_loader.match b/test/conformance/kernel/kernel_adapter_hip_loader.match new file mode 120000 index 0000000000..0b1c409a23 --- /dev/null +++ b/test/conformance/kernel/kernel_adapter_hip_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/kernel/kernel_adapter_hip.match \ No newline at end of file diff --git a/test/conformance/kernel/kernel_adapter_level_zero_loader.match b/test/conformance/kernel/kernel_adapter_level_zero_loader.match new file mode 120000 index 0000000000..55b90ced5d --- /dev/null +++ b/test/conformance/kernel/kernel_adapter_level_zero_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/kernel/kernel_adapter_level_zero.match \ No newline at end of file diff --git a/test/conformance/kernel/kernel_adapter_level_zero_v2_loader.match b/test/conformance/kernel/kernel_adapter_level_zero_v2_loader.match new file mode 120000 index 0000000000..e59fb35a13 --- /dev/null +++ b/test/conformance/kernel/kernel_adapter_level_zero_v2_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/kernel/kernel_adapter_level_zero_v2.match \ No newline at end of file diff --git a/test/conformance/kernel/kernel_adapter_native_cpu_loader.match b/test/conformance/kernel/kernel_adapter_native_cpu_loader.match new file mode 120000 index 0000000000..dc27f07a9b --- /dev/null +++ b/test/conformance/kernel/kernel_adapter_native_cpu_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/kernel/kernel_adapter_native_cpu.match \ No newline at end of file diff --git a/test/conformance/kernel/kernel_adapter_opencl_loader.match b/test/conformance/kernel/kernel_adapter_opencl_loader.match new file mode 120000 index 0000000000..9cde5525dd --- /dev/null +++ b/test/conformance/kernel/kernel_adapter_opencl_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/kernel/kernel_adapter_opencl.match \ No newline at end of file diff --git a/test/conformance/memory/memory_adapter_cuda_loader.match b/test/conformance/memory/memory_adapter_cuda_loader.match new file mode 120000 index 0000000000..f8f8155083 --- /dev/null +++ b/test/conformance/memory/memory_adapter_cuda_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/memory/memory_adapter_cuda.match \ No newline at end of file diff --git a/test/conformance/memory/memory_adapter_hip_loader.match b/test/conformance/memory/memory_adapter_hip_loader.match new file mode 120000 index 0000000000..39d25de543 --- /dev/null +++ b/test/conformance/memory/memory_adapter_hip_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/memory/memory_adapter_hip.match \ No newline at end of file diff --git a/test/conformance/memory/memory_adapter_level_zero_loader.match b/test/conformance/memory/memory_adapter_level_zero_loader.match new file mode 120000 index 0000000000..64dc4739c5 --- /dev/null +++ b/test/conformance/memory/memory_adapter_level_zero_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/memory/memory_adapter_level_zero.match \ No newline at end of file diff --git a/test/conformance/memory/memory_adapter_level_zero_v2_loader.match b/test/conformance/memory/memory_adapter_level_zero_v2_loader.match new file mode 120000 index 0000000000..af9d99ed5d --- /dev/null +++ b/test/conformance/memory/memory_adapter_level_zero_v2_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/memory/memory_adapter_level_zero_v2.match \ No newline at end of file diff --git a/test/conformance/memory/memory_adapter_native_cpu_loader.match b/test/conformance/memory/memory_adapter_native_cpu_loader.match new file mode 120000 index 0000000000..53097550f9 --- /dev/null +++ b/test/conformance/memory/memory_adapter_native_cpu_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/memory/memory_adapter_native_cpu.match \ No newline at end of file diff --git a/test/conformance/memory/memory_adapter_opencl_loader.match b/test/conformance/memory/memory_adapter_opencl_loader.match new file mode 120000 index 0000000000..39d91886a8 --- /dev/null +++ b/test/conformance/memory/memory_adapter_opencl_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/memory/memory_adapter_opencl.match \ No newline at end of file diff --git a/test/conformance/platform/platform_adapter_cuda_loader.match b/test/conformance/platform/platform_adapter_cuda_loader.match new file mode 120000 index 0000000000..127511dca6 --- /dev/null +++ b/test/conformance/platform/platform_adapter_cuda_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/platform/platform_adapter_cuda.match \ No newline at end of file diff --git a/test/conformance/platform/platform_adapter_hip_loader.match b/test/conformance/platform/platform_adapter_hip_loader.match new file mode 120000 index 0000000000..e1cf30214d --- /dev/null +++ b/test/conformance/platform/platform_adapter_hip_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/platform/platform_adapter_hip.match \ No newline at end of file diff --git a/test/conformance/platform/platform_adapter_native_cpu_loader.match b/test/conformance/platform/platform_adapter_native_cpu_loader.match new file mode 120000 index 0000000000..df4afb90da --- /dev/null +++ b/test/conformance/platform/platform_adapter_native_cpu_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/platform/platform_adapter_native_cpu.match \ No newline at end of file diff --git a/test/conformance/program/program_adapter_cuda_loader.match b/test/conformance/program/program_adapter_cuda_loader.match new file mode 120000 index 0000000000..2dd487b7db --- /dev/null +++ b/test/conformance/program/program_adapter_cuda_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/program/program_adapter_cuda.match \ No newline at end of file diff --git a/test/conformance/program/program_adapter_hip_loader.match b/test/conformance/program/program_adapter_hip_loader.match new file mode 120000 index 0000000000..6e84054aa9 --- /dev/null +++ b/test/conformance/program/program_adapter_hip_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/program/program_adapter_hip.match \ No newline at end of file diff --git a/test/conformance/program/program_adapter_level_zero_loader.match b/test/conformance/program/program_adapter_level_zero_loader.match new file mode 120000 index 0000000000..25e20a1e7c --- /dev/null +++ b/test/conformance/program/program_adapter_level_zero_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/program/program_adapter_level_zero.match \ No newline at end of file diff --git a/test/conformance/program/program_adapter_level_zero_v2_loader.match b/test/conformance/program/program_adapter_level_zero_v2_loader.match new file mode 120000 index 0000000000..9730cd0319 --- /dev/null +++ b/test/conformance/program/program_adapter_level_zero_v2_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/program/program_adapter_level_zero_v2.match \ No newline at end of file diff --git a/test/conformance/program/program_adapter_native_cpu_loader.match b/test/conformance/program/program_adapter_native_cpu_loader.match new file mode 120000 index 0000000000..9d80c55d45 --- /dev/null +++ b/test/conformance/program/program_adapter_native_cpu_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/program/program_adapter_native_cpu.match \ No newline at end of file diff --git a/test/conformance/program/program_adapter_opencl_loader.match b/test/conformance/program/program_adapter_opencl_loader.match new file mode 120000 index 0000000000..8e40493ecd --- /dev/null +++ b/test/conformance/program/program_adapter_opencl_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/program/program_adapter_opencl.match \ No newline at end of file diff --git a/test/conformance/queue/queue_adapter_level_zero_loader.match b/test/conformance/queue/queue_adapter_level_zero_loader.match new file mode 120000 index 0000000000..0e173c3795 --- /dev/null +++ b/test/conformance/queue/queue_adapter_level_zero_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/queue/queue_adapter_level_zero.match \ No newline at end of file diff --git a/test/conformance/queue/queue_adapter_native_cpu_loader.match b/test/conformance/queue/queue_adapter_native_cpu_loader.match new file mode 120000 index 0000000000..e8e0229c84 --- /dev/null +++ b/test/conformance/queue/queue_adapter_native_cpu_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/queue/queue_adapter_native_cpu.match \ No newline at end of file diff --git a/test/conformance/sampler/sampler_adapter_level_zero_loader.match b/test/conformance/sampler/sampler_adapter_level_zero_loader.match new file mode 120000 index 0000000000..5cfb22ada0 --- /dev/null +++ b/test/conformance/sampler/sampler_adapter_level_zero_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/sampler/sampler_adapter_level_zero.match \ No newline at end of file diff --git a/test/conformance/sampler/sampler_adapter_level_zero_v2_loader.match b/test/conformance/sampler/sampler_adapter_level_zero_v2_loader.match new file mode 120000 index 0000000000..8a6a685f3b --- /dev/null +++ b/test/conformance/sampler/sampler_adapter_level_zero_v2_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/sampler/sampler_adapter_level_zero_v2.match \ No newline at end of file diff --git a/test/conformance/source/environment.cpp b/test/conformance/source/environment.cpp index 05dbe8c847..30561a2dff 100644 --- a/test/conformance/source/environment.cpp +++ b/test/conformance/source/environment.cpp @@ -6,7 +6,9 @@ #include #include #include +#include +#include "ur_api.h" #include "ur_filesystem_resolved.hpp" #ifdef KERNELS_ENVIRONMENT @@ -23,6 +25,39 @@ constexpr char ERROR_NO_ADAPTER[] = "Could not load adapter"; PlatformEnvironment *PlatformEnvironment::instance = nullptr; +constexpr std::pair backends[] = { + {"LEVEL_ZERO", UR_PLATFORM_BACKEND_LEVEL_ZERO}, + {"L0", UR_PLATFORM_BACKEND_LEVEL_ZERO}, + {"OPENCL", UR_PLATFORM_BACKEND_OPENCL}, + {"CUDA", UR_PLATFORM_BACKEND_CUDA}, + {"HIP", UR_PLATFORM_BACKEND_HIP}, + {"NATIVE_CPU", UR_PLATFORM_BACKEND_NATIVE_CPU}, + {"UNKNOWN", UR_PLATFORM_BACKEND_UNKNOWN}, + {"MOCK", UR_PLATFORM_BACKEND_UNKNOWN}, +}; + +namespace { +constexpr const char *backend_to_str(ur_platform_backend_t backend) { + for (auto b : backends) { + if (b.second == backend) { + return b.first; + } + } + return "INVALID"; +}; + +ur_platform_backend_t str_to_backend(std::string str) { + + std::transform(str.begin(), str.end(), str.begin(), ::toupper); + for (auto b : backends) { + if (b.first == str) { + return b.second; + } + } + return UR_PLATFORM_BACKEND_UNKNOWN; +}; +} // namespace + std::ostream &operator<<(std::ostream &out, const ur_platform_handle_t &platform) { size_t size; @@ -62,6 +97,10 @@ std::ostream &operator<<(std::ostream &out, uur::PlatformEnvironment::PlatformEnvironment(int argc, char **argv) : platform_options{parsePlatformOptions(argc, argv)} { instance = this; + // Check for errors from parsing platform options + if (!error.empty()) { + return; + } ur_loader_config_handle_t config; if (urLoaderConfigCreate(&config) == UR_RESULT_SUCCESS) { @@ -100,8 +139,13 @@ uur::PlatformEnvironment::PlatformEnvironment(int argc, char **argv) adapters.resize(adapter_count); urAdapterGet(adapter_count, adapters.data(), nullptr); - // Search through the adapters individually so we can store the one we end - // up choosing. + struct platform_info { + ur_adapter_handle_t adapter; + ur_platform_handle_t platform; + std::string name; + ur_platform_backend_t backend; + }; + std::vector platforms; for (auto a : adapters) { uint32_t count = 0; if (urPlatformGet(&a, 1, 0, nullptr, &count)) { @@ -109,66 +153,113 @@ uur::PlatformEnvironment::PlatformEnvironment(int argc, char **argv) return; } - if (count == 0) { - error = "Failed to find any platforms."; - return; - } - - std::vector platforms(count); - if (urPlatformGet(&a, 1, count, platforms.data(), nullptr)) { + std::vector platform_list(count); + if (urPlatformGet(&a, 1, count, platform_list.data(), nullptr)) { error = "urPlatformGet failed to get platforms."; return; } - if (platform_options.platform_name.empty()) { - - if (platforms.size() == 1 || - platform_options.platforms_count == 1) { - platform = platforms[0]; - adapter = a; - } else { - std::stringstream ss_error; - ss_error << "Select a single platform from below using the " - "--platform=NAME " - "command-line option:" - << platforms << std::endl - << "or set --platforms_count=1."; - error = ss_error.str(); + for (auto p : platform_list) { + ur_platform_backend_t backend; + if (urPlatformGetInfo(p, UR_PLATFORM_INFO_BACKEND, + sizeof(ur_platform_backend_t), &backend, + nullptr)) { + error = "urPlatformGetInfo failed to get backend."; return; } - } else { - for (auto candidate : platforms) { - size_t size; - if (urPlatformGetInfo(candidate, UR_PLATFORM_INFO_NAME, 0, - nullptr, &size)) { - error = "urPlatformGetInfoFailed"; - return; - } - std::vector platform_name(size); - if (urPlatformGetInfo(candidate, UR_PLATFORM_INFO_NAME, size, - platform_name.data(), nullptr)) { - error = "urPlatformGetInfo() failed"; - return; - } - if (platform_options.platform_name == platform_name.data()) { - platform = candidate; - adapter = a; - break; - } + + size_t size; + if (urPlatformGetInfo(p, UR_PLATFORM_INFO_NAME, 0, nullptr, + &size)) { + error = "urPlatformGetInfo failed to get name length."; + return; } - if (!platform) { - std::stringstream ss_error; - ss_error << "Platform \"" << platform_options.platform_name - << "\" not found. Select a single platform from below " - "using the " - "--platform=NAME command-line options:" - << platforms << std::endl - << "or set --platforms_count=1."; - error = ss_error.str(); + std::vector platform_name{}; + platform_name.reserve(size); + if (urPlatformGetInfo(p, UR_PLATFORM_INFO_NAME, size, + platform_name.data(), nullptr)) { + error = "urPlatformGetInfo failed to get name."; return; } + + platforms.push_back(platform_info{ + a, p, std::string(platform_name.data()), backend}); } } + + std::string default_name{}; + std::map backend_platform_names{}; + auto stream = std::stringstream{platform_options.platform_name}; + for (std::string filter; std::getline(stream, filter, ';');) { + auto split = filter.find(':'); + if (split == std::string::npos) { + default_name = filter; + } else if (split == filter.length() - 1) { + // E.g: `OPENCL:`, ignore it + } else { + backend_platform_names.insert( + {str_to_backend(filter.substr(0, split)), + filter.substr(split + 1)}); + } + } + + std::vector platforms_filtered{}; + std::copy_if(platforms.begin(), platforms.end(), + std::inserter(platforms_filtered, platforms_filtered.begin()), + [&](platform_info info) { + if (!default_name.empty() && default_name != info.name) { + return false; + } + if (backend_platform_names.count(info.backend) && + backend_platform_names[info.backend] != info.name) { + return false; + } + if (platform_options.platform_backend && + platform_options.platform_backend != info.backend) { + return false; + } + return true; + }); + + if (platforms_filtered.size() == 0) { + std::stringstream errstr; + errstr << "No platforms were found with the following filters:"; + if (platform_options.platform_backend) { + errstr << " --backend=" + << backend_to_str(*platform_options.platform_backend); + } + if (!platform_options.platform_name.empty()) { + errstr << " --platform=\"" << platform_options.platform_name + << "\""; + } + if (!platform_options.platform_backend && + platform_options.platform_name.empty()) { + errstr << " (none)"; + } + errstr << "\nAvailable platforms:\n"; + for (auto p : platforms) { + errstr << " --backend=" << backend_to_str(p.backend) + << " --platform=\"" << p.name << "\"\n"; + } + error = errstr.str(); + } else if (platforms_filtered.size() == 1 || + platform_options.platforms_count == 1) { + auto &selected = platforms_filtered[0]; + platform = selected.platform; + adapter = selected.adapter; + std::cerr << "Selected platform: [" << backend_to_str(selected.backend) + << "] " << selected.name << "\n"; + } else if (platforms_filtered.size() > 1) { + std::stringstream errstr; + errstr << "Multiple possible platforms found; please select one of the " + "ones below or set --platforms_count=1:\n"; + for (auto p : platforms_filtered) { + errstr << " --backend=" << backend_to_str(p.backend) + << " --platform=\"" << p.name << "\"\n"; + } + error = errstr.str(); + } + return; } void uur::PlatformEnvironment::SetUp() { @@ -196,6 +287,26 @@ void uur::PlatformEnvironment::TearDown() { PlatformEnvironment::PlatformOptions PlatformEnvironment::parsePlatformOptions(int argc, char **argv) { PlatformOptions options{}; + auto parse_backend = [&](std::string backend_string) { + options.platform_backend = str_to_backend(backend_string); + if (options.platform_backend == UR_PLATFORM_BACKEND_UNKNOWN) { + std::stringstream errstr{error}; + errstr << "--backend not valid; expected one of ["; + bool first = true; + for (auto b : backends) { + if (!first) { + errstr << ", "; + } + errstr << b.first; + first = false; + } + errstr << "], but got `" << backend_string << "`"; + error = errstr.str(); + return false; + } + return true; + }; + for (int argi = 1; argi < argc; ++argi) { const char *arg = argv[argi]; if (!(std::strcmp(arg, "-h") && std::strcmp(arg, "--help"))) { @@ -205,6 +316,12 @@ PlatformEnvironment::parsePlatformOptions(int argc, char **argv) { arg, "--platform=", sizeof("--platform=") - 1) == 0) { options.platform_name = std::string(&arg[std::strlen("--platform=")]); + } else if (std::strncmp(arg, "--backend=", sizeof("--backend=") - 1) == + 0) { + std::string backend_string{&arg[std::strlen("--backend=")]}; + if (!parse_backend(backend_string)) { + return options; + } } else if (std::strncmp(arg, "--platforms_count=", sizeof("--platforms_count=") - 1) == 0) { options.platforms_count = std::strtoul( @@ -212,7 +329,7 @@ PlatformEnvironment::parsePlatformOptions(int argc, char **argv) { } } - /* If a platform was not provided using the --platform command line option, + /* If a platform was not provided using the --platform/--backend command line options, * check if environment variable is set to use as a fallback. */ if (options.platform_name.empty()) { auto env_platform = ur_getenv("UR_CTS_ADAPTER_PLATFORM"); @@ -220,6 +337,14 @@ PlatformEnvironment::parsePlatformOptions(int argc, char **argv) { options.platform_name = env_platform.value(); } } + if (!options.platform_backend) { + auto env_backend = ur_getenv("UR_CTS_BACKEND"); + if (env_backend.has_value()) { + if (!parse_backend(env_backend.value())) { + return options; + } + } + } return options; } diff --git a/test/conformance/testing/include/uur/environment.h b/test/conformance/testing/include/uur/environment.h index ec4a39fe7f..c85dcf4037 100644 --- a/test/conformance/testing/include/uur/environment.h +++ b/test/conformance/testing/include/uur/environment.h @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -17,6 +18,7 @@ struct PlatformEnvironment : ::testing::Environment { struct PlatformOptions { std::string platform_name; + std::optional platform_backend; unsigned long platforms_count = 0; }; @@ -28,11 +30,11 @@ struct PlatformEnvironment : ::testing::Environment { PlatformOptions parsePlatformOptions(int argc, char **argv); + std::string error{}; PlatformOptions platform_options; std::vector adapters{}; ur_adapter_handle_t adapter = nullptr; ur_platform_handle_t platform = nullptr; - std::string error; static PlatformEnvironment *instance; }; diff --git a/test/conformance/usm/usm_adapter_cuda_loader.match b/test/conformance/usm/usm_adapter_cuda_loader.match new file mode 120000 index 0000000000..22723bf600 --- /dev/null +++ b/test/conformance/usm/usm_adapter_cuda_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/usm/usm_adapter_cuda.match \ No newline at end of file diff --git a/test/conformance/usm/usm_adapter_hip_loader.match b/test/conformance/usm/usm_adapter_hip_loader.match new file mode 120000 index 0000000000..afb6169ff4 --- /dev/null +++ b/test/conformance/usm/usm_adapter_hip_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/usm/usm_adapter_hip.match \ No newline at end of file diff --git a/test/conformance/usm/usm_adapter_level_zero_loader.match b/test/conformance/usm/usm_adapter_level_zero_loader.match new file mode 120000 index 0000000000..22898fd70d --- /dev/null +++ b/test/conformance/usm/usm_adapter_level_zero_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/usm/usm_adapter_level_zero.match \ No newline at end of file diff --git a/test/conformance/usm/usm_adapter_level_zero_v2_loader.match b/test/conformance/usm/usm_adapter_level_zero_v2_loader.match new file mode 120000 index 0000000000..53ebcb357c --- /dev/null +++ b/test/conformance/usm/usm_adapter_level_zero_v2_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/usm/usm_adapter_level_zero_v2.match \ No newline at end of file diff --git a/test/conformance/usm/usm_adapter_native_cpu_loader.match b/test/conformance/usm/usm_adapter_native_cpu_loader.match new file mode 120000 index 0000000000..20249d128d --- /dev/null +++ b/test/conformance/usm/usm_adapter_native_cpu_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/usm/usm_adapter_native_cpu.match \ No newline at end of file diff --git a/test/conformance/usm/usm_adapter_opencl_loader.match b/test/conformance/usm/usm_adapter_opencl_loader.match new file mode 120000 index 0000000000..52345e08be --- /dev/null +++ b/test/conformance/usm/usm_adapter_opencl_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/usm/usm_adapter_opencl.match \ No newline at end of file diff --git a/test/conformance/virtual_memory/virtual_memory_adapter_level_zero_loader.match b/test/conformance/virtual_memory/virtual_memory_adapter_level_zero_loader.match new file mode 120000 index 0000000000..dd3b098729 --- /dev/null +++ b/test/conformance/virtual_memory/virtual_memory_adapter_level_zero_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/virtual_memory/virtual_memory_adapter_level_zero.match \ No newline at end of file diff --git a/test/conformance/virtual_memory/virtual_memory_adapter_level_zero_v2_loader.match b/test/conformance/virtual_memory/virtual_memory_adapter_level_zero_v2_loader.match new file mode 120000 index 0000000000..91146c6752 --- /dev/null +++ b/test/conformance/virtual_memory/virtual_memory_adapter_level_zero_v2_loader.match @@ -0,0 +1 @@ +/home/ross/dpcpp/unified-runtime/test/conformance/virtual_memory/virtual_memory_adapter_level_zero_v2.match \ No newline at end of file