From 9f4b0a60a6ad8977b603a822014fa852870b0fab Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Wed, 8 Nov 2023 14:38:29 +0000 Subject: [PATCH 1/4] [OpenCL] Fetch headers/icd-loader by default Introduces the follow CMake options: * `UR_OPENCL_INCLUDE_DIR` - directory containing the OpenCL Headers * `UR_OPENCL_ICD_LOADER_LIBRARY` - path of the OpenCL ICD Loader library In the event that `UR_OPENCL_INCLUDE_DIR` is not specified, clone [KhronosGroup/OpenCL-Headers](https://github.com/KhronosGroup/OpenCL-Headers.git). In the event that `UR_OPENCL_ICD_LOADER_LIBRARY` is not specified, first inspect the system with `find_package(OpenCL 3.0)` and use that if found. Otherwise, clone [KhronosGroup/OpenCL-ICD-Loader](https://github.com/KhronosGroup/OpenCL-ICD-Loader.git). --- source/adapters/opencl/CMakeLists.txt | 123 ++++++++++++++++---------- 1 file changed, 77 insertions(+), 46 deletions(-) diff --git a/source/adapters/opencl/CMakeLists.txt b/source/adapters/opencl/CMakeLists.txt index dc43a68ffa..5feb673175 100644 --- a/source/adapters/opencl/CMakeLists.txt +++ b/source/adapters/opencl/CMakeLists.txt @@ -5,65 +5,96 @@ set(OPENCL_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE PATH "OpenCL adapter directory") +set(UR_OPENCL_INCLUDE_DIR "" CACHE PATH "Directory containing the OpenCL Headers") +set(UR_OPENCL_ICD_LOADER_LIBRARY "" CACHE FILEPATH "Path of the OpenCL ICD Loader library") + +find_package(Threads REQUIRED) + set(TARGET_NAME ur_adapter_opencl) -add_ur_adapter(${TARGET_NAME} - SHARED - ${CMAKE_CURRENT_SOURCE_DIR}/ur_interface_loader.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/adapter.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/adapter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/command_buffer.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/command_buffer.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/common.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/common.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/context.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/context.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/device.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/device.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/enqueue.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/event.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/image.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/memory.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/platform.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/platform.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/program.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/queue.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/sampler.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/usm.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/usm_p2p.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/../../ur/ur.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/../../ur/ur.hpp +add_ur_adapter(${TARGET_NAME} SHARED + ${CMAKE_CURRENT_SOURCE_DIR}/ur_interface_loader.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/adapter.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/adapter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/command_buffer.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/command_buffer.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/common.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/context.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/context.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/device.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/device.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/enqueue.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/event.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/image.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/memory.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/platform.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/platform.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/program.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/queue.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/sampler.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/usm.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/usm_p2p.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../../ur/ur.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../../ur/ur.hpp ) set_target_properties(${TARGET_NAME} PROPERTIES - VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}" - SOVERSION "${PROJECT_VERSION_MAJOR}" + VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}" + SOVERSION "${PROJECT_VERSION_MAJOR}" ) -find_package(Threads REQUIRED) +if(UR_OPENCL_INCLUDE_DIR) + set(OpenCLIncludeDirectory ${UR_OPENCL_INCLUDE_DIR}) +else() + FetchContent_Declare(OpenCL-Headers + GIT_REPOSITORY "https://github.com/KhronosGroup/OpenCL-Headers.git" + GIT_TAG main + ) + FetchContent_MakeAvailable(OpenCL-Headers) + FetchContent_GetProperties(OpenCL-Headers + SOURCE_DIR OpenCLIncludeDirectory + ) +endif() -# The OpenCL target can be set manually on upstream cmake to avoid using find_package(). -if (NOT UR_OPENCL_ICD_LOADER_LIBRARY) - find_package(OpenCL REQUIRED) - message(STATUS "OpenCL_LIBRARY: ${OpenCL_LIBRARY}") - message(STATUS "OpenCL_INCLUDE_DIR: ${OpenCL_INCLUDE_DIR}") - set(UR_OPENCL_ICD_LOADER_LIBRARY OpenCL::OpenCL) +# The OpenCL target can be set manually on upstream cmake to avoid using +# find_package(). +if(UR_OPENCL_ICD_LOADER_LIBRARY) + set(OpenCLICDLoaderLibrary ${UR_OPENCL_ICD_LOADER_LIBRARY}) +else() + find_package(OpenCL 3.0) + if(OpenCL_FOUND) + set(OpenCLICDLoaderLibrary OpenCL::OpenCL) + else() + FetchContent_Declare(OpenCL-ICD-Loader + GIT_REPOSITORY "https://github.com/KhronosGroup/OpenCL-ICD-Loader.git" + GIT_TAG main + ) + FetchContent_MakeAvailable(OpenCL-ICD-Loader) + set(OpenCLICDLoaderLibrary ${PROJECT_BINARY_DIR}/lib/libOpenCL.so) + endif() endif() +message(STATUS "OpenCL Include Directory: ${OpenCLIncludeDirectory}") +message(STATUS "OpenCL ICD Loader Library: ${OpenCLICDLoaderLibrary}") + # Suppress a compiler message about undefined CL_TARGET_OPENCL_VERSION. # Define all symbols up to OpenCL 3.0. -target_compile_definitions(ur_adapter_opencl PRIVATE CL_TARGET_OPENCL_VERSION=300 CL_USE_DEPRECATED_OPENCL_1_2_APIS) - -target_link_libraries(${TARGET_NAME} PRIVATE - ${PROJECT_NAME}::headers - ${PROJECT_NAME}::common - ${PROJECT_NAME}::unified_malloc_framework - Threads::Threads - ${UR_OPENCL_ICD_LOADER_LIBRARY} +target_compile_definitions(ur_adapter_opencl PRIVATE + CL_TARGET_OPENCL_VERSION=300 + CL_USE_DEPRECATED_OPENCL_1_2_APIS ) target_include_directories(${TARGET_NAME} PRIVATE - "${CMAKE_CURRENT_SOURCE_DIR}/../../" - ${OpenCL_INCLUDE_DIR} + ${OpenCLIncludeDirectory} + "${CMAKE_CURRENT_SOURCE_DIR}/../../" +) + +target_link_libraries(${TARGET_NAME} PRIVATE + ${PROJECT_NAME}::headers + ${PROJECT_NAME}::common + ${PROJECT_NAME}::unified_malloc_framework + Threads::Threads + ${OpenCLICDLoaderLibrary} ) From 8a0567490681893306a641889147bfc8ecb57fa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Mestre?= Date: Thu, 16 Nov 2023 14:56:00 +0000 Subject: [PATCH 2/4] [CI] Add support for OpenCL CI on CPU --- .github/workflows/cmake.yml | 9 ++-- .../context/context_adapter_opencl.match | 1 + .../device/device_adapter_opencl.match | 3 ++ .../enqueue/enqueue_adapter_opencl.match | 5 +++ .../event/event_adapter_opencl.match | 2 + .../kernel/kernel_adapter_opencl.match | 1 + .../memory/memory_adapter_opencl.match | 5 +++ .../platform/platform_adapter_opencl.match | 1 + .../program/program_adapter_opencl.match | 30 +++++++++++++ .../queue/queue_adapter_opencl.match | 4 ++ .../runtime/runtime_adapter_opencl.match | 0 .../sampler/sampler_adapter_opencl.match | 0 test/conformance/source/environment.cpp | 10 +++++ test/conformance/usm/usm_adapter_opencl.match | 42 +++++++++++++++++++ .../virtual_memory_adapter_opencl.match | 15 +++++++ 15 files changed, 124 insertions(+), 4 deletions(-) create mode 100644 test/conformance/context/context_adapter_opencl.match create mode 100644 test/conformance/device/device_adapter_opencl.match create mode 100644 test/conformance/enqueue/enqueue_adapter_opencl.match create mode 100644 test/conformance/event/event_adapter_opencl.match create mode 100644 test/conformance/kernel/kernel_adapter_opencl.match create mode 100644 test/conformance/memory/memory_adapter_opencl.match create mode 100644 test/conformance/platform/platform_adapter_opencl.match create mode 100644 test/conformance/program/program_adapter_opencl.match create mode 100644 test/conformance/queue/queue_adapter_opencl.match create mode 100644 test/conformance/runtime/runtime_adapter_opencl.match create mode 100644 test/conformance/sampler/sampler_adapter_opencl.match create mode 100644 test/conformance/usm/usm_adapter_opencl.match create mode 100644 test/conformance/virtual_memory/virtual_memory_adapter_opencl.match diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 780f142f33..665f30b9a9 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -163,9 +163,10 @@ jobs: strategy: matrix: adapter: [ - {name: CUDA, triplet: nvptx64-nvidia-cuda}, - {name: HIP, triplet: amdgcn-amd-amdhsa}, - {name: L0, triplet: spir64} + {name: CUDA, triplet: nvptx64-nvidia-cuda, platform: ""}, + {name: HIP, triplet: amdgcn-amd-amdhsa, platform: ""}, + {name: L0, triplet: spir64, platform: ""}, + {name: OPENCL, triplet: spir64, platform: "Intel(R) OpenCL"} ] build_type: [Debug, Release] compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}] @@ -219,7 +220,7 @@ jobs: - name: Test adapters if: matrix.adapter.name != 'L0' working-directory: ${{github.workspace}}/build - run: ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" --timeout 180 + run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" --timeout 180 examples-build-hw: name: Build - examples on HW diff --git a/test/conformance/context/context_adapter_opencl.match b/test/conformance/context/context_adapter_opencl.match new file mode 100644 index 0000000000..0f0e82d7d9 --- /dev/null +++ b/test/conformance/context/context_adapter_opencl.match @@ -0,0 +1 @@ +urContextCreateWithNativeHandleTest.Success/Intel_R__OpenCL___{{.*}}_ diff --git a/test/conformance/device/device_adapter_opencl.match b/test/conformance/device/device_adapter_opencl.match new file mode 100644 index 0000000000..b46c34d6ca --- /dev/null +++ b/test/conformance/device/device_adapter_opencl.match @@ -0,0 +1,3 @@ +urDeviceGetTest.InvalidValueNumEntries +urDeviceGetInfoTest.Success/UR_DEVICE_INFO_HALF_FP_CONFIG +urDeviceGetInfoTest.Success/UR_DEVICE_INFO_PARTITION_TYPE diff --git a/test/conformance/enqueue/enqueue_adapter_opencl.match b/test/conformance/enqueue/enqueue_adapter_opencl.match new file mode 100644 index 0000000000..58bfd87643 --- /dev/null +++ b/test/conformance/enqueue/enqueue_adapter_opencl.match @@ -0,0 +1,5 @@ +{{OPT}}urEnqueueDeviceGetGlobalVariableReadTest.Success/Intel_R__OpenCL___{{.*}}_ +{{OPT}}urEnqueueMemBufferCopyRectTest.InvalidSize/Intel_R__OpenCL___{{.*}}_ +{{OPT}}urEnqueueMemBufferReadRectTest.InvalidSize/Intel_R__OpenCL___{{.*}}_ +{{OPT}}urEnqueueMemBufferWriteRectTest.InvalidSize/Intel_R__OpenCL___{{.*}}_ +{{OPT}}Segmentation fault diff --git a/test/conformance/event/event_adapter_opencl.match b/test/conformance/event/event_adapter_opencl.match new file mode 100644 index 0000000000..43bd5fe2ed --- /dev/null +++ b/test/conformance/event/event_adapter_opencl.match @@ -0,0 +1,2 @@ +urEventSetCallbackTest.AllStates/Intel_R__OpenCL___{{.*}}_ +urEventSetCallbackNegativeTest.InvalidNullHandle/Intel_R__OpenCL___{{.*}}_ diff --git a/test/conformance/kernel/kernel_adapter_opencl.match b/test/conformance/kernel/kernel_adapter_opencl.match new file mode 100644 index 0000000000..7a1c0d5b8e --- /dev/null +++ b/test/conformance/kernel/kernel_adapter_opencl.match @@ -0,0 +1 @@ +Segmentation fault diff --git a/test/conformance/memory/memory_adapter_opencl.match b/test/conformance/memory/memory_adapter_opencl.match new file mode 100644 index 0000000000..f6df605fa6 --- /dev/null +++ b/test/conformance/memory/memory_adapter_opencl.match @@ -0,0 +1,5 @@ +urMemGetInfoTest.InvalidNullPointerParamValue/Intel_R__OpenCL___{{.*}}___UR_MEM_INFO_SIZE +urMemGetInfoTest.InvalidNullPointerParamValue/Intel_R__OpenCL___{{.*}}___UR_MEM_INFO_CONTEXT +urMemGetInfoTest.InvalidNullPointerPropSizeRet/Intel_R__OpenCL___{{.*}}___UR_MEM_INFO_SIZE +urMemGetInfoTest.InvalidNullPointerPropSizeRet/Intel_R__OpenCL___{{.*}}___UR_MEM_INFO_CONTEXT +urMemImageCreateTest.InvalidImageDescStype/Intel_R__OpenCL___{{.*}}_ diff --git a/test/conformance/platform/platform_adapter_opencl.match b/test/conformance/platform/platform_adapter_opencl.match new file mode 100644 index 0000000000..df63fbef05 --- /dev/null +++ b/test/conformance/platform/platform_adapter_opencl.match @@ -0,0 +1 @@ +urPlatformGetTest.InvalidNumEntries diff --git a/test/conformance/program/program_adapter_opencl.match b/test/conformance/program/program_adapter_opencl.match new file mode 100644 index 0000000000..1354f1f211 --- /dev/null +++ b/test/conformance/program/program_adapter_opencl.match @@ -0,0 +1,30 @@ +urProgramCreateWithBinaryTest.Success/Intel_R__OpenCL___{{.*}}_ +urProgramCreateWithBinaryTest.InvalidNullHandleContext/Intel_R__OpenCL___{{.*}}_ +urProgramCreateWithBinaryTest.InvalidNullHandleDevice/Intel_R__OpenCL___{{.*}}_ +urProgramCreateWithBinaryTest.InvalidNullPointerBinary/Intel_R__OpenCL___{{.*}}_ +urProgramCreateWithBinaryTest.InvalidNullPointerProgram/Intel_R__OpenCL___{{.*}}_ +urProgramCreateWithBinaryTest.InvalidNullPointerMetadata/Intel_R__OpenCL___{{.*}}_ +urProgramCreateWithBinaryTest.InvalidSizePropertyCount/Intel_R__OpenCL___{{.*}}_ +urProgramCreateWithNativeHandleTest.InvalidNullHandleContext/Intel_R__OpenCL___{{.*}}_ +urProgramCreateWithNativeHandleTest.InvalidNullPointerProgram/Intel_R__OpenCL___{{.*}}_ +urProgramGetBuildInfoTest.InvalidNullHandleProgram/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_BUILD_INFO_STATUS +urProgramGetBuildInfoTest.InvalidNullHandleProgram/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_BUILD_INFO_OPTIONS +urProgramGetBuildInfoTest.InvalidNullHandleProgram/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_BUILD_INFO_LOG +urProgramGetBuildInfoTest.InvalidNullHandleProgram/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_BUILD_INFO_BINARY_TYPE +urProgramGetBuildInfoTest.InvalidNullHandleDevice/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_BUILD_INFO_STATUS +urProgramGetBuildInfoTest.InvalidNullHandleDevice/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_BUILD_INFO_OPTIONS +urProgramGetBuildInfoTest.InvalidNullHandleDevice/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_BUILD_INFO_LOG +urProgramGetBuildInfoTest.InvalidNullHandleDevice/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_BUILD_INFO_BINARY_TYPE +urProgramGetFunctionPointerTest.InvalidFunctionName/Intel_R__OpenCL___{{.*}}_ +urProgramGetInfoTest.Success/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_SOURCE +urProgramGetInfoTest.Success/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_NUM_KERNELS +urProgramGetInfoTest.Success/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_KERNEL_NAMES +urProgramGetInfoTest.InvalidNullHandleProgram/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_REFERENCE_COUNT +urProgramGetInfoTest.InvalidNullHandleProgram/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_CONTEXT +urProgramGetInfoTest.InvalidNullHandleProgram/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_NUM_DEVICES +urProgramGetInfoTest.InvalidNullHandleProgram/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_DEVICES +urProgramGetInfoTest.InvalidNullHandleProgram/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_SOURCE +urProgramGetInfoTest.InvalidNullHandleProgram/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_BINARY_SIZES +urProgramGetInfoTest.InvalidNullHandleProgram/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_BINARIES +urProgramGetInfoTest.InvalidNullHandleProgram/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_NUM_KERNELS +urProgramGetInfoTest.InvalidNullHandleProgram/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_KERNEL_NAMES diff --git a/test/conformance/queue/queue_adapter_opencl.match b/test/conformance/queue/queue_adapter_opencl.match new file mode 100644 index 0000000000..59c11b7c86 --- /dev/null +++ b/test/conformance/queue/queue_adapter_opencl.match @@ -0,0 +1,4 @@ +urQueueCreateTest.InvalidQueueProperties/Intel_R__OpenCL___{{.*}}_ +urQueueCreateWithNativeHandleTest.Success/Intel_R__OpenCL___{{.*}}_ +urQueueGetInfoTestWithInfoParam.Success/Intel_R__OpenCL___{{.*}}___UR_QUEUE_INFO_SIZE +urQueueGetInfoTestWithInfoParam.Success/Intel_R__OpenCL___{{.*}}___UR_QUEUE_INFO_EMPTY diff --git a/test/conformance/runtime/runtime_adapter_opencl.match b/test/conformance/runtime/runtime_adapter_opencl.match new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/conformance/sampler/sampler_adapter_opencl.match b/test/conformance/sampler/sampler_adapter_opencl.match new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/conformance/source/environment.cpp b/test/conformance/source/environment.cpp index 875ceb63ef..8e99983c9b 100644 --- a/test/conformance/source/environment.cpp +++ b/test/conformance/source/environment.cpp @@ -179,6 +179,16 @@ PlatformEnvironment::parsePlatformOptions(int argc, char **argv) { std::string(&arg[std::strlen("--platform=")]); } } + + /* If a platform was not provided using the --platform command line option, + * check if environment variable is set to use as a fallback. */ + if (options.platform_name.empty()) { + const char *env_platform = std::getenv("UR_CTS_ADAPTER_PLATFORM"); + if (env_platform) { + options.platform_name = env_platform; + } + } + return options; } diff --git a/test/conformance/usm/usm_adapter_opencl.match b/test/conformance/usm/usm_adapter_opencl.match new file mode 100644 index 0000000000..b9aa3f3bdf --- /dev/null +++ b/test/conformance/usm/usm_adapter_opencl.match @@ -0,0 +1,42 @@ +urUSMDeviceAllocTest.Success/Intel_R__OpenCL___{{.*}}___UsePoolEnabled +urUSMDeviceAllocTest.SuccessWithDescriptors/Intel_R__OpenCL___{{.*}}___UsePoolEnabled +urUSMDeviceAllocTest.SuccessWithDescriptors/Intel_R__OpenCL___{{.*}}___UsePoolDisabled +urUSMDeviceAllocTest.InvalidNullHandleContext/Intel_R__OpenCL___{{.*}}___UsePoolEnabled +urUSMDeviceAllocTest.InvalidNullHandleDevice/Intel_R__OpenCL___{{.*}}___UsePoolEnabled +urUSMDeviceAllocTest.InvalidNullPtrResult/Intel_R__OpenCL___{{.*}}___UsePoolEnabled +urUSMDeviceAllocTest.InvalidUSMSize/Intel_R__OpenCL___{{.*}}___UsePoolEnabled +urUSMDeviceAllocTest.InvalidValueAlignPowerOfTwo/Intel_R__OpenCL___{{.*}}___UsePoolEnabled +urUSMAllocInfoTest.Success/Intel_R__OpenCL___{{.*}}___UR_USM_ALLOC_INFO_POOL +urUSMHostAllocTest.Success/Intel_R__OpenCL___{{.*}}___UsePoolEnabled +urUSMHostAllocTest.SuccessWithDescriptors/Intel_R__OpenCL___{{.*}}___UsePoolEnabled +urUSMHostAllocTest.SuccessWithDescriptors/Intel_R__OpenCL___{{.*}}___UsePoolDisabled +urUSMHostAllocTest.InvalidNullHandleContext/Intel_R__OpenCL___{{.*}}___UsePoolEnabled +urUSMHostAllocTest.InvalidNullPtrMem/Intel_R__OpenCL___{{.*}}___UsePoolEnabled +urUSMHostAllocTest.InvalidUSMSize/Intel_R__OpenCL___{{.*}}___UsePoolEnabled +urUSMHostAllocTest.InvalidValueAlignPowerOfTwo/Intel_R__OpenCL___{{.*}}___UsePoolEnabled +urUSMPoolCreateTest.Success/Intel_R__OpenCL___{{.*}}_ +urUSMPoolCreateTest.SuccessWithFlag/Intel_R__OpenCL___{{.*}}_ +urUSMPoolCreateTest.InvalidNullHandleContext/Intel_R__OpenCL___{{.*}}_ +urUSMPoolCreateTest.InvalidNullPointerPoolDesc/Intel_R__OpenCL___{{.*}}_ +urUSMPoolCreateTest.InvalidNullPointerPool/Intel_R__OpenCL___{{.*}}_ +urUSMPoolCreateTest.InvalidEnumerationFlags/Intel_R__OpenCL___{{.*}}_ +urUSMPoolGetInfoTestWithInfoParam.Success/Intel_R__OpenCL___{{.*}}___UR_USM_POOL_INFO_CONTEXT +urUSMPoolGetInfoTestWithInfoParam.Success/Intel_R__OpenCL___{{.*}}___UR_USM_POOL_INFO_REFERENCE_COUNT +urUSMPoolGetInfoTest.InvalidNullHandlePool/Intel_R__OpenCL___{{.*}}_ +urUSMPoolGetInfoTest.InvalidEnumerationProperty/Intel_R__OpenCL___{{.*}}_ +urUSMPoolGetInfoTest.InvalidSizeZero/Intel_R__OpenCL___{{.*}}_ +urUSMPoolGetInfoTest.InvalidSizeTooSmall/Intel_R__OpenCL___{{.*}}_ +urUSMPoolGetInfoTest.InvalidNullPointerPropValue/Intel_R__OpenCL___{{.*}}_ +urUSMPoolGetInfoTest.InvalidNullPointerPropSizeRet/Intel_R__OpenCL___{{.*}}_ +urUSMPoolDestroyTest.Success/Intel_R__OpenCL___{{.*}}_ +urUSMPoolDestroyTest.InvalidNullHandleContext/Intel_R__OpenCL___{{.*}}_ +urUSMPoolRetainTest.Success/Intel_R__OpenCL___{{.*}}_ +urUSMPoolRetainTest.InvalidNullHandlePool/Intel_R__OpenCL___{{.*}}_ +urUSMSharedAllocTest.Success/Intel_R__OpenCL___{{.*}}___UsePoolEnabled +urUSMSharedAllocTest.SuccessWithDescriptors/Intel_R__OpenCL___{{.*}}___UsePoolEnabled +urUSMSharedAllocTest.SuccessWithMultipleAdvices/Intel_R__OpenCL___{{.*}}___UsePoolEnabled +urUSMSharedAllocTest.InvalidNullHandleContext/Intel_R__OpenCL___{{.*}}___UsePoolEnabled +urUSMSharedAllocTest.InvalidNullHandleDevice/Intel_R__OpenCL___{{.*}}___UsePoolEnabled +urUSMSharedAllocTest.InvalidNullPtrMem/Intel_R__OpenCL___{{.*}}___UsePoolEnabled +urUSMSharedAllocTest.InvalidUSMSize/Intel_R__OpenCL___{{.*}}___UsePoolEnabled +urUSMSharedAllocTest.InvalidValueAlignPowerOfTwo/Intel_R__OpenCL___{{.*}}___UsePoolEnabled diff --git a/test/conformance/virtual_memory/virtual_memory_adapter_opencl.match b/test/conformance/virtual_memory/virtual_memory_adapter_opencl.match new file mode 100644 index 0000000000..bf82e6fb92 --- /dev/null +++ b/test/conformance/virtual_memory/virtual_memory_adapter_opencl.match @@ -0,0 +1,15 @@ +urVirtualMemGetInfoTestWithParam.Success/Intel_R__OpenCL___{{.*}}___UR_VIRTUAL_MEM_INFO_ACCESS_MODE +urVirtualMemGetInfoTest.InvalidNullHandleContext/Intel_R__OpenCL___{{.*}}_ +urVirtualMemGetInfoTest.InvalidNullPointerStart/Intel_R__OpenCL___{{.*}}_ +urVirtualMemGetInfoTest.InvalidEnumerationInfo/Intel_R__OpenCL___{{.*}}_ +urVirtualMemGranularityGetInfoTest.Success/Intel_R__OpenCL___{{.*}}___UR_VIRTUAL_MEM_GRANULARITY_INFO_MINIMUM +urVirtualMemGranularityGetInfoTest.Success/Intel_R__OpenCL___{{.*}}___UR_VIRTUAL_MEM_GRANULARITY_INFO_RECOMMENDED +urVirtualMemGranularityGetInfoNegativeTest.InvalidNullHandleContext/Intel_R__OpenCL___{{.*}}_ +urVirtualMemGranularityGetInfoNegativeTest.InvalidEnumeration/Intel_R__OpenCL___{{.*}}_ +urVirtualMemGranularityGetInfoNegativeTest.InvalidNullPointerPropSizeRet/Intel_R__OpenCL___{{.*}}_ +urVirtualMemGranularityGetInfoNegativeTest.InvalidNullPointerPropValue/Intel_R__OpenCL___{{.*}}_ +urVirtualMemGranularityGetInfoNegativeTest.InvalidPropSizeZero/Intel_R__OpenCL___{{.*}}_ +urVirtualMemGranularityGetInfoNegativeTest.InvalidSizePropSizeSmall/Intel_R__OpenCL___{{.*}}_ +urVirtualMemSetAccessTest.Success/Intel_R__OpenCL___{{.*}}_ +urVirtualMemSetAccessTest.InvalidNullHandleContext/Intel_R__OpenCL___{{.*}}_ +urVirtualMemSetAccessTest.InvalidNullPointerStart/Intel_R__OpenCL___{{.*}}_ From 0c4585f8867709b210af67da262e4906fa87c2eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Mestre?= Date: Mon, 20 Nov 2023 12:52:38 +0000 Subject: [PATCH 3/4] Fix windows build --- test/conformance/source/environment.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/conformance/source/environment.cpp b/test/conformance/source/environment.cpp index 8e99983c9b..c47de93e7f 100644 --- a/test/conformance/source/environment.cpp +++ b/test/conformance/source/environment.cpp @@ -14,6 +14,7 @@ #include #include +#include namespace uur { @@ -183,9 +184,9 @@ PlatformEnvironment::parsePlatformOptions(int argc, char **argv) { /* If a platform was not provided using the --platform command line option, * check if environment variable is set to use as a fallback. */ if (options.platform_name.empty()) { - const char *env_platform = std::getenv("UR_CTS_ADAPTER_PLATFORM"); - if (env_platform) { - options.platform_name = env_platform; + auto env_platform = ur_getenv("UR_CTS_ADAPTER_PLATFORM"); + if (env_platform.has_value()) { + options.platform_name = env_platform.value(); } } From 6502de1eb7d6fe096f92d48283c13ee43a809d09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Mestre?= Date: Mon, 20 Nov 2023 13:45:51 +0000 Subject: [PATCH 4/4] Fix formatting --- test/conformance/source/environment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/conformance/source/environment.cpp b/test/conformance/source/environment.cpp index c47de93e7f..5fe7d9b352 100644 --- a/test/conformance/source/environment.cpp +++ b/test/conformance/source/environment.cpp @@ -12,9 +12,9 @@ #include "kernel_entry_points.h" #endif +#include #include #include -#include namespace uur {