diff --git a/scripts/core/INTRO.rst b/scripts/core/INTRO.rst index 9a46d12170..f0458c538b 100644 --- a/scripts/core/INTRO.rst +++ b/scripts/core/INTRO.rst @@ -430,6 +430,13 @@ no valid platforms, then the tests will fail. Command line arguments take priori A (case insensitive) backend to force the test to use. For example, `opencl`, `level_zero`, `hip` and so on. +.. envvar:: UR_CTS_ALSO_RUN_KNOWN_FAILURES + + A boolean option to enable running tests which have been marked as known + failures using the :c:macro:`UUR_KNOWN_FAILURE_ON` macro. Enabled when the + environment variable is set to any of the following values: ``1``, ``on``, + ``ON``, ``yes``, ``YES``, ``true``, ``TRUE``. + Service identifiers --------------------- diff --git a/source/adapters/hip/device.cpp b/source/adapters/hip/device.cpp index c5ccee5bf4..85c4dba8f6 100644 --- a/source/adapters/hip/device.cpp +++ b/source/adapters/hip/device.cpp @@ -903,7 +903,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT: return ReturnValue(ur_bool_t{false}); case UR_DEVICE_INFO_USM_POOL_SUPPORT: +#ifdef UMF_ENABLE_POOL_TRACKING return ReturnValue(ur_bool_t{true}); +#else + return ReturnValue(ur_bool_t{false}); +#endif case UR_DEVICE_INFO_BFLOAT16: return ReturnValue(true); case UR_DEVICE_INFO_ASYNC_BARRIER: diff --git a/test/adapters/cuda/urDeviceCreateWithNativeHandle.cpp b/test/adapters/cuda/urDeviceCreateWithNativeHandle.cpp index 615e6e95dd..e97a1914f3 100644 --- a/test/adapters/cuda/urDeviceCreateWithNativeHandle.cpp +++ b/test/adapters/cuda/urDeviceCreateWithNativeHandle.cpp @@ -5,9 +5,10 @@ #include "fixtures.h" -using urCudaDeviceCreateWithNativeHandle = uur::urSelectedPlatformTest; +using urCudaDeviceCreateWithNativeHandle = uur::urPlatformTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urCudaDeviceCreateWithNativeHandle); -TEST_F(urCudaDeviceCreateWithNativeHandle, Success) { +TEST_P(urCudaDeviceCreateWithNativeHandle, Success) { // get a device from cuda int nCudaDevices; ASSERT_SUCCESS_CUDA(cuDeviceGetCount(&nCudaDevices)); @@ -16,7 +17,12 @@ TEST_F(urCudaDeviceCreateWithNativeHandle, Success) { ASSERT_SUCCESS_CUDA(cuDeviceGet(&cudaDevice, 0)); ur_native_handle_t nativeCuda = static_cast(cudaDevice); - ur_device_handle_t urDevice; + + ur_adapter_handle_t adapter = nullptr; + ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_ADAPTER, + sizeof(adapter), &adapter, nullptr)); + + ur_device_handle_t urDevice = nullptr; ASSERT_SUCCESS(urDeviceCreateWithNativeHandle(nativeCuda, adapter, nullptr, &urDevice)); } diff --git a/test/adapters/level_zero/event_cache_tests.cpp b/test/adapters/level_zero/event_cache_tests.cpp index e62e70ff9c..6a20592765 100644 --- a/test/adapters/level_zero/event_cache_tests.cpp +++ b/test/adapters/level_zero/event_cache_tests.cpp @@ -167,7 +167,7 @@ TEST_P(urEventCacheTest, eventsReuseWithVisibleEventAndWait) { template inline std::string printFlags(const testing::TestParamInfo &info) { - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); auto flags = combineFlags(std::get<1>(info.param)); @@ -181,7 +181,7 @@ printFlags(const testing::TestParamInfo &info) { return platform_device_name + "__" + str; } -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urEventCacheTest, ::testing::Combine( testing::Values(0, UR_QUEUE_FLAG_DISCARD_EVENTS), diff --git a/test/adapters/level_zero/multi_device_event_cache_tests.cpp b/test/adapters/level_zero/multi_device_event_cache_tests.cpp index 6b8457fe37..06f2b60c72 100644 --- a/test/adapters/level_zero/multi_device_event_cache_tests.cpp +++ b/test/adapters/level_zero/multi_device_event_cache_tests.cpp @@ -3,13 +3,9 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "ur_print.hpp" #include "uur/fixtures.h" #include "uur/raii.h" -#include -#include - #include "ze_tracer_common.hpp" size_t zeCommandListAppendWaitOnEventsCount = 0; @@ -27,7 +23,9 @@ static std::shared_ptr<_zel_tracer_handle_t> tracer = [] { }(); using urMultiQueueMultiDeviceEventCacheTest = uur::urAllDevicesTest; -TEST_F(urMultiQueueMultiDeviceEventCacheTest, +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urMultiQueueMultiDeviceEventCacheTest); + +TEST_P(urMultiQueueMultiDeviceEventCacheTest, GivenMultiSubDeviceWithQueuePerSubDeviceThenEventIsSharedBetweenQueues) { uint32_t max_sub_devices = 0; ASSERT_SUCCESS( @@ -83,7 +81,7 @@ TEST_F(urMultiQueueMultiDeviceEventCacheTest, ASSERT_SUCCESS(urQueueRelease(queue1)); } -TEST_F(urMultiQueueMultiDeviceEventCacheTest, +TEST_P(urMultiQueueMultiDeviceEventCacheTest, GivenMultiDeviceWithQueuePerDeviceThenMultiDeviceEventIsCreated) { if (devices.size() < 2) { GTEST_SKIP(); diff --git a/test/adapters/level_zero/urKernelCreateWithNativeHandle.cpp b/test/adapters/level_zero/urKernelCreateWithNativeHandle.cpp index 065b3520b8..54c93c7068 100644 --- a/test/adapters/level_zero/urKernelCreateWithNativeHandle.cpp +++ b/test/adapters/level_zero/urKernelCreateWithNativeHandle.cpp @@ -19,7 +19,7 @@ TEST_P(urLevelZeroKernelNativeHandleTest, OwnedHandleRelease) { urDeviceGetNativeHandle(device, (ur_native_handle_t *)&native_device); std::shared_ptr> il_binary; - uur::KernelsEnvironment::instance->LoadSource("foo", il_binary); + uur::KernelsEnvironment::instance->LoadSource("foo", platform, il_binary); auto kernel_name = uur::KernelsEnvironment::instance->GetEntryPointNames("foo")[0]; @@ -79,7 +79,7 @@ TEST_P(urLevelZeroKernelNativeHandleTest, NullProgram) { urDeviceGetNativeHandle(device, (ur_native_handle_t *)&native_device); std::shared_ptr> il_binary; - uur::KernelsEnvironment::instance->LoadSource("foo", il_binary); + uur::KernelsEnvironment::instance->LoadSource("foo", platform, il_binary); auto kernel_name = uur::KernelsEnvironment::instance->GetEntryPointNames("foo")[0]; diff --git a/test/adapters/level_zero/v2/event_pool_test.cpp b/test/adapters/level_zero/v2/event_pool_test.cpp index 97b166c63d..7b4addf55b 100644 --- a/test/adapters/level_zero/v2/event_pool_test.cpp +++ b/test/adapters/level_zero/v2/event_pool_test.cpp @@ -88,7 +88,7 @@ struct ProviderParams { template inline std::string printParams(const testing::TestParamInfo &info) { - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); auto params = std::get<1>(info.param); @@ -144,8 +144,8 @@ static ProviderParams test_cases[] = { //{TEST_PROVIDER_COUNTER, EVENT_COUNTER, QUEUE_IMMEDIATE}, }; -UUR_TEST_SUITE_P(EventPoolTest, testing::ValuesIn(test_cases), - printParams); +UUR_DEVICE_TEST_SUITE_P(EventPoolTest, testing::ValuesIn(test_cases), + printParams); TEST_P(EventPoolTest, InvalidDevice) { auto pool = cache->borrow(MAX_DEVICES, getParam().flags); @@ -237,8 +237,8 @@ TEST_P(EventPoolTest, ProviderNormalUseMostFreePool) { using EventPoolTestWithQueue = uur::urQueueTestWithParam; -UUR_TEST_SUITE_P(EventPoolTestWithQueue, testing::ValuesIn(test_cases), - printParams); +UUR_DEVICE_TEST_SUITE_P(EventPoolTestWithQueue, testing::ValuesIn(test_cases), + printParams); // TODO: actual min version is unknown, retest after drivers on CI are // updated. diff --git a/test/adapters/level_zero/v2/memory_residency.cpp b/test/adapters/level_zero/v2/memory_residency.cpp index b1e2b561a5..41014265ed 100644 --- a/test/adapters/level_zero/v2/memory_residency.cpp +++ b/test/adapters/level_zero/v2/memory_residency.cpp @@ -3,43 +3,34 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "ur_print.hpp" #include "uur/fixtures.h" -#include "uur/raii.h" #include "uur/utils.h" -#include -#include - using urMemoryResidencyTest = uur::urMultiDeviceContextTestTemplate<1>; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urMemoryResidencyTest); -TEST_F(urMemoryResidencyTest, allocatingDeviceMemoryWillResultInOOM) { +TEST_P(urMemoryResidencyTest, allocatingDeviceMemoryWillResultInOOM) { static constexpr size_t allocSize = 1024 * 1024; - if (!uur::isPVC(uur::DevicesEnvironment::instance->devices[0])) { + if (!uur::isPVC(devices[0])) { GTEST_SKIP() << "Test requires a PVC device"; } size_t initialMemFree = 0; - ASSERT_SUCCESS( - urDeviceGetInfo(uur::DevicesEnvironment::instance->devices[0], - UR_DEVICE_INFO_GLOBAL_MEM_FREE, sizeof(size_t), - &initialMemFree, nullptr)); + ASSERT_SUCCESS(urDeviceGetInfo(devices[0], UR_DEVICE_INFO_GLOBAL_MEM_FREE, + sizeof(size_t), &initialMemFree, nullptr)); if (initialMemFree < allocSize) { GTEST_SKIP() << "Not enough device memory available"; } void *ptr = nullptr; - ASSERT_SUCCESS( - urUSMDeviceAlloc(context, uur::DevicesEnvironment::instance->devices[0], - nullptr, nullptr, allocSize, &ptr)); + ASSERT_SUCCESS(urUSMDeviceAlloc(context, devices[0], nullptr, nullptr, + allocSize, &ptr)); size_t currentMemFree = 0; - ASSERT_SUCCESS( - urDeviceGetInfo(uur::DevicesEnvironment::instance->devices[0], - UR_DEVICE_INFO_GLOBAL_MEM_FREE, sizeof(size_t), - ¤tMemFree, nullptr)); + ASSERT_SUCCESS(urDeviceGetInfo(devices[0], UR_DEVICE_INFO_GLOBAL_MEM_FREE, + sizeof(size_t), ¤tMemFree, nullptr)); // amount of free memory should decrease after making a memory allocation resident ASSERT_LE(currentMemFree, initialMemFree); diff --git a/test/conformance/CMakeLists.txt b/test/conformance/CMakeLists.txt index e71a829964..0ae75ad667 100644 --- a/test/conformance/CMakeLists.txt +++ b/test/conformance/CMakeLists.txt @@ -14,33 +14,16 @@ function(add_test_adapter name adapter backend) set(TEST_NAME ${name}-${adapter}) set(TEST_COMMAND - "${PROJECT_BINARY_DIR}/bin/${TEST_TARGET_NAME} --backend=${backend} --devices_count=${UR_TEST_DEVICES_COUNT} --platforms_count=${UR_TEST_PLATFORMS_COUNT}" + "${PROJECT_BINARY_DIR}/bin/${TEST_TARGET_NAME} --gtest_filter=*${backend}*" ) - set(MATCH_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${name}_${adapter}.match") function(do_add_test tname env) - if(${UR_CONFORMANCE_ENABLE_MATCH_FILES} AND EXISTS ${MATCH_FILE}) - add_test(NAME ${tname} - COMMAND ${Python3_EXECUTABLE} ${UR_CONFORMANCE_TEST_DIR}/cts_exe.py - --failslist ${MATCH_FILE} - --test_command ${PROJECT_BINARY_DIR}/bin/${TEST_TARGET_NAME} - -- - --backend=${backend} - --devices_count=${UR_TEST_DEVICES_COUNT} - --platforms_count=${UR_TEST_PLATFORMS_COUNT} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) - else() - separate_arguments(TEST_COMMAND) - add_test(NAME ${tname} - COMMAND ${TEST_COMMAND} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) - endif() + separate_arguments(TEST_COMMAND) + add_test(NAME ${tname} + COMMAND ${TEST_COMMAND} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) - if(UR_CONFORMANCE_ENABLE_MATCH_FILES) - list(APPEND env GTEST_COLOR=yes) - endif() set_tests_properties(${tname} PROPERTIES ENVIRONMENT "${env}" LABELS "conformance;${adapter}") @@ -67,6 +50,10 @@ function(add_conformance_test name) GTest::gtest_main unit_tests_helpers) + if(UR_USE_CFI) + target_compile_definitions(${TEST_TARGET_NAME} PRIVATE UR_USE_CFI) + endif() + if(UR_BUILD_ADAPTER_CUDA OR UR_BUILD_ADAPTER_ALL) add_test_adapter(${name} adapter_cuda CUDA) endif() @@ -74,13 +61,13 @@ function(add_conformance_test name) add_test_adapter(${name} adapter_hip HIP) endif() if(UR_BUILD_ADAPTER_L0 OR UR_BUILD_ADAPTER_ALL) - add_test_adapter(${name} adapter_level_zero LEVEL_ZERO) + add_test_adapter(${name} adapter_level_zero Level_Zero) endif() if(UR_BUILD_ADAPTER_L0_V2) - add_test_adapter(${name} adapter_level_zero_v2 LEVEL_ZERO) + add_test_adapter(${name} adapter_level_zero_v2 Level_Zero) endif() if(UR_BUILD_ADAPTER_OPENCL OR UR_BUILD_ADAPTER_ALL) - add_test_adapter(${name} adapter_opencl OPENCL) + add_test_adapter(${name} adapter_opencl OpenCL) endif() if(UR_BUILD_ADAPTER_NATIVE_CPU OR UR_BUILD_ADAPTER_ALL) add_test_adapter(${name} adapter_native_cpu NATIVE_CPU) diff --git a/test/conformance/README.md b/test/conformance/README.md index 86df647c0d..0376c127d1 100644 --- a/test/conformance/README.md +++ b/test/conformance/README.md @@ -19,4 +19,54 @@ all available devices/platforms, set 0. The default value is 1. If you run binaries for the tests, you can use the parameter `--platforms_count=COUNT` or `--devices_count=COUNT`. To set test device/platform name you want to run the tests on, use -parameter `--platform=NAME` or `--device=NAME`. \ No newline at end of file +parameter `--platform=NAME` or `--device=NAME`. + +## Known failures + +The `UUR_KNOWN_FAILURE_ON` macro can be used to skip tests on devices where the +test is known to fail. This can be done in the following situations. + +For all devices in an adapter: + +```cpp +UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); +``` + +By substring match of the device name within and adapter: + +```cpp +UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) UHD Graphics 770"}); +``` + +In certain test suits, where there is no access to a device, the platform name +is used instead: + +```cpp +UUR_KNOWN_FAILURE_ON(uur::CUDA{"NVIDIA CUDA BACKEND"}); +``` + +When neither device or platform is available in a test suite, the name is +ignored and only the adapter backend is used to determine if the test is a +known failure. + +The macro is variadic making it possible to specify known failures for multiple +adapters in a single place and multiple names can also be provided per adapter: + +```cpp +UUR_KNOWN_FAILURE_ON( +uur::OpenCL{ + "Intel(R) UHD Graphics 750", + "Intel(R) UHD Graphics 770", +}, +uur::HIP{"Radeon RX 7700"}, +uur::NativeCPU{}); +``` + +The following adapter matcher objects are available: + +* `uur::OpenCL` +* `uur::LevelZero` +* `uur::LevelZeroV2` +* `uur::CUDA` +* `uur::HIP` +* `uur::NativeCPU` diff --git a/test/conformance/context/context_adapter_level_zero.match b/test/conformance/context/context_adapter_level_zero.match deleted file mode 100644 index 82c2e813e5..0000000000 --- a/test/conformance/context/context_adapter_level_zero.match +++ /dev/null @@ -1 +0,0 @@ -{{OPT}}urContextSetExtendedDeleterTest.Success/* diff --git a/test/conformance/context/context_adapter_level_zero_v2.match b/test/conformance/context/context_adapter_level_zero_v2.match deleted file mode 100644 index 82c2e813e5..0000000000 --- a/test/conformance/context/context_adapter_level_zero_v2.match +++ /dev/null @@ -1 +0,0 @@ -{{OPT}}urContextSetExtendedDeleterTest.Success/* diff --git a/test/conformance/context/context_adapter_native_cpu.match b/test/conformance/context/context_adapter_native_cpu.match deleted file mode 100644 index 82c2e813e5..0000000000 --- a/test/conformance/context/context_adapter_native_cpu.match +++ /dev/null @@ -1 +0,0 @@ -{{OPT}}urContextSetExtendedDeleterTest.Success/* diff --git a/test/conformance/context/urContextCreate.cpp b/test/conformance/context/urContextCreate.cpp index 0dc4341bd0..a3ee7837a9 100644 --- a/test/conformance/context/urContextCreate.cpp +++ b/test/conformance/context/urContextCreate.cpp @@ -31,14 +31,11 @@ TEST_P(urContextCreateTest, InvalidNullPointerDevices) { } TEST_P(urContextCreateTest, InvalidNullPointerContext) { - auto device = GetParam(); ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, urContextCreate(1, &device, nullptr, nullptr)); } TEST_P(urContextCreateTest, InvalidEnumeration) { - auto device = GetParam(); - ur_context_properties_t properties{UR_STRUCTURE_TYPE_CONTEXT_PROPERTIES, nullptr, UR_CONTEXT_FLAGS_MASK}; uur::raii::Context context = nullptr; @@ -48,7 +45,9 @@ TEST_P(urContextCreateTest, InvalidEnumeration) { } using urContextCreateMultiDeviceTest = uur::urAllDevicesTest; -TEST_F(urContextCreateMultiDeviceTest, Success) { +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urContextCreateMultiDeviceTest); + +TEST_P(urContextCreateMultiDeviceTest, Success) { if (devices.size() < 2) { GTEST_SKIP(); } diff --git a/test/conformance/context/urContextCreateWithNativeHandle.cpp b/test/conformance/context/urContextCreateWithNativeHandle.cpp index 599f402f77..d876c7190f 100644 --- a/test/conformance/context/urContextCreateWithNativeHandle.cpp +++ b/test/conformance/context/urContextCreateWithNativeHandle.cpp @@ -3,7 +3,6 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "uur/environment.h" #include using urContextCreateWithNativeHandleTest = uur::urContextTest; diff --git a/test/conformance/context/urContextGetInfo.cpp b/test/conformance/context/urContextGetInfo.cpp index 83ade8daab..d8de74984a 100644 --- a/test/conformance/context/urContextGetInfo.cpp +++ b/test/conformance/context/urContextGetInfo.cpp @@ -18,7 +18,7 @@ TEST_P(urContextGetInfoTest, SuccessNumDevices) { ASSERT_SUCCESS( urContextGetInfo(context, info_type, size, &nDevices, nullptr)); - ASSERT_GE(uur::DevicesEnvironment::instance->devices.size(), nDevices); + ASSERT_EQ(nDevices, 1); } TEST_P(urContextGetInfoTest, SuccessDevices) { @@ -28,20 +28,13 @@ TEST_P(urContextGetInfoTest, SuccessDevices) { ASSERT_SUCCESS(urContextGetInfo(context, info_type, 0, nullptr, &size)); ASSERT_NE(size, 0); - ur_device_handle_t devices = 0; + ur_device_handle_t queried_device = nullptr; ASSERT_SUCCESS( - urContextGetInfo(context, info_type, size, &devices, nullptr)); + urContextGetInfo(context, info_type, size, &queried_device, nullptr)); size_t devices_count = size / sizeof(ur_device_handle_t); - ASSERT_GT(devices_count, 0); - - for (uint32_t i = 0; i < devices_count; i++) { - auto &devices = uur::DevicesEnvironment::instance->devices; - auto queried_device = - std::find(devices.begin(), devices.end(), devices[i]); - EXPECT_TRUE(queried_device != devices.end()) - << "device associated with the context is not valid"; - } + ASSERT_EQ(devices_count, 1); + ASSERT_EQ(queried_device, device); } TEST_P(urContextGetInfoTest, SuccessUSMMemCpy2DSupport) { diff --git a/test/conformance/context/urContextSetExtendedDeleter.cpp b/test/conformance/context/urContextSetExtendedDeleter.cpp index ad09ac2179..05727d2336 100644 --- a/test/conformance/context/urContextSetExtendedDeleter.cpp +++ b/test/conformance/context/urContextSetExtendedDeleter.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "uur/fixtures.h" +#include "uur/known_failure.h" #include "uur/raii.h" using urContextSetExtendedDeleterTest = uur::urDeviceTest; @@ -11,6 +12,9 @@ using urContextSetExtendedDeleterTest = uur::urDeviceTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urContextSetExtendedDeleterTest); TEST_P(urContextSetExtendedDeleterTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}, + uur::NativeCPU{}); + bool called = false; { uur::raii::Context context = nullptr; diff --git a/test/conformance/device/CMakeLists.txt b/test/conformance/device/CMakeLists.txt index 0f7da3d80c..b376eab767 100644 --- a/test/conformance/device/CMakeLists.txt +++ b/test/conformance/device/CMakeLists.txt @@ -3,7 +3,7 @@ # See LICENSE.TXT # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -add_conformance_test_with_platform_environment(device +add_conformance_test_with_devices_environment(device urDeviceCreateWithNativeHandle.cpp urDeviceGet.cpp urDeviceGetGlobalTimestamps.cpp diff --git a/test/conformance/device/device_adapter_cuda.match b/test/conformance/device/device_adapter_cuda.match deleted file mode 100644 index e42f948b73..0000000000 --- a/test/conformance/device/device_adapter_cuda.match +++ /dev/null @@ -1,2 +0,0 @@ -{{OPT}}urDeviceGetGlobalTimestampTest.SuccessSynchronizedTime -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS diff --git a/test/conformance/device/device_adapter_hip.match b/test/conformance/device/device_adapter_hip.match deleted file mode 100644 index 48e00debe4..0000000000 --- a/test/conformance/device/device_adapter_hip.match +++ /dev/null @@ -1 +0,0 @@ -{{OPT}}urDeviceGetGlobalTimestampTest.SuccessSynchronizedTime diff --git a/test/conformance/device/device_adapter_level_zero.match b/test/conformance/device/device_adapter_level_zero.match deleted file mode 100644 index 87140fb10c..0000000000 --- a/test/conformance/device/device_adapter_level_zero.match +++ /dev/null @@ -1,2 +0,0 @@ -{{OPT}}urDeviceGetGlobalTimestampTest.SuccessSynchronizedTime -{{OPT}}urDeviceGetInfoTest.Success/UR_DEVICE_INFO_GLOBAL_MEM_FREE diff --git a/test/conformance/device/device_adapter_level_zero_v2.match b/test/conformance/device/device_adapter_level_zero_v2.match deleted file mode 100644 index 87140fb10c..0000000000 --- a/test/conformance/device/device_adapter_level_zero_v2.match +++ /dev/null @@ -1,2 +0,0 @@ -{{OPT}}urDeviceGetGlobalTimestampTest.SuccessSynchronizedTime -{{OPT}}urDeviceGetInfoTest.Success/UR_DEVICE_INFO_GLOBAL_MEM_FREE diff --git a/test/conformance/device/device_adapter_native_cpu.match b/test/conformance/device/device_adapter_native_cpu.match deleted file mode 100644 index 2764ad4fd1..0000000000 --- a/test/conformance/device/device_adapter_native_cpu.match +++ /dev/null @@ -1,16 +0,0 @@ -urDeviceCreateWithNativeHandleTest.InvalidNullHandlePlatform -urDeviceCreateWithNativeHandleTest.InvalidNullPointerDevice -{{OPT}}urDeviceGetGlobalTimestampTest.SuccessSynchronizedTime -urDeviceGetInfoSingleTest.MaxWorkGroupSizeIsNonzero -{{OPT}}urDeviceSelectBinaryTest.Success -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_QUEUE_ON_DEVICE_PROPERTIES -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_QUEUE_ON_HOST_PROPERTIES -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_IL_VERSION -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_MAX_WORK_GROUPS_3D -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_ASYNC_BARRIER -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS diff --git a/test/conformance/device/urDeviceCreateWithNativeHandle.cpp b/test/conformance/device/urDeviceCreateWithNativeHandle.cpp index d72435c274..045c24b826 100644 --- a/test/conformance/device/urDeviceCreateWithNativeHandle.cpp +++ b/test/conformance/device/urDeviceCreateWithNativeHandle.cpp @@ -3,82 +3,78 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include -using urDeviceCreateWithNativeHandleTest = uur::urAllDevicesTest; +using urDeviceCreateWithNativeHandleTest = uur::urDeviceTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urDeviceCreateWithNativeHandleTest); -TEST_F(urDeviceCreateWithNativeHandleTest, Success) { - for (auto device : devices) { - ur_native_handle_t native_handle = 0; +TEST_P(urDeviceCreateWithNativeHandleTest, Success) { + ur_native_handle_t native_handle = 0; - UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( - urDeviceGetNativeHandle(device, &native_handle)); + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urDeviceGetNativeHandle(device, &native_handle)); - // We cannot assume anything about a native_handle, not even if it's - // `nullptr` since this could be a valid representation within a backend. - // We can however convert the native_handle back into a unified-runtime handle - // and perform some query on it to verify that it works. - ur_device_handle_t dev = nullptr; - UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceCreateWithNativeHandle( - native_handle, adapter, nullptr, &dev)); - ASSERT_NE(dev, nullptr); + // We cannot assume anything about a native_handle, not even if it's + // `nullptr` since this could be a valid representation within a backend. + // We can however convert the native_handle back into a unified-runtime handle + // and perform some query on it to verify that it works. + ur_device_handle_t dev = nullptr; + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urDeviceCreateWithNativeHandle(native_handle, adapter, nullptr, &dev)); + ASSERT_NE(dev, nullptr); - uint32_t dev_id = 0; - ASSERT_SUCCESS(urDeviceGetInfo(dev, UR_DEVICE_INFO_TYPE, - sizeof(uint32_t), &dev_id, nullptr)); - } + uint32_t dev_id = 0; + ASSERT_SUCCESS(urDeviceGetInfo(dev, UR_DEVICE_INFO_TYPE, sizeof(uint32_t), + &dev_id, nullptr)); } -TEST_F(urDeviceCreateWithNativeHandleTest, SuccessWithOwnedNativeHandle) { - for (auto device : devices) { - ur_native_handle_t native_handle = 0; +TEST_P(urDeviceCreateWithNativeHandleTest, SuccessWithOwnedNativeHandle) { + ur_native_handle_t native_handle = 0; - UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( - urDeviceGetNativeHandle(device, &native_handle)); + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urDeviceGetNativeHandle(device, &native_handle)); - ur_device_handle_t dev = nullptr; - ur_device_native_properties_t props{ - UR_STRUCTURE_TYPE_DEVICE_NATIVE_PROPERTIES, nullptr, true}; - UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceCreateWithNativeHandle( - native_handle, adapter, &props, &dev)); - ASSERT_NE(dev, nullptr); - } + ur_device_handle_t dev = nullptr; + ur_device_native_properties_t props{ + UR_STRUCTURE_TYPE_DEVICE_NATIVE_PROPERTIES, nullptr, true}; + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urDeviceCreateWithNativeHandle(native_handle, adapter, &props, &dev)); + ASSERT_NE(dev, nullptr); } -TEST_F(urDeviceCreateWithNativeHandleTest, SuccessWithUnOwnedNativeHandle) { - for (auto device : devices) { - ur_native_handle_t native_handle = 0; +TEST_P(urDeviceCreateWithNativeHandleTest, SuccessWithUnOwnedNativeHandle) { + ur_native_handle_t native_handle = 0; - UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( - urDeviceGetNativeHandle(device, &native_handle)); + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urDeviceGetNativeHandle(device, &native_handle)); - ur_device_handle_t dev = nullptr; - ur_device_native_properties_t props{ - UR_STRUCTURE_TYPE_DEVICE_NATIVE_PROPERTIES, nullptr, false}; - UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceCreateWithNativeHandle( - native_handle, adapter, &props, &dev)); - ASSERT_NE(dev, nullptr); - } + ur_device_handle_t dev = nullptr; + ur_device_native_properties_t props{ + UR_STRUCTURE_TYPE_DEVICE_NATIVE_PROPERTIES, nullptr, false}; + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urDeviceCreateWithNativeHandle(native_handle, adapter, &props, &dev)); + ASSERT_NE(dev, nullptr); } -TEST_F(urDeviceCreateWithNativeHandleTest, InvalidNullHandlePlatform) { - for (auto device : devices) { - ur_native_handle_t native_handle = 0; - ASSERT_SUCCESS(urDeviceGetNativeHandle(device, &native_handle)); +TEST_P(urDeviceCreateWithNativeHandleTest, InvalidNullHandlePlatform) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); - ur_device_handle_t dev = nullptr; - ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, - urDeviceCreateWithNativeHandle(native_handle, nullptr, - nullptr, &dev)); - } + ur_native_handle_t native_handle = 0; + ASSERT_SUCCESS(urDeviceGetNativeHandle(device, &native_handle)); + + ur_device_handle_t dev = nullptr; + ASSERT_EQ_RESULT( + UR_RESULT_ERROR_INVALID_NULL_HANDLE, + urDeviceCreateWithNativeHandle(native_handle, nullptr, nullptr, &dev)); } -TEST_F(urDeviceCreateWithNativeHandleTest, InvalidNullPointerDevice) { - for (auto device : devices) { - ur_native_handle_t native_handle = 0; - ASSERT_SUCCESS(urDeviceGetNativeHandle(device, &native_handle)); +TEST_P(urDeviceCreateWithNativeHandleTest, InvalidNullPointerDevice) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + + ur_native_handle_t native_handle = 0; + ASSERT_SUCCESS(urDeviceGetNativeHandle(device, &native_handle)); - ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, - urDeviceCreateWithNativeHandle(native_handle, adapter, - nullptr, nullptr)); - } + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, + urDeviceCreateWithNativeHandle(native_handle, adapter, + nullptr, nullptr)); } diff --git a/test/conformance/device/urDeviceGet.cpp b/test/conformance/device/urDeviceGet.cpp index f6ec9d82aa..efd9a75269 100644 --- a/test/conformance/device/urDeviceGet.cpp +++ b/test/conformance/device/urDeviceGet.cpp @@ -71,31 +71,20 @@ TEST_P(urDeviceGetTest, InvalidNullPointerDevices) { urDeviceGet(platform, UR_DEVICE_TYPE_ALL, count, nullptr, nullptr)); } -struct urDeviceGetTestWithDeviceTypeParam - : uur::urAllDevicesTest, - ::testing::WithParamInterface { +using urDeviceGetTestWithDeviceTypeParam = + uur::urPlatformTestWithParam; - void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(uur::urAllDevicesTest::SetUp()); - } -}; - -INSTANTIATE_TEST_SUITE_P( - , urDeviceGetTestWithDeviceTypeParam, +UUR_PLATFORM_TEST_SUITE_P( + urDeviceGetTestWithDeviceTypeParam, ::testing::Values(UR_DEVICE_TYPE_DEFAULT, UR_DEVICE_TYPE_GPU, UR_DEVICE_TYPE_CPU, UR_DEVICE_TYPE_FPGA, UR_DEVICE_TYPE_MCA, UR_DEVICE_TYPE_VPU), - [](const ::testing::TestParamInfo &info) { - std::stringstream ss; - ss << info.param; - return ss.str(); - }); + uur::platformTestWithParamPrinter); TEST_P(urDeviceGetTestWithDeviceTypeParam, Success) { - ur_device_type_t device_type = GetParam(); + ur_device_type_t device_type = getParam(); uint32_t count = 0; ASSERT_SUCCESS(urDeviceGet(platform, device_type, 0, nullptr, &count)); - ASSERT_GE(devices.size(), count); if (count > 0) { std::vector devices(count); diff --git a/test/conformance/device/urDeviceGetGlobalTimestamps.cpp b/test/conformance/device/urDeviceGetGlobalTimestamps.cpp index 8275275afe..a9a5d05e44 100644 --- a/test/conformance/device/urDeviceGetGlobalTimestamps.cpp +++ b/test/conformance/device/urDeviceGetGlobalTimestamps.cpp @@ -7,6 +7,7 @@ #include #include #include +#include // WARNING - This is the precision that is used in the OpenCL-CTS. // - We might need to modify this value per-adapter. @@ -26,87 +27,89 @@ T absolute_difference(T a, T b) { return std::max(a, b) - std::min(a, b); } -using urDeviceGetGlobalTimestampTest = uur::urAllDevicesTest; - -TEST_F(urDeviceGetGlobalTimestampTest, Success) { - for (auto device : devices) { - uint64_t device_time = 0; - uint64_t host_time = 0; - ASSERT_SUCCESS( - urDeviceGetGlobalTimestamps(device, &device_time, &host_time)); - ASSERT_NE(device_time, 0); - ASSERT_NE(host_time, 0); - } +using urDeviceGetGlobalTimestampTest = uur::urDeviceTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urDeviceGetGlobalTimestampTest); + +TEST_P(urDeviceGetGlobalTimestampTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); + + uint64_t device_time = 0; + uint64_t host_time = 0; + ASSERT_SUCCESS( + urDeviceGetGlobalTimestamps(device, &device_time, &host_time)); + ASSERT_NE(device_time, 0); + ASSERT_NE(host_time, 0); } -TEST_F(urDeviceGetGlobalTimestampTest, SuccessHostTimer) { - for (auto device : devices) { - uint64_t host_time = 0; - ASSERT_SUCCESS( - urDeviceGetGlobalTimestamps(device, nullptr, &host_time)); - ASSERT_NE(host_time, 0); - } +TEST_P(urDeviceGetGlobalTimestampTest, SuccessHostTimer) { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); + + uint64_t host_time = 0; + ASSERT_SUCCESS(urDeviceGetGlobalTimestamps(device, nullptr, &host_time)); + ASSERT_NE(host_time, 0); } -TEST_F(urDeviceGetGlobalTimestampTest, SuccessNoTimers) { - for (auto device : devices) { - ASSERT_SUCCESS(urDeviceGetGlobalTimestamps(device, nullptr, nullptr)); - } +TEST_P(urDeviceGetGlobalTimestampTest, SuccessNoTimers) { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); + + ASSERT_SUCCESS(urDeviceGetGlobalTimestamps(device, nullptr, nullptr)); } -TEST_F(urDeviceGetGlobalTimestampTest, SuccessSynchronizedTime) { - for (auto device : devices) { - // get the timer resolution of the device - size_t deviceTimerResolutionNanoSecs = 0; - ASSERT_SUCCESS(uur::GetDeviceProfilingTimerResolution( - device, deviceTimerResolutionNanoSecs)); - size_t delayAmountNanoSecs = - delayTimerMultiplier * deviceTimerResolutionNanoSecs; - - uint64_t deviceStartTime = 0, deviceEndTime = 0; - uint64_t hostStartTime = 0, hostEndTime = 0; - uint64_t hostOnlyStartTime = 0, hostOnlyEndTime = 0; - - ASSERT_SUCCESS(urDeviceGetGlobalTimestamps(device, &deviceStartTime, - &hostStartTime)); - ASSERT_SUCCESS( - urDeviceGetGlobalTimestamps(device, nullptr, &hostOnlyStartTime)); - ASSERT_NE(deviceStartTime, 0); - ASSERT_NE(hostStartTime, 0); - ASSERT_NE(hostOnlyStartTime, 0); - ASSERT_GE(hostOnlyStartTime, hostStartTime); - - // wait for timers to increment - std::this_thread::sleep_for( - std::chrono::nanoseconds(delayAmountNanoSecs)); - - ASSERT_SUCCESS( - urDeviceGetGlobalTimestamps(device, &deviceEndTime, &hostEndTime)); - ASSERT_SUCCESS( - urDeviceGetGlobalTimestamps(device, nullptr, &hostOnlyEndTime)); - ASSERT_NE(deviceEndTime, 0); - ASSERT_NE(hostEndTime, 0); - ASSERT_NE(hostOnlyEndTime, 0); - ASSERT_GE(hostOnlyEndTime, hostEndTime); - - // check that the timers have advanced - ASSERT_GT(deviceEndTime, deviceStartTime); - ASSERT_GT(hostEndTime, hostStartTime); - ASSERT_GT(hostOnlyEndTime, hostOnlyStartTime); - - // assert that the host/devices times are synchronized to some accuracy - const uint64_t deviceTimeDiff = deviceEndTime - deviceStartTime; - const uint64_t hostTimeDiff = hostEndTime - hostStartTime; - const uint64_t observedDiff = - absolute_difference(deviceTimeDiff, hostTimeDiff); - const uint64_t allowedDiff = static_cast( - std::min(deviceTimeDiff, hostTimeDiff) * allowedTimerError); - - ASSERT_LE(observedDiff, allowedDiff); - } +TEST_P(urDeviceGetGlobalTimestampTest, SuccessSynchronizedTime) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}, uur::LevelZero{}, + uur::LevelZeroV2{}, uur::NativeCPU{}, + uur::OpenCL{"Intel(R) FPGA"}, + uur::OpenCL{"Intel(R) UHD Graphics 770"}); + + // get the timer resolution of the device + size_t deviceTimerResolutionNanoSecs = 0; + ASSERT_SUCCESS(uur::GetDeviceProfilingTimerResolution( + device, deviceTimerResolutionNanoSecs)); + size_t delayAmountNanoSecs = + delayTimerMultiplier * deviceTimerResolutionNanoSecs; + + uint64_t deviceStartTime = 0, deviceEndTime = 0; + uint64_t hostStartTime = 0, hostEndTime = 0; + uint64_t hostOnlyStartTime = 0, hostOnlyEndTime = 0; + + ASSERT_SUCCESS( + urDeviceGetGlobalTimestamps(device, &deviceStartTime, &hostStartTime)); + ASSERT_SUCCESS( + urDeviceGetGlobalTimestamps(device, nullptr, &hostOnlyStartTime)); + ASSERT_NE(deviceStartTime, 0); + ASSERT_NE(hostStartTime, 0); + ASSERT_NE(hostOnlyStartTime, 0); + ASSERT_GE(hostOnlyStartTime, hostStartTime); + + // wait for timers to increment + std::this_thread::sleep_for(std::chrono::nanoseconds(delayAmountNanoSecs)); + + ASSERT_SUCCESS( + urDeviceGetGlobalTimestamps(device, &deviceEndTime, &hostEndTime)); + ASSERT_SUCCESS( + urDeviceGetGlobalTimestamps(device, nullptr, &hostOnlyEndTime)); + ASSERT_NE(deviceEndTime, 0); + ASSERT_NE(hostEndTime, 0); + ASSERT_NE(hostOnlyEndTime, 0); + ASSERT_GE(hostOnlyEndTime, hostEndTime); + + // check that the timers have advanced + ASSERT_GT(deviceEndTime, deviceStartTime); + ASSERT_GT(hostEndTime, hostStartTime); + ASSERT_GT(hostOnlyEndTime, hostOnlyStartTime); + + // assert that the host/devices times are synchronized to some accuracy + const uint64_t deviceTimeDiff = deviceEndTime - deviceStartTime; + const uint64_t hostTimeDiff = hostEndTime - hostStartTime; + const uint64_t observedDiff = + absolute_difference(deviceTimeDiff, hostTimeDiff); + const uint64_t allowedDiff = static_cast( + std::min(deviceTimeDiff, hostTimeDiff) * allowedTimerError); + + ASSERT_LE(observedDiff, allowedDiff); } -TEST_F(urDeviceGetGlobalTimestampTest, InvalidNullHandleDevice) { +TEST_P(urDeviceGetGlobalTimestampTest, InvalidNullHandleDevice) { uint64_t device_time = 0; uint64_t host_time = 0; ASSERT_EQ_RESULT( diff --git a/test/conformance/device/urDeviceGetInfo.cpp b/test/conformance/device/urDeviceGetInfo.cpp index 1fc8e6ca7f..39cca23581 100644 --- a/test/conformance/device/urDeviceGetInfo.cpp +++ b/test/conformance/device/urDeviceGetInfo.cpp @@ -4,7 +4,10 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include + #include +#include static std::unordered_map device_info_size_map = { {UR_DEVICE_INFO_TYPE, sizeof(ur_device_type_t)}, @@ -125,16 +128,10 @@ static std::unordered_map device_info_size_map = { {UR_DEVICE_INFO_IP_VERSION, sizeof(uint32_t)}, {UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT, sizeof(ur_bool_t)}}; -struct urDeviceGetInfoTest : uur::urAllDevicesTest, - ::testing::WithParamInterface { - - void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(uur::urAllDevicesTest::SetUp()); - } -}; +using urDeviceGetInfoTest = uur::urDeviceTestWithParam; -INSTANTIATE_TEST_SUITE_P( - , urDeviceGetInfoTest, +UUR_DEVICE_TEST_SUITE_P( + urDeviceGetInfoTest, ::testing::Values( UR_DEVICE_INFO_TYPE, @@ -255,17 +252,10 @@ INSTANTIATE_TEST_SUITE_P( UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_HALF, // UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_INT // ), - [](const ::testing::TestParamInfo &info) { - std::stringstream ss; - ss << info.param; - return ss.str(); - }); + uur::deviceTestWithParamPrinter); -struct urDeviceGetInfoSingleTest : uur::urAllDevicesTest { - void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(uur::urAllDevicesTest::SetUp()); - } -}; +using urDeviceGetInfoSingleTest = uur::urDeviceTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urDeviceGetInfoSingleTest); bool doesReturnArray(ur_device_info_t info_type) { if (info_type == UR_DEVICE_INFO_SUPPORTED_PARTITIONS || @@ -275,36 +265,75 @@ bool doesReturnArray(ur_device_info_t info_type) { return false; } +const std::set nativeCPUFails = { + UR_DEVICE_INFO_DEVICE_ID, + UR_DEVICE_INFO_MEMORY_CLOCK_RATE, + UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS, + UR_DEVICE_INFO_GLOBAL_MEM_FREE, + UR_DEVICE_INFO_QUEUE_ON_DEVICE_PROPERTIES, + UR_DEVICE_INFO_QUEUE_ON_HOST_PROPERTIES, + UR_DEVICE_INFO_IL_VERSION, + UR_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS, + UR_DEVICE_INFO_UUID, + UR_DEVICE_INFO_PCI_ADDRESS, + UR_DEVICE_INFO_GPU_EU_COUNT, + UR_DEVICE_INFO_GPU_EU_SIMD_WIDTH, + UR_DEVICE_INFO_GPU_EU_SLICES, + UR_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE, + UR_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE, + UR_DEVICE_INFO_GPU_HW_THREADS_PER_EU, + UR_DEVICE_INFO_MAX_MEMORY_BANDWIDTH, + UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES, + UR_DEVICE_INFO_MEMORY_BUS_WIDTH, + UR_DEVICE_INFO_MAX_WORK_GROUPS_3D, + UR_DEVICE_INFO_ASYNC_BARRIER, + UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED, + UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP, + UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS, + UR_DEVICE_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES, + UR_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES}; + TEST_P(urDeviceGetInfoTest, Success) { - ur_device_info_t info_type = GetParam(); - for (auto device : devices) { - size_t size = 0; - ASSERT_SUCCESS_OR_OPTIONAL_QUERY( - urDeviceGetInfo(device, info_type, 0, nullptr, &size), info_type); + ur_device_info_t info_type = getParam(); + + if (info_type == UR_DEVICE_INFO_GLOBAL_MEM_FREE) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}, uur::NativeCPU{}); + } - if (doesReturnArray(info_type) && size == 0) { - return; - } - ASSERT_NE(size, 0); + if (info_type == UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + } + + if (nativeCPUFails.count(info_type)) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + } + + size_t size = 0; + ASSERT_SUCCESS_OR_OPTIONAL_QUERY( + urDeviceGetInfo(device, info_type, 0, nullptr, &size), info_type); - if (const auto expected_size = device_info_size_map.find(info_type); - expected_size != device_info_size_map.end()) { - ASSERT_EQ(expected_size->second, size); - } + if (doesReturnArray(info_type) && size == 0) { + return; + } + ASSERT_NE(size, 0); + + if (const auto expected_size = device_info_size_map.find(info_type); + expected_size != device_info_size_map.end()) { + ASSERT_EQ(expected_size->second, size); + } - std::vector info_data(size); - ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, size, - info_data.data(), nullptr)); + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); - if (info_type == UR_DEVICE_INFO_PLATFORM) { - auto returned_platform = - reinterpret_cast(info_data.data()); - ASSERT_EQ(*returned_platform, platform); - } + if (info_type == UR_DEVICE_INFO_PLATFORM) { + auto returned_platform = + reinterpret_cast(info_data.data()); + ASSERT_EQ(*returned_platform, platform); } } -TEST_F(urDeviceGetInfoSingleTest, InvalidNullHandleDevice) { +TEST_P(urDeviceGetInfoSingleTest, InvalidNullHandleDevice) { ur_device_type_t device_type; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, urDeviceGetInfo(nullptr, UR_DEVICE_INFO_TYPE, @@ -312,69 +341,56 @@ TEST_F(urDeviceGetInfoSingleTest, InvalidNullHandleDevice) { nullptr)); } -TEST_F(urDeviceGetInfoSingleTest, InvalidEnumerationInfoType) { - for (auto device : devices) { - ur_device_type_t device_type; - ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_ENUMERATION, - urDeviceGetInfo(device, UR_DEVICE_INFO_FORCE_UINT32, - sizeof(ur_device_type_t), &device_type, - nullptr)); - } +TEST_P(urDeviceGetInfoSingleTest, InvalidEnumerationInfoType) { + ur_device_type_t device_type; + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_ENUMERATION, + urDeviceGetInfo(device, UR_DEVICE_INFO_FORCE_UINT32, + sizeof(ur_device_type_t), &device_type, + nullptr)); } -TEST_F(urDeviceGetInfoSingleTest, InvalidSizePropSize) { - for (auto device : devices) { - ur_device_type_t device_type; - ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, - urDeviceGetInfo(device, UR_DEVICE_INFO_TYPE, 0, - &device_type, nullptr)); - } +TEST_P(urDeviceGetInfoSingleTest, InvalidSizePropSize) { + ur_device_type_t device_type; + ASSERT_EQ_RESULT( + UR_RESULT_ERROR_INVALID_SIZE, + urDeviceGetInfo(device, UR_DEVICE_INFO_TYPE, 0, &device_type, nullptr)); } -TEST_F(urDeviceGetInfoSingleTest, InvalidSizePropSizeSmall) { - for (auto device : devices) { - ur_device_type_t device_type; - ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, - urDeviceGetInfo(device, UR_DEVICE_INFO_TYPE, - sizeof(device_type) - 1, &device_type, - nullptr)); - } +TEST_P(urDeviceGetInfoSingleTest, InvalidSizePropSizeSmall) { + ur_device_type_t device_type; + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, + urDeviceGetInfo(device, UR_DEVICE_INFO_TYPE, + sizeof(device_type) - 1, &device_type, + nullptr)); } -TEST_F(urDeviceGetInfoSingleTest, InvalidNullPointerPropValue) { - for (auto device : devices) { - ur_device_type_t device_type; - ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, - urDeviceGetInfo(device, UR_DEVICE_INFO_TYPE, - sizeof(device_type), nullptr, - nullptr)); - } +TEST_P(urDeviceGetInfoSingleTest, InvalidNullPointerPropValue) { + ur_device_type_t device_type; + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, + urDeviceGetInfo(device, UR_DEVICE_INFO_TYPE, + sizeof(device_type), nullptr, nullptr)); } -TEST_F(urDeviceGetInfoSingleTest, InvalidNullPointerPropSizeRet) { - for (auto device : devices) { - ASSERT_EQ_RESULT( - UR_RESULT_ERROR_INVALID_NULL_POINTER, - urDeviceGetInfo(device, UR_DEVICE_INFO_TYPE, 0, nullptr, nullptr)); - } +TEST_P(urDeviceGetInfoSingleTest, InvalidNullPointerPropSizeRet) { + ASSERT_EQ_RESULT( + UR_RESULT_ERROR_INVALID_NULL_POINTER, + urDeviceGetInfo(device, UR_DEVICE_INFO_TYPE, 0, nullptr, nullptr)); } -TEST_F(urDeviceGetInfoSingleTest, MaxWorkGroupSizeIsNonzero) { - for (auto device : devices) { - size_t max_global_size; +TEST_P(urDeviceGetInfoSingleTest, MaxWorkGroupSizeIsNonzero) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + + size_t max_global_size; - ASSERT_SUCCESS( - urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_WORK_GROUP_SIZE, - sizeof(size_t), &max_global_size, nullptr)); - ASSERT_NE(max_global_size, 0); + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_WORK_GROUP_SIZE, + sizeof(size_t), &max_global_size, nullptr)); + ASSERT_NE(max_global_size, 0); - std::array max_work_group_sizes; - ASSERT_SUCCESS(urDeviceGetInfo(device, - UR_DEVICE_INFO_MAX_WORK_GROUPS_3D, - sizeof(max_work_group_sizes), - max_work_group_sizes.data(), nullptr)); - for (size_t i = 0; i < 3; i++) { - ASSERT_NE(max_work_group_sizes[i], 0); - } + std::array max_work_group_sizes; + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_WORK_GROUPS_3D, + sizeof(max_work_group_sizes), + max_work_group_sizes.data(), nullptr)); + for (size_t i = 0; i < 3; i++) { + ASSERT_NE(max_work_group_sizes[i], 0); } } diff --git a/test/conformance/device/urDeviceGetNativeHandle.cpp b/test/conformance/device/urDeviceGetNativeHandle.cpp index f6c8963681..6532c74545 100644 --- a/test/conformance/device/urDeviceGetNativeHandle.cpp +++ b/test/conformance/device/urDeviceGetNativeHandle.cpp @@ -4,26 +4,23 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -using urDeviceGetNativeHandleTest = uur::urAllDevicesTest; +using urDeviceGetNativeHandleTest = uur::urDeviceTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urDeviceGetNativeHandleTest); -TEST_F(urDeviceGetNativeHandleTest, Success) { - for (auto device : devices) { - ur_native_handle_t native_handle = 0; - if (auto error = urDeviceGetNativeHandle(device, &native_handle)) { - ASSERT_EQ_RESULT(UR_RESULT_ERROR_UNSUPPORTED_FEATURE, error); - } +TEST_P(urDeviceGetNativeHandleTest, Success) { + ur_native_handle_t native_handle = 0; + if (auto error = urDeviceGetNativeHandle(device, &native_handle)) { + ASSERT_EQ_RESULT(UR_RESULT_ERROR_UNSUPPORTED_FEATURE, error); } } -TEST_F(urDeviceGetNativeHandleTest, InvalidNullHandleDevice) { +TEST_P(urDeviceGetNativeHandleTest, InvalidNullHandleDevice) { ur_native_handle_t native_handle = 0; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, urDeviceGetNativeHandle(nullptr, &native_handle)); } -TEST_F(urDeviceGetNativeHandleTest, InvalidNullPointerNativeDevice) { - for (auto device : devices) { - ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, - urDeviceGetNativeHandle(device, nullptr)); - } +TEST_P(urDeviceGetNativeHandleTest, InvalidNullPointerNativeDevice) { + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, + urDeviceGetNativeHandle(device, nullptr)); } diff --git a/test/conformance/device/urDevicePartition.cpp b/test/conformance/device/urDevicePartition.cpp index cdba0d9d1c..d331465b20 100644 --- a/test/conformance/device/urDevicePartition.cpp +++ b/test/conformance/device/urDevicePartition.cpp @@ -5,11 +5,8 @@ #include #include -using urDevicePartitionTest = uur::urAllDevicesTest; - -template -struct urDevicePartitionTestWithParam : uur::urAllDevicesTest, - ::testing::WithParamInterface {}; +using urDevicePartitionTest = uur::urDeviceTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urDevicePartitionTest); void getNumberComputeUnits(ur_device_handle_t device, uint32_t &n_compute_units) { @@ -17,211 +14,129 @@ void getNumberComputeUnits(ur_device_handle_t device, ASSERT_NE(n_compute_units, 0); } -TEST_F(urDevicePartitionTest, PartitionEquallySuccess) { - for (auto device : devices) { - - if (!uur::hasDevicePartitionSupport(device, - UR_DEVICE_PARTITION_EQUALLY)) { - ::testing::Message() << "Device: \'" << device - << "\' does not support partitioning equally."; - continue; - } +TEST_P(urDevicePartitionTest, PartitionEquallySuccess) { - uint32_t n_compute_units = 0; - ASSERT_NO_FATAL_FAILURE(getNumberComputeUnits(device, n_compute_units)); - - for (uint32_t i = 1; i < n_compute_units; ++i) { - ur_device_partition_property_t property = - uur::makePartitionEquallyDesc(i); - - ur_device_partition_properties_t properties{ - UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, - nullptr, - &property, - 1, - }; - - // Get the number of devices that will be created - uint32_t n_devices = 0; - ASSERT_SUCCESS( - urDevicePartition(device, &properties, 0, nullptr, &n_devices)); - ASSERT_NE(n_devices, 0); - - std::vector sub_devices(n_devices); - ASSERT_SUCCESS(urDevicePartition( - device, &properties, static_cast(sub_devices.size()), - sub_devices.data(), nullptr)); - for (auto sub_device : sub_devices) { - ASSERT_NE(sub_device, nullptr); - ASSERT_SUCCESS(urDeviceRelease(sub_device)); - } - } + if (!uur::hasDevicePartitionSupport(device, UR_DEVICE_PARTITION_EQUALLY)) { + GTEST_SKIP() << "Device: \'" << device + << "\' does not support partitioning equally."; } -} -TEST_F(urDevicePartitionTest, PartitionByCounts) { + uint32_t n_compute_units = 0; + ASSERT_NO_FATAL_FAILURE(getNumberComputeUnits(device, n_compute_units)); - for (auto device : devices) { + for (uint32_t i = 1; i < n_compute_units; ++i) { + ur_device_partition_property_t property = + uur::makePartitionEquallyDesc(i); + + ur_device_partition_properties_t properties{ + UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, + nullptr, + &property, + 1, + }; + + // Get the number of devices that will be created + uint32_t n_devices = 0; + ASSERT_SUCCESS( + urDevicePartition(device, &properties, 0, nullptr, &n_devices)); + ASSERT_NE(n_devices, 0); - if (!uur::hasDevicePartitionSupport(device, - UR_DEVICE_PARTITION_BY_COUNTS)) { - ::testing::Message() - << "Device: \'" << device - << "\' does not support partitioning by counts.\n"; - continue; + std::vector sub_devices(n_devices); + ASSERT_SUCCESS(urDevicePartition( + device, &properties, static_cast(sub_devices.size()), + sub_devices.data(), nullptr)); + for (auto sub_device : sub_devices) { + ASSERT_NE(sub_device, nullptr); + ASSERT_SUCCESS(urDeviceRelease(sub_device)); } + } +} - uint32_t n_cu_in_device = 0; - ASSERT_NO_FATAL_FAILURE(getNumberComputeUnits(device, n_cu_in_device)); +TEST_P(urDevicePartitionTest, PartitionByCounts) { - enum class Combination { ONE, HALF, ALL_MINUS_ONE, ALL }; + if (!uur::hasDevicePartitionSupport(device, + UR_DEVICE_PARTITION_BY_COUNTS)) { + GTEST_SKIP() << "Device: \'" << device + << "\' does not support partitioning by counts.\n"; + } - std::vector combinations{Combination::ONE, - Combination::ALL}; + uint32_t n_cu_in_device = 0; + ASSERT_NO_FATAL_FAILURE(getNumberComputeUnits(device, n_cu_in_device)); - if (n_cu_in_device >= 2) { - combinations.push_back(Combination::HALF); - combinations.push_back(Combination::ALL_MINUS_ONE); - } + enum class Combination { ONE, HALF, ALL_MINUS_ONE, ALL }; - uint32_t n_cu_across_sub_devices; - for (const auto Combination : combinations) { - - std::vector property_list; - - switch (Combination) { - case Combination::ONE: { - n_cu_across_sub_devices = 1; - property_list.push_back(uur::makePartitionByCountsDesc(1)); - break; - } - case Combination::HALF: { - n_cu_across_sub_devices = (n_cu_in_device / 2) * 2; - property_list.push_back( - uur::makePartitionByCountsDesc(n_cu_in_device / 2)); - property_list.push_back( - uur::makePartitionByCountsDesc(n_cu_in_device / 2)); - break; - } - case Combination::ALL_MINUS_ONE: { - n_cu_across_sub_devices = n_cu_in_device - 1; - property_list.push_back( - uur::makePartitionByCountsDesc(n_cu_in_device - 1)); - break; - } - case Combination::ALL: { - n_cu_across_sub_devices = n_cu_in_device; - property_list.push_back( - uur::makePartitionByCountsDesc(n_cu_in_device)); - break; - } - } - - ur_device_partition_properties_t properties{ - UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, - nullptr, - property_list.data(), - property_list.size(), - }; - - // Get the number of devices that will be created - uint32_t n_devices = 0; - ASSERT_SUCCESS( - urDevicePartition(device, &properties, 0, nullptr, &n_devices)); - ASSERT_EQ(n_devices, property_list.size()); - - std::vector sub_devices(n_devices); - ASSERT_SUCCESS(urDevicePartition( - device, &properties, static_cast(sub_devices.size()), - sub_devices.data(), nullptr)); - - uint32_t sum = 0; - for (auto sub_device : sub_devices) { - ASSERT_NE(sub_device, nullptr); - uint32_t n_cu_in_sub_device; - ASSERT_NO_FATAL_FAILURE( - getNumberComputeUnits(sub_device, n_cu_in_sub_device)); - sum += n_cu_in_sub_device; - ASSERT_SUCCESS(urDeviceRelease(sub_device)); - } - ASSERT_EQ(n_cu_across_sub_devices, sum); - } + std::vector combinations{Combination::ONE, Combination::ALL}; + + if (n_cu_in_device >= 2) { + combinations.push_back(Combination::HALF); + combinations.push_back(Combination::ALL_MINUS_ONE); } -} -using urDevicePartitionAffinityDomainTest = - urDevicePartitionTestWithParam; -TEST_P(urDevicePartitionAffinityDomainTest, PartitionByAffinityDomain) { + uint32_t n_cu_across_sub_devices; + for (const auto Combination : combinations) { - for (auto device : devices) { + std::vector property_list; - if (!uur::hasDevicePartitionSupport( - device, UR_DEVICE_PARTITION_BY_AFFINITY_DOMAIN)) { - ::testing::Message() << "Device \'" << device - << "\' does not support partitioning by " - "affinity domain.\n"; - continue; + switch (Combination) { + case Combination::ONE: { + n_cu_across_sub_devices = 1; + property_list.push_back(uur::makePartitionByCountsDesc(1)); + break; + } + case Combination::HALF: { + n_cu_across_sub_devices = (n_cu_in_device / 2) * 2; + property_list.push_back( + uur::makePartitionByCountsDesc(n_cu_in_device / 2)); + property_list.push_back( + uur::makePartitionByCountsDesc(n_cu_in_device / 2)); + break; + } + case Combination::ALL_MINUS_ONE: { + n_cu_across_sub_devices = n_cu_in_device - 1; + property_list.push_back( + uur::makePartitionByCountsDesc(n_cu_in_device - 1)); + break; + } + case Combination::ALL: { + n_cu_across_sub_devices = n_cu_in_device; + property_list.push_back( + uur::makePartitionByCountsDesc(n_cu_in_device)); + break; } - - uint32_t n_compute_units = 0; - ASSERT_NO_FATAL_FAILURE(getNumberComputeUnits(device, n_compute_units)); - - // Skip if the affinity domain is not supported by device - ur_device_affinity_domain_flags_t flag = GetParam(); - ur_device_affinity_domain_flags_t supported_flags{0}; - ASSERT_SUCCESS(uur::GetDevicePartitionAffinityDomainFlags( - device, supported_flags)); - if (!(flag & supported_flags)) { - ::testing::Message() - << static_cast(flag) - << " is not supported by the device: \'" << device << "\'.\n"; - continue; } - - ur_device_partition_property_t prop = - uur::makePartitionByAffinityDomain(flag); ur_device_partition_properties_t properties{ UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, nullptr, - &prop, - 1, + property_list.data(), + property_list.size(), }; // Get the number of devices that will be created uint32_t n_devices = 0; ASSERT_SUCCESS( urDevicePartition(device, &properties, 0, nullptr, &n_devices)); - ASSERT_NE(n_devices, 0); + ASSERT_EQ(n_devices, property_list.size()); std::vector sub_devices(n_devices); ASSERT_SUCCESS(urDevicePartition( device, &properties, static_cast(sub_devices.size()), sub_devices.data(), nullptr)); + uint32_t sum = 0; for (auto sub_device : sub_devices) { ASSERT_NE(sub_device, nullptr); + uint32_t n_cu_in_sub_device; + ASSERT_NO_FATAL_FAILURE( + getNumberComputeUnits(sub_device, n_cu_in_sub_device)); + sum += n_cu_in_sub_device; ASSERT_SUCCESS(urDeviceRelease(sub_device)); } + ASSERT_EQ(n_cu_across_sub_devices, sum); } } -INSTANTIATE_TEST_SUITE_P( - , urDevicePartitionAffinityDomainTest, - ::testing::Values(UR_DEVICE_AFFINITY_DOMAIN_FLAG_NUMA, - UR_DEVICE_AFFINITY_DOMAIN_FLAG_L4_CACHE, - UR_DEVICE_AFFINITY_DOMAIN_FLAG_L3_CACHE, - UR_DEVICE_AFFINITY_DOMAIN_FLAG_L2_CACHE, - UR_DEVICE_AFFINITY_DOMAIN_FLAG_L1_CACHE, - UR_DEVICE_AFFINITY_DOMAIN_FLAG_NEXT_PARTITIONABLE), - [](const ::testing::TestParamInfo - &info) { - std::stringstream ss; - ss << static_cast(info.param); - return ss.str(); - }); - -TEST_F(urDevicePartitionTest, InvalidNullHandleDevice) { +TEST_P(urDevicePartitionTest, InvalidNullHandleDevice) { ur_device_partition_property_t prop = uur::makePartitionEquallyDesc(1); ur_device_partition_properties_t properties{ UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, @@ -235,84 +150,161 @@ TEST_F(urDevicePartitionTest, InvalidNullHandleDevice) { urDevicePartition(nullptr, &properties, 1, &sub_device, nullptr)); } -TEST_F(urDevicePartitionTest, InvalidNullPointerProperties) { - for (auto device : devices) { - ur_device_handle_t sub_device = nullptr; - ASSERT_EQ_RESULT( - UR_RESULT_ERROR_INVALID_NULL_POINTER, - urDevicePartition(device, nullptr, 1, &sub_device, nullptr)); - } +TEST_P(urDevicePartitionTest, InvalidNullPointerProperties) { + ur_device_handle_t sub_device = nullptr; + ASSERT_EQ_RESULT( + UR_RESULT_ERROR_INVALID_NULL_POINTER, + urDevicePartition(device, nullptr, 1, &sub_device, nullptr)); } -TEST_F(urDevicePartitionTest, InvalidNullPointerPropertiesArray) { +TEST_P(urDevicePartitionTest, InvalidNullPointerPropertiesArray) { ur_device_partition_properties_t properties{ UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, nullptr, nullptr, 0, }; - for (auto device : devices) { - ur_device_handle_t sub_device = nullptr; - ASSERT_EQ_RESULT( - UR_RESULT_ERROR_INVALID_NULL_POINTER, - urDevicePartition(device, &properties, 1, &sub_device, nullptr)); - } + ur_device_handle_t sub_device = nullptr; + ASSERT_EQ_RESULT( + UR_RESULT_ERROR_INVALID_NULL_POINTER, + urDevicePartition(device, &properties, 1, &sub_device, nullptr)); } -TEST_F(urDevicePartitionTest, SuccessSubSet) { - for (auto device : devices) { +TEST_P(urDevicePartitionTest, SuccessSubSet) { - if (!uur::hasDevicePartitionSupport(device, - UR_DEVICE_PARTITION_EQUALLY)) { - ::testing::Message() << "Device: \'" << device - << "\' does not support partitioning equally."; - continue; - } + if (!uur::hasDevicePartitionSupport(device, UR_DEVICE_PARTITION_EQUALLY)) { + GTEST_SKIP() << "Device: \'" << device + << "\' does not support partitioning equally."; + } - uint32_t n_compute_units = 0; - ASSERT_NO_FATAL_FAILURE(getNumberComputeUnits(device, n_compute_units)); + uint32_t n_compute_units = 0; + ASSERT_NO_FATAL_FAILURE(getNumberComputeUnits(device, n_compute_units)); - // partition for 1 compute unit per sub-device - ur_device_partition_property_t prop = uur::makePartitionEquallyDesc(1); - ur_device_partition_properties_t properties{ - UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, - nullptr, - &prop, - 1, - }; + // partition for 1 compute unit per sub-device + ur_device_partition_property_t prop = uur::makePartitionEquallyDesc(1); + ur_device_partition_properties_t properties{ + UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, + nullptr, + &prop, + 1, + }; - // Get the number of devices that will be created - uint32_t n_devices = 0; - ASSERT_SUCCESS( - urDevicePartition(device, &properties, 0, nullptr, &n_devices)); - ASSERT_NE(n_devices, 0); + // Get the number of devices that will be created + uint32_t n_devices = 0; + ASSERT_SUCCESS( + urDevicePartition(device, &properties, 0, nullptr, &n_devices)); + ASSERT_NE(n_devices, 0); - // We can request only a subset of these devices from [0, n_devices] - for (size_t subset = 0; subset <= n_devices; ++subset) { - std::vector sub_devices(subset); - ASSERT_SUCCESS(urDevicePartition( - device, &properties, static_cast(sub_devices.size()), - sub_devices.data(), nullptr)); - for (auto sub_device : sub_devices) { - ASSERT_NE(sub_device, nullptr); - ASSERT_SUCCESS(urDeviceRelease(sub_device)); - } + // We can request only a subset of these devices from [0, n_devices] + for (size_t subset = 0; subset <= n_devices; ++subset) { + std::vector sub_devices(subset); + ASSERT_SUCCESS(urDevicePartition( + device, &properties, static_cast(sub_devices.size()), + sub_devices.data(), nullptr)); + for (auto sub_device : sub_devices) { + ASSERT_NE(sub_device, nullptr); + ASSERT_SUCCESS(urDeviceRelease(sub_device)); } } } +using urDevicePartitionAffinityDomainTest = + uur::urDeviceTestWithParam; + +UUR_DEVICE_TEST_SUITE_P( + urDevicePartitionAffinityDomainTest, + ::testing::Values(UR_DEVICE_AFFINITY_DOMAIN_FLAG_NUMA, + UR_DEVICE_AFFINITY_DOMAIN_FLAG_L4_CACHE, + UR_DEVICE_AFFINITY_DOMAIN_FLAG_L3_CACHE, + UR_DEVICE_AFFINITY_DOMAIN_FLAG_L2_CACHE, + UR_DEVICE_AFFINITY_DOMAIN_FLAG_L1_CACHE, + UR_DEVICE_AFFINITY_DOMAIN_FLAG_NEXT_PARTITIONABLE), + uur::deviceTestWithParamPrinter); + +TEST_P(urDevicePartitionAffinityDomainTest, PartitionByAffinityDomain) { + + if (!uur::hasDevicePartitionSupport( + device, UR_DEVICE_PARTITION_BY_AFFINITY_DOMAIN)) { + GTEST_SKIP() + << "Device \'" << device + << "\' does not support partitioning by affinity domain.\n"; + } + + uint32_t n_compute_units = 0; + ASSERT_NO_FATAL_FAILURE(getNumberComputeUnits(device, n_compute_units)); + + // Skip if the affinity domain is not supported by device + ur_device_affinity_domain_flags_t flag = getParam(); + ur_device_affinity_domain_flags_t supported_flags{0}; + ASSERT_SUCCESS( + uur::GetDevicePartitionAffinityDomainFlags(device, supported_flags)); + if (!(flag & supported_flags)) { + GTEST_SKIP() << static_cast(flag) + << " is not supported by the device: \'" << device + << "\'.\n"; + } + + ur_device_partition_property_t prop = + uur::makePartitionByAffinityDomain(flag); + + ur_device_partition_properties_t properties{ + UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, + nullptr, + &prop, + 1, + }; + + // Get the number of devices that will be created + uint32_t n_devices = 0; + ASSERT_SUCCESS( + urDevicePartition(device, &properties, 0, nullptr, &n_devices)); + ASSERT_NE(n_devices, 0); + + std::vector sub_devices(n_devices); + ASSERT_SUCCESS(urDevicePartition(device, &properties, + static_cast(sub_devices.size()), + sub_devices.data(), nullptr)); + + for (auto sub_device : sub_devices) { + ASSERT_NE(sub_device, nullptr); + ASSERT_SUCCESS(urDeviceRelease(sub_device)); + } +} + using urDevicePartitionByCountsTestWithParam = - urDevicePartitionTestWithParam>; -TEST_P(urDevicePartitionByCountsTestWithParam, CountsOrdering) { - ur_device_handle_t device = devices[0]; + uur::urDeviceTestWithParam>; + +std::string +CountPrinter(const ::testing::TestParamInfo< + std::tuple>> &info) { + auto device = std::get<0>(info.param).device; + auto param = std::get<1>(info.param); + std::stringstream ss; + for (size_t i = 0; i < param.size(); ++i) { + if (i > 0) { + ss << "_"; + } + ss << param[i]; + } + return uur::GetPlatformAndDeviceName(device) + "__" + ss.str(); +} + +UUR_DEVICE_TEST_SUITE_P(urDevicePartitionByCountsTestWithParam, + ::testing::Values(std::vector{2, 4}, + std::vector{1, 4}, + std::vector{2, 3}, + std::vector{3, 2}, + std::vector{3, 1}), + CountPrinter); +TEST_P(urDevicePartitionByCountsTestWithParam, CountsOrdering) { if (!uur::hasDevicePartitionSupport(device, UR_DEVICE_PARTITION_BY_COUNTS)) { GTEST_SKIP() << "Device \'" << device << "\' does not support partitioning by counts\n"; } - auto requested_counts = GetParam(); + auto requested_counts = getParam(); std::vector property_list; for (size_t i = 0; i < requested_counts.size(); ++i) { @@ -341,19 +333,3 @@ TEST_P(urDevicePartitionByCountsTestWithParam, CountsOrdering) { ASSERT_EQ(requested_counts, actual_counts); } - -INSTANTIATE_TEST_SUITE_P( - , urDevicePartitionByCountsTestWithParam, - ::testing::Values(std::vector{2, 4}, std::vector{1, 4}, - std::vector{2, 3}, std::vector{3, 2}, - std::vector{3, 1}), - [](const ::testing::TestParamInfo> &info) { - std::stringstream ss; - for (size_t i = 0; i < info.param.size(); ++i) { - if (i > 0) { - ss << "_"; - } - ss << info.param[i]; - } - return ss.str(); - }); diff --git a/test/conformance/device/urDeviceRelease.cpp b/test/conformance/device/urDeviceRelease.cpp index dd5510394f..b2d113f1b9 100644 --- a/test/conformance/device/urDeviceRelease.cpp +++ b/test/conformance/device/urDeviceRelease.cpp @@ -4,65 +4,58 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -struct urDeviceReleaseTest : uur::urAllDevicesTest {}; +struct urDeviceReleaseTest : uur::urDeviceTest {}; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urDeviceReleaseTest); -TEST_F(urDeviceReleaseTest, Success) { - for (auto device : devices) { - ASSERT_SUCCESS(urDeviceRetain(device)); +TEST_P(urDeviceReleaseTest, Success) { + uint32_t prevRefCount = 0; + ASSERT_SUCCESS(uur::GetObjectReferenceCount(device, prevRefCount)); - uint32_t prevRefCount = 0; - ASSERT_SUCCESS(uur::GetObjectReferenceCount(device, prevRefCount)); + EXPECT_SUCCESS(urDeviceRelease(device)); - EXPECT_SUCCESS(urDeviceRelease(device)); + uint32_t refCount = 0; + ASSERT_SUCCESS(uur::GetObjectReferenceCount(device, refCount)); - uint32_t refCount = 0; - ASSERT_SUCCESS(uur::GetObjectReferenceCount(device, refCount)); - - /* If device is a root level device, the device reference counts should + /* If device is a root level device, the device reference counts should * remain unchanged */ - ASSERT_EQ(prevRefCount, refCount); - } + ASSERT_EQ(prevRefCount, refCount); } -TEST_F(urDeviceReleaseTest, SuccessSubdevices) { - for (auto device : devices) { - if (!uur::hasDevicePartitionSupport(device, - UR_DEVICE_PARTITION_EQUALLY)) { - ::testing::Message() << "Device: \'" << device - << "\' does not support partitioning equally."; - continue; - } +TEST_P(urDeviceReleaseTest, SuccessSubdevices) { + if (!uur::hasDevicePartitionSupport(device, UR_DEVICE_PARTITION_EQUALLY)) { + GTEST_SKIP() << "Device: \'" << device + << "\' does not support partitioning equally."; + } - ur_device_partition_property_t prop = uur::makePartitionEquallyDesc(1); + ur_device_partition_property_t prop = uur::makePartitionEquallyDesc(1); - ur_device_partition_properties_t properties{ - UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, - nullptr, - &prop, - 1, - }; + ur_device_partition_properties_t properties{ + UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, + nullptr, + &prop, + 1, + }; - ur_device_handle_t sub_device = nullptr; - ASSERT_SUCCESS( - urDevicePartition(device, &properties, 1, &sub_device, nullptr)); + ur_device_handle_t sub_device = nullptr; + ASSERT_SUCCESS( + urDevicePartition(device, &properties, 1, &sub_device, nullptr)); - ASSERT_SUCCESS(urDeviceRetain(sub_device)); + ASSERT_SUCCESS(urDeviceRetain(sub_device)); - uint32_t prevRefCount = 0; - ASSERT_SUCCESS(uur::GetObjectReferenceCount(sub_device, prevRefCount)); + uint32_t prevRefCount = 0; + ASSERT_SUCCESS(uur::GetObjectReferenceCount(sub_device, prevRefCount)); - EXPECT_SUCCESS(urDeviceRelease(sub_device)); + EXPECT_SUCCESS(urDeviceRelease(sub_device)); - uint32_t refCount = 0; - ASSERT_SUCCESS(uur::GetObjectReferenceCount(sub_device, refCount)); + uint32_t refCount = 0; + ASSERT_SUCCESS(uur::GetObjectReferenceCount(sub_device, refCount)); - ASSERT_GT(prevRefCount, refCount); + ASSERT_GT(prevRefCount, refCount); - EXPECT_SUCCESS(urDeviceRelease(sub_device)); - } + EXPECT_SUCCESS(urDeviceRelease(sub_device)); } -TEST_F(urDeviceReleaseTest, InvalidNullHandle) { +TEST_P(urDeviceReleaseTest, InvalidNullHandle) { ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, urDeviceRelease(nullptr)); } diff --git a/test/conformance/device/urDeviceRetain.cpp b/test/conformance/device/urDeviceRetain.cpp index 6651bd26b3..901fee082d 100644 --- a/test/conformance/device/urDeviceRetain.cpp +++ b/test/conformance/device/urDeviceRetain.cpp @@ -5,61 +5,56 @@ #include -using urDeviceRetainTest = uur::urAllDevicesTest; +using urDeviceRetainTest = uur::urDeviceTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urDeviceRetainTest); -TEST_F(urDeviceRetainTest, Success) { - for (auto device : devices) { - uint32_t prevRefCount = 0; - ASSERT_SUCCESS(uur::GetObjectReferenceCount(device, prevRefCount)); +TEST_P(urDeviceRetainTest, Success) { + uint32_t prevRefCount = 0; + ASSERT_SUCCESS(uur::GetObjectReferenceCount(device, prevRefCount)); - ASSERT_SUCCESS(urDeviceRetain(device)); + ASSERT_SUCCESS(urDeviceRetain(device)); - uint32_t refCount = 0; - ASSERT_SUCCESS(uur::GetObjectReferenceCount(device, refCount)); + uint32_t refCount = 0; + ASSERT_SUCCESS(uur::GetObjectReferenceCount(device, refCount)); - /* If device is a root level device, the device reference counts should + /* If device is a root level device, the device reference counts should * remain unchanged */ - ASSERT_EQ(prevRefCount, refCount); - } + ASSERT_EQ(prevRefCount, refCount); } -TEST_F(urDeviceRetainTest, SuccessSubdevices) { - for (auto device : devices) { - if (!uur::hasDevicePartitionSupport(device, - UR_DEVICE_PARTITION_EQUALLY)) { - ::testing::Message() << "Device: \'" << device - << "\' does not support partitioning equally."; - continue; - } +TEST_P(urDeviceRetainTest, SuccessSubdevices) { + if (!uur::hasDevicePartitionSupport(device, UR_DEVICE_PARTITION_EQUALLY)) { + GTEST_SKIP() << "Device: \'" << device + << "\' does not support partitioning equally."; + } - ur_device_partition_property_t prop = uur::makePartitionEquallyDesc(1); - ur_device_partition_properties_t properties{ - UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, - nullptr, - &prop, - 1, - }; + ur_device_partition_property_t prop = uur::makePartitionEquallyDesc(1); + ur_device_partition_properties_t properties{ + UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, + nullptr, + &prop, + 1, + }; - ur_device_handle_t sub_device = nullptr; - ASSERT_SUCCESS( - urDevicePartition(device, &properties, 1, &sub_device, nullptr)); + ur_device_handle_t sub_device = nullptr; + ASSERT_SUCCESS( + urDevicePartition(device, &properties, 1, &sub_device, nullptr)); - uint32_t prevRefCount = 0; - ASSERT_SUCCESS(uur::GetObjectReferenceCount(sub_device, prevRefCount)); + uint32_t prevRefCount = 0; + ASSERT_SUCCESS(uur::GetObjectReferenceCount(sub_device, prevRefCount)); - ASSERT_SUCCESS(urDeviceRetain(sub_device)); + ASSERT_SUCCESS(urDeviceRetain(sub_device)); - uint32_t refCount = 0; - ASSERT_SUCCESS(uur::GetObjectReferenceCount(sub_device, refCount)); + uint32_t refCount = 0; + ASSERT_SUCCESS(uur::GetObjectReferenceCount(sub_device, refCount)); - ASSERT_LT(prevRefCount, refCount); + ASSERT_LT(prevRefCount, refCount); - EXPECT_SUCCESS(urDeviceRelease(sub_device)); - EXPECT_SUCCESS(urDeviceRelease(sub_device)); - } + EXPECT_SUCCESS(urDeviceRelease(sub_device)); + EXPECT_SUCCESS(urDeviceRelease(sub_device)); } -TEST_F(urDeviceRetainTest, InvalidNullHandle) { +TEST_P(urDeviceRetainTest, InvalidNullHandle) { ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, urDeviceRetain(nullptr)); } diff --git a/test/conformance/device/urDeviceSelectBinary.cpp b/test/conformance/device/urDeviceSelectBinary.cpp index 44d32e3c6d..7776a15357 100644 --- a/test/conformance/device/urDeviceSelectBinary.cpp +++ b/test/conformance/device/urDeviceSelectBinary.cpp @@ -3,7 +3,10 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -using urDeviceSelectBinaryTest = uur::urAllDevicesTest; +#include + +using urDeviceSelectBinaryTest = uur::urDeviceTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urDeviceSelectBinaryTest); static constexpr ur_device_binary_t binaries[] = { {UR_STRUCTURE_TYPE_DEVICE_BINARY, nullptr, UR_DEVICE_BINARY_TARGET_UNKNOWN}, @@ -20,43 +23,37 @@ static constexpr ur_device_binary_t binaries[] = { static constexpr uint32_t binaries_length = sizeof(binaries) / sizeof(ur_device_binary_t); -TEST_F(urDeviceSelectBinaryTest, Success) { - for (auto device : devices) { - uint32_t selected_binary = binaries_length; // invalid index - ASSERT_SUCCESS(urDeviceSelectBinary(device, binaries, binaries_length, - &selected_binary)); - ASSERT_LT(selected_binary, binaries_length); - } +TEST_P(urDeviceSelectBinaryTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + + uint32_t selected_binary = binaries_length; // invalid index + ASSERT_SUCCESS(urDeviceSelectBinary(device, binaries, binaries_length, + &selected_binary)); + ASSERT_LT(selected_binary, binaries_length); } -TEST_F(urDeviceSelectBinaryTest, InvalidNullHandleDevice) { +TEST_P(urDeviceSelectBinaryTest, InvalidNullHandleDevice) { ASSERT_EQ_RESULT( UR_RESULT_ERROR_INVALID_NULL_HANDLE, urDeviceSelectBinary(nullptr, binaries, binaries_length, nullptr)); } -TEST_F(urDeviceSelectBinaryTest, InvalidNullPointerBinaries) { - for (auto device : devices) { - uint32_t selected_binary; - ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, - urDeviceSelectBinary(device, nullptr, binaries_length, - &selected_binary)); - } +TEST_P(urDeviceSelectBinaryTest, InvalidNullPointerBinaries) { + uint32_t selected_binary; + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, + urDeviceSelectBinary(device, nullptr, binaries_length, + &selected_binary)); } -TEST_F(urDeviceSelectBinaryTest, InvalidNullPointerSelectedBinary) { - for (auto device : devices) { - ASSERT_EQ_RESULT( - UR_RESULT_ERROR_INVALID_NULL_POINTER, - urDeviceSelectBinary(device, binaries, binaries_length, nullptr)); - } +TEST_P(urDeviceSelectBinaryTest, InvalidNullPointerSelectedBinary) { + ASSERT_EQ_RESULT( + UR_RESULT_ERROR_INVALID_NULL_POINTER, + urDeviceSelectBinary(device, binaries, binaries_length, nullptr)); } -TEST_F(urDeviceSelectBinaryTest, InvalidValueNumBinaries) { - for (auto device : devices) { - uint32_t selected_binary; - ASSERT_EQ_RESULT( - UR_RESULT_ERROR_INVALID_SIZE, - urDeviceSelectBinary(device, binaries, 0, &selected_binary)); - } +TEST_P(urDeviceSelectBinaryTest, InvalidValueNumBinaries) { + uint32_t selected_binary; + ASSERT_EQ_RESULT( + UR_RESULT_ERROR_INVALID_SIZE, + urDeviceSelectBinary(device, binaries, 0, &selected_binary)); } diff --git a/test/conformance/enqueue/enqueue_adapter_cuda.match b/test/conformance/enqueue/enqueue_adapter_cuda.match deleted file mode 100644 index 8aa9600f5e..0000000000 --- a/test/conformance/enqueue/enqueue_adapter_cuda.match +++ /dev/null @@ -1,10 +0,0 @@ -urEnqueueKernelLaunchTest.InvalidKernelArgs/* -urEnqueueKernelLaunchKernelWgSizeTest.NonMatchingLocalSize/* -urEnqueueKernelLaunchKernelSubGroupTest.Success/* -urEnqueueMemBufferMapTestWithWriteFlagParam.SuccessWrite/*__UR_MAP_FLAG_WRITE_INVALIDATE_REGION -urEnqueueUSMAdviseWithParamTest.Success/*__UR_USM_ADVICE_FLAG_DEFAULT -urEnqueueUSMAdviseTest.MultipleParamsSuccess/* -urEnqueueUSMPrefetchWithParamTest.Success/*__UR_USM_MIGRATION_FLAG_DEFAULT -urEnqueueUSMPrefetchWithParamTest.CheckWaitEvent/*__UR_USM_MIGRATION_FLAG_DEFAULT -urEnqueueTimestampRecordingExpTest.Success/* -urEnqueueTimestampRecordingExpTest.SuccessBlocking/* diff --git a/test/conformance/enqueue/enqueue_adapter_hip.match b/test/conformance/enqueue/enqueue_adapter_hip.match deleted file mode 100644 index c59d228ca8..0000000000 --- a/test/conformance/enqueue/enqueue_adapter_hip.match +++ /dev/null @@ -1,21 +0,0 @@ -# HIP can't check kernel arguments -urEnqueueKernelLaunchTest.InvalidKernelArgs/* -urEnqueueKernelLaunchKernelWgSizeTest.NonMatchingLocalSize/* -urEnqueueKernelLaunchKernelSubGroupTest.Success/* -urEnqueueKernelLaunchUSMLinkedList.Success/*__UsePoolEnabled -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_row_2D -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_3d_2d -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_row_2D -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_3d_2d - -# HIP doesn't ignore unsupported USM advice or prefetching. Instead of -# returning UR_RESULT_SUCCESS as per the spec, it instead returns -# UR_RESULT_ERROR_ADAPTER_SPECIFIC to issue a warning. These tests will fail -# until this is rectified. -urEnqueueUSMAdviseWithParamTest.Success/*__UR_USM_ADVICE_FLAG_DEFAULT -urEnqueueUSMAdviseTest.MultipleParamsSuccess/* -urEnqueueUSMPrefetchWithParamTest.Success/*__UR_USM_MIGRATION_FLAG_DEFAULT -urEnqueueUSMPrefetchWithParamTest.CheckWaitEvent/*__UR_USM_MIGRATION_FLAG_DEFAULT - -urEnqueueTimestampRecordingExpTest.Success/* -urEnqueueTimestampRecordingExpTest.SuccessBlocking/* diff --git a/test/conformance/enqueue/enqueue_adapter_level_zero.match b/test/conformance/enqueue/enqueue_adapter_level_zero.match deleted file mode 100644 index 286cafc7fa..0000000000 --- a/test/conformance/enqueue/enqueue_adapter_level_zero.match +++ /dev/null @@ -1,60 +0,0 @@ -{{OPT}}urEnqueueEventsWaitTest.Success/* -{{OPT}}urEnqueueKernelLaunchTest.InvalidKernelArgs/* -{{OPT}}urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest.Success/UseEventsNoQueuePerThread -{{OPT}}urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest.Success/NoUseEventsNoQueuePerThread -{{OPT}}urEnqueueKernelLaunchKernelWgSizeTest.Success/* -{{OPT}}urEnqueueKernelLaunchKernelSubGroupTest.Success/* -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_2d_3d -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_3d_2d -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_non_zero_offsets_2D -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_different_buffer_sizes_2D -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_column_2D -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_3d_with_offsets -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_2d_3d -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_3d_2d -{{OPT}}urEnqueueMemBufferMapMultiDeviceTest.* -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_3d_with_offsets -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_2d_3d -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_3d_2d -{{OPT}}urEnqueueMemImageCopyTest.InvalidSize/* -{{OPT}}urEnqueueMemImageReadTest.InvalidOrigin1D/* -{{OPT}}urEnqueueMemImageReadTest.InvalidOrigin2D/* -{{OPT}}urEnqueueMemImageReadTest.InvalidOrigin3D/* -{{OPT}}urEnqueueEventsWaitMultiDeviceMTTest* -{{OPT}}urEnqueueEventsWaitWithBarrierOrderingTest.SuccessEventDependencies/* -{{OPT}}urEnqueueEventsWaitWithBarrierOrderingTest.SuccessEventDependenciesBarrierOnly/* -{{OPT}}urEnqueueEventsWaitWithBarrierOrderingTest.SuccessEventDependenciesLaunchOnly/* -{{OPT}}urEnqueueEventsWaitWithBarrierOrderingTest.SuccessNonEventDependencies/* -{{OPT}}urEnqueueEventsWaitWithBarrierTest.Success/* -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/* -{{OPT}}urEnqueueMemBufferCopyTestWithParam.Success/* -{{OPT}}urEnqueueMemBufferFillTest.Success/* -{{OPT}}urEnqueueMemBufferFillTest.SuccessOffset/* -{{OPT}}urEnqueueMemBufferFillTest.SuccessPartialFill/* -{{OPT}}urEnqueueMemBufferMapTestWithParam.SuccesPinnedWrite/* -{{OPT}}urEnqueueMemBufferMapTestWithParam.SuccessMultiMaps/* -{{OPT}}urEnqueueMemBufferMapTestWithParam.SuccessRead/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___Intel_R__Data_Center_GPU_Max* -{{OPT}}urEnqueueMemBufferMapTestWithParam.SuccessOffset/* -{{OPT}}urEnqueueMemBufferMapTestWithParam.SuccessPartialMap/* -{{OPT}}urEnqueueMemBufferMapTestWithWriteFlagParam.SuccessWrite/* -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/* -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/* -{{OPT}}urEnqueueMemImageCopyTest.Success/* -{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopy/* -{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopyWithDstOffset/* -{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopyWithSrcOffset/* -{{OPT}}urEnqueueMemImageReadTest.InvalidRegion1D/* -{{OPT}}urEnqueueMemImageReadTest.InvalidRegion2D/* -{{OPT}}urEnqueueMemImageReadTest.InvalidRegion3D/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidOrigin1D/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidOrigin2D/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidOrigin3D/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidRegion1D/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidRegion2D/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidRegion3D/* -{{OPT}}urEnqueueKernelLaunchMultiDeviceTest.KernelLaunchReadDifferentQueues/* -urEnqueueUSMAdviseTest.InvalidSizeTooLarge/* -{{OPT}}urEnqueueUSMMemcpyTest.Blocking/* -{{OPT}}urEnqueueUSMMemcpyTest.BlockingWithEvent/* -{{OPT}}urEnqueueUSMMemcpyTest.WaitForDependencies/* -urEnqueueUSMPrefetchTest.InvalidSizeTooLarge/* diff --git a/test/conformance/enqueue/enqueue_adapter_level_zero_v2.match b/test/conformance/enqueue/enqueue_adapter_level_zero_v2.match deleted file mode 100644 index 58a6ec4116..0000000000 --- a/test/conformance/enqueue/enqueue_adapter_level_zero_v2.match +++ /dev/null @@ -1,73 +0,0 @@ -urEnqueueKernelLaunchTest.InvalidKernelArgs/* -urEnqueueKernelLaunchKernelWgSizeTest.Success/* -{{OPT}}urEnqueueKernelLaunchIncrementTest.Success/*__UseEventsEnabled -{{OPT}}urEnqueueKernelLaunchIncrementTest.Success/*__UseEventsDisabled -{{OPT}}urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest.Success/UseEventsNoQueuePerThread -{{OPT}}urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest.Success/NoUseEventsNoQueuePerThread -{{OPT}}urEnqueueKernelLaunchKernelSubGroupTest.Success/* -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_whole_buffer_2D -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_non_zero_offsets_2D -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_different_buffer_sizes_2D -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_column_2D -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_row_2D -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_3d -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_3d_with_offsets -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_2d_3d -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_3d_2d -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_whole_buffer_2D -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_non_zero_offsets_2D -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_different_buffer_sizes_2D -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_column_2D -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_row_2D -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_3d -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_3d_with_offsets -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_2d_3d -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_3d_2d -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_whole_buffer_2D -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_non_zero_offsets_2D -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_different_buffer_sizes_2D -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_column_2D -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_row_2D -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_3d -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_3d_with_offsets -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_2d_3d -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_3d_2d -{{OPT}}urEnqueueMemImageCopyTest.Success/* -{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopy/* -{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopyWithSrcOffset/* -{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopyWithDstOffset/* -{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleQueue/* -{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleImageSrc/* -{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleImageDst/* -{{OPT}}urEnqueueMemImageCopyTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemImageCopyTest.InvalidSize/* -{{OPT}}urEnqueueMemImageReadTest.Success1D/* -{{OPT}}urEnqueueMemImageReadTest.Success2D/* -{{OPT}}urEnqueueMemImageReadTest.Success3D/* -{{OPT}}urEnqueueMemImageReadTest.InvalidNullHandleQueue/* -{{OPT}}urEnqueueMemImageReadTest.InvalidNullHandleImage/* -{{OPT}}urEnqueueMemImageReadTest.InvalidNullPointerDst/* -{{OPT}}urEnqueueMemImageReadTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemImageReadTest.InvalidOrigin1D/* -{{OPT}}urEnqueueMemImageReadTest.InvalidOrigin2D/* -{{OPT}}urEnqueueMemImageReadTest.InvalidOrigin3D/* -{{OPT}}urEnqueueMemImageReadTest.InvalidRegion1D/* -{{OPT}}urEnqueueMemImageReadTest.InvalidRegion2D/* -{{OPT}}urEnqueueMemImageReadTest.InvalidRegion3D/* -{{OPT}}urEnqueueMemImageWriteTest.Success1D/* -{{OPT}}urEnqueueMemImageWriteTest.Success2D/* -{{OPT}}urEnqueueMemImageWriteTest.Success3D/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidNullHandleQueue/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidNullHandleImage/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidNullPointerSrc/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidOrigin1D/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidOrigin2D/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidOrigin3D/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidRegion1D/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidRegion2D/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidRegion3D/* -{{OPT}}urEnqueueKernelLaunchMultiDeviceTest.KernelLaunchReadDifferentQueues/* -urEnqueueUSMAdviseTest.InvalidSizeTooLarge/* -urEnqueueUSMPrefetchTest.InvalidSizeTooLarge/* -{{OPT}}urEnqueueTimestampRecordingExpTest.SuccessBlocking/* diff --git a/test/conformance/enqueue/enqueue_adapter_native_cpu.match b/test/conformance/enqueue/enqueue_adapter_native_cpu.match deleted file mode 100644 index 35b9df84de..0000000000 --- a/test/conformance/enqueue/enqueue_adapter_native_cpu.match +++ /dev/null @@ -1,146 +0,0 @@ -{{OPT}}urEnqueueEventsWaitMultiDeviceTest.EmptyWaitList -{{OPT}}urEnqueueEventsWaitMultiDeviceTest.EmptyWaitListWithEvent -{{OPT}}urEnqueueEventsWaitMultiDeviceTest.EnqueueWaitOnADifferentQueue -{{OPT}}urEnqueueDeviceGetGlobalVariableReadTest.Success/* -{{OPT}}urEnqueueDeviceGetGlobalVariableReadTest.InvalidNullHandleQueue/* -{{OPT}}urEnqueueDeviceGetGlobalVariableReadTest.InvalidNullHandleProgram/* -{{OPT}}urEnqueueDeviceGetGlobalVariableReadTest.InvalidNullPointerName/* -{{OPT}}urEnqueueDeviceGetGlobalVariableReadTest.InvalidNullPointerDst/* -{{OPT}}urEnqueueDeviceGetGlobalVariableReadTest.InvalidEventWaitListNullEvents/* -{{OPT}}urEnqueueDeviceGetGlobalVariableReadTest.InvalidEventWaitListZeroSize/* -{{OPT}}urEnqueueDeviceGetGlobalVariableReadTest.InvalidEventWaitInvalidEvent/* -{{OPT}}urEnqueueDeviceGetGlobalVariableWriteTest.InvalidNullHandleQueue/* -{{OPT}}urEnqueueDeviceGetGlobalVariableWriteTest.InvalidNullHandleProgram/* -{{OPT}}urEnqueueDeviceGetGlobalVariableWriteTest.InvalidNullPointerName/* -{{OPT}}urEnqueueDeviceGetGlobalVariableWriteTest.InvalidNullPointerSrc/* -{{OPT}}urEnqueueDeviceGetGlobalVariableWriteTest.InvalidEventWaitListNullEvents/* -{{OPT}}urEnqueueDeviceGetGlobalVariableWriteTest.InvalidEventWaitListZeroSize/* -{{OPT}}urEnqueueDeviceGetGlobalVariableWriteTest.InvalidEventWaitInvalidEvent/* -{{OPT}}urEnqueueEventsWaitTest.Success/* -{{OPT}}urEnqueueEventsWaitTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueEventsWaitMultiDeviceMTTest.EnqueueWaitSingleQueueMultiOps/MultiThread -{{OPT}}urEnqueueEventsWaitMultiDeviceMTTest.EnqueueWaitSingleQueueMultiOps/NoMultiThread -{{OPT}}urEnqueueEventsWaitMultiDeviceMTTest.EnqueueWaitOnAllQueues/MultiThread -{{OPT}}urEnqueueEventsWaitMultiDeviceMTTest.EnqueueWaitOnAllQueues/NoMultiThread -{{OPT}}urEnqueueEventsWaitMultiDeviceMTTest.EnqueueWaitOnAllQueuesCommonDependency/MultiThread -{{OPT}}urEnqueueEventsWaitMultiDeviceMTTest.EnqueueWaitOnAllQueuesCommonDependency/NoMultiThread -{{OPT}}urEnqueueEventsWaitWithBarrierTest.Success/* -{{OPT}}urEnqueueEventsWaitWithBarrierTest.InvalidNullPtrEventWaitList/* -urEnqueueEventsWaitWithBarrierOrderingTest.SuccessEventDependenciesBarrierOnly/*_ -urEnqueueEventsWaitWithBarrierOrderingTest.SuccessEventDependenciesLaunchOnly/*_ -urEnqueueEventsWaitWithBarrierOrderingTest.SuccessEventDependencies/*_ -urEnqueueEventsWaitWithBarrierOrderingTest.SuccessNonEventDependencies/*_ -{{OPT}}urEnqueueKernelLaunchTest.Success/* -{{OPT}}urEnqueueKernelLaunchTest.InvalidNullHandleQueue/* -{{OPT}}urEnqueueKernelLaunchTest.InvalidNullHandleKernel/* -{{OPT}}urEnqueueKernelLaunchTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueKernelLaunchTest.InvalidWorkDimension/* -{{OPT}}urEnqueueKernelLaunchTest.InvalidWorkGroupSize/* -{{OPT}}urEnqueueKernelLaunchTest.InvalidKernelArgs/* -{{OPT}}urEnqueueKernelLaunchKernelWgSizeTest.Success/* -{{OPT}}urEnqueueKernelLaunchKernelWgSizeTest.SuccessWithExplicitLocalSize/* -{{OPT}}urEnqueueKernelLaunchKernelWgSizeTest.NonMatchingLocalSize/* -{{OPT}}urEnqueueKernelLaunchKernelSubGroupTest.Success/* -{{OPT}}urEnqueueKernelLaunchKernelStandardTest.Success/* -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__1D_1 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__1D_31 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__1D_1027 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__1D_32 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__1D_256 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__2D_1_1 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__2D_31_7 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__2D_1027_1 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__2D_1_32 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__2D_256_79 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__3D_1_1_1 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__3D_31_7_1 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__3D_1027_1_19 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__3D_1_53_19 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__3D_256_79_8 -{{OPT}}urEnqueueKernelLaunchWithVirtualMemory.Success/* -{{OPT}}urEnqueueKernelLaunchWithUSM.Success/* -{{OPT}}urEnqueueKernelLaunchMultiDeviceTest.KernelLaunchReadDifferentQueues/* -{{OPT}}urEnqueueKernelLaunchUSMLinkedList.Success/*__UsePoolEnabled -{{OPT}}urEnqueueKernelLaunchUSMLinkedList.Success/*__UsePoolDisabled -{{OPT}}urEnqueueMemBufferCopyRectTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemBufferCopyRectTest.InvalidSize/* -{{OPT}}urEnqueueMemBufferCopyTestWithParam.InvalidNullPtrEventWaitList/*__1024 -{{OPT}}urEnqueueMemBufferCopyTestWithParam.InvalidNullPtrEventWaitList/*__2500 -{{OPT}}urEnqueueMemBufferCopyTestWithParam.InvalidNullPtrEventWaitList/*__4096 -{{OPT}}urEnqueueMemBufferCopyTestWithParam.InvalidNullPtrEventWaitList/*__6000 -{{OPT}}urEnqueueMemBufferCopyTestWithParam.InvalidSize/*__1024 -{{OPT}}urEnqueueMemBufferCopyTestWithParam.InvalidSize/*__2500 -{{OPT}}urEnqueueMemBufferCopyTestWithParam.InvalidSize/*__4096 -{{OPT}}urEnqueueMemBufferCopyTestWithParam.InvalidSize/*__6000 -{{OPT}}urEnqueueMemBufferFillNegativeTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemBufferMapTestWithParam.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemBufferMapTestWithParam.InvalidSize/* -{{OPT}}urEnqueueMemBufferReadTestWithParam.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemBufferReadTestWithParam.InvalidSize/* -{{OPT}}urEnqueueMemBufferReadRectTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemBufferReadRectTest.InvalidSize/* -{{OPT}}urEnqueueMemBufferWriteTestWithParam.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemBufferWriteTestWithParam.InvalidSize/* -{{OPT}}urEnqueueMemBufferWriteRectTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemBufferWriteRectTest.InvalidSize/* -{{OPT}}urEnqueueMemImageCopyTest.Success/* -{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopy/* -{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopyWithSrcOffset/* -{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopyWithDstOffset/* -{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleQueue/* -{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleImageSrc/* -{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleImageDst/* -{{OPT}}urEnqueueMemImageCopyTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemImageCopyTest.InvalidSize/* -{{OPT}}urEnqueueMemUnmapTestWithParam.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueUSMFillTestWithParam.Success/* -{{OPT}}urEnqueueUSMFillNegativeTest.InvalidNullQueueHandle/* -{{OPT}}urEnqueueUSMFillNegativeTest.InvalidNullPtr/* -{{OPT}}urEnqueueUSMFillNegativeTest.InvalidSize/* -{{OPT}}urEnqueueUSMFillNegativeTest.OutOfBounds/* -{{OPT}}urEnqueueUSMFillNegativeTest.invalidPatternSize/* -{{OPT}}urEnqueueUSMFillNegativeTest.InvalidEventWaitList/* -{{OPT}}urEnqueueUSMFill2DNegativeTest.InvalidNullQueueHandle/* -{{OPT}}urEnqueueUSMFill2DNegativeTest.InvalidNullPtr/* -{{OPT}}urEnqueueUSMFill2DNegativeTest.InvalidPitch/* -{{OPT}}urEnqueueUSMFill2DNegativeTest.InvalidWidth/* -{{OPT}}urEnqueueUSMFill2DNegativeTest.InvalidHeight/* -{{OPT}}urEnqueueUSMFill2DNegativeTest.InvalidSize/* -{{OPT}}urEnqueueUSMFill2DNegativeTest.OutOfBounds/* -{{OPT}}urEnqueueUSMFill2DNegativeTest.invalidPatternSize/* -{{OPT}}urEnqueueUSMFill2DNegativeTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueUSMAdviseWithParamTest.Success/*__UR_USM_ADVICE_FLAG_DEFAULT -{{OPT}}urEnqueueUSMAdviseTest.MultipleParamsSuccess/* -{{OPT}}urEnqueueUSMAdviseTest.InvalidNullHandleQueue/* -{{OPT}}urEnqueueUSMAdviseTest.InvalidNullPointerMem/* -{{OPT}}urEnqueueUSMAdviseTest.InvalidEnumeration/* -{{OPT}}urEnqueueUSMAdviseTest.InvalidSizeZero/* -{{OPT}}urEnqueueUSMAdviseTest.InvalidSizeTooLarge/* -{{OPT}}urEnqueueUSMAdviseTest.NonCoherentDeviceMemorySuccessOrWarning/* -{{OPT}}urEnqueueUSMMemcpyTest.Blocking/* -{{OPT}}urEnqueueUSMMemcpyTest.BlockingWithEvent/* -{{OPT}}urEnqueueUSMMemcpyTest.NonBlocking/* -{{OPT}}urEnqueueUSMMemcpyTest.WaitForDependencies/* -{{OPT}}urEnqueueUSMMemcpyTest.InvalidNullQueueHandle/* -{{OPT}}urEnqueueUSMMemcpyTest.InvalidNullDst/* -{{OPT}}urEnqueueUSMMemcpyTest.InvalidNullSrc/* -{{OPT}}urEnqueueUSMMemcpyTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueUSMMemcpy2DTestWithParam.SuccessBlocking/* -{{OPT}}urEnqueueUSMMemcpy2DTestWithParam.SuccessNonBlocking/* -{{OPT}}urEnqueueUSMMemcpy2DNegativeTest.InvalidNullHandleQueue/*__pitch__1__width__1__height__1__src__UR_USM_TYPE_DEVICE__dst__UR_USM_TYPE_DEVICE -{{OPT}}urEnqueueUSMMemcpy2DNegativeTest.InvalidNullPointer/*__pitch__1__width__1__height__1__src__UR_USM_TYPE_DEVICE__dst__UR_USM_TYPE_DEVICE -{{OPT}}urEnqueueUSMMemcpy2DNegativeTest.InvalidSize/*__pitch__1__width__1__height__1__src__UR_USM_TYPE_DEVICE__dst__UR_USM_TYPE_DEVICE -{{OPT}}urEnqueueUSMMemcpy2DNegativeTest.InvalidEventWaitList/*__pitch__1__width__1__height__1__src__UR_USM_TYPE_DEVICE__dst__UR_USM_TYPE_DEVICE -{{OPT}}urEnqueueUSMPrefetchWithParamTest.Success/*__UR_USM_MIGRATION_FLAG_DEFAULT -{{OPT}}urEnqueueUSMPrefetchWithParamTest.CheckWaitEvent/*__UR_USM_MIGRATION_FLAG_DEFAULT -{{OPT}}urEnqueueUSMPrefetchTest.InvalidNullHandleQueue/* -{{OPT}}urEnqueueUSMPrefetchTest.InvalidNullPointerMem/* -{{OPT}}urEnqueueUSMPrefetchTest.InvalidEnumeration/* -{{OPT}}urEnqueueUSMPrefetchTest.InvalidSizeZero/* -{{OPT}}urEnqueueUSMPrefetchTest.InvalidSizeTooLarge/* -{{OPT}}urEnqueueUSMPrefetchTest.InvalidEventWaitList/* -urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest.Success/* -urEnqueueKernelLaunchIncrementMultiDeviceTest.Success/* -urEnqueueKernelLaunchIncrementTest.Success/* -# This one is flakey -{{OPT}}urEnqueueMemBufferReadTestWithParam.NonBlocking/* diff --git a/test/conformance/enqueue/enqueue_adapter_opencl.match b/test/conformance/enqueue/enqueue_adapter_opencl.match deleted file mode 100644 index 7f0e36cd6c..0000000000 --- a/test/conformance/enqueue/enqueue_adapter_opencl.match +++ /dev/null @@ -1,3 +0,0 @@ -# Note: This file is only for use with cts_exe.py -# Fails when -fsanitize=cfi -{{OPT}}urEnqueueEventsWaitMultiDeviceMTTest.EnqueueWaitOnAllQueues/MultiThread diff --git a/test/conformance/enqueue/helpers.h b/test/conformance/enqueue/helpers.h index 2cdf383586..042f36adeb 100644 --- a/test/conformance/enqueue/helpers.h +++ b/test/conformance/enqueue/helpers.h @@ -28,7 +28,7 @@ template inline std::string printRectTestString(const testing::TestParamInfo &info) { // ParamType will be std::tuple - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = GetPlatformAndDeviceName(device_handle); const auto &test_name = std::get<1>(info.param).name; return platform_device_name + "__" + test_name; @@ -69,7 +69,7 @@ struct TestParameters2D { template inline std::string print2DTestString(const testing::TestParamInfo &info) { - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); std::stringstream test_name; @@ -117,7 +117,7 @@ template inline std::string printMemBufferTestString( const testing::TestParamInfo &info) { // ParamType will be std::tuple - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = GetPlatformAndDeviceName(device_handle); std::stringstream ss; @@ -132,7 +132,7 @@ template inline std::string printMemBufferMapWriteTestString( const testing::TestParamInfo &info) { // ParamType will be std::tuple - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = GetPlatformAndDeviceName(device_handle); std::stringstream ss; @@ -144,7 +144,7 @@ inline std::string printMemBufferMapWriteTestString( template inline std::string printFillTestString(const testing::TestParamInfo &info) { - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); std::stringstream test_name; @@ -154,10 +154,20 @@ printFillTestString(const testing::TestParamInfo &info) { return test_name.str(); } -struct urMultiQueueMultiDeviceTest : uur::urMultiDeviceContextTestTemplate<1> { - void initQueues(std::vector srcDevices, - size_t numDuplicate) { - for (size_t i = 0; i < numDuplicate; i++) { +// Similar to urMultiDeviceContextTestWithParam this fixture allows a min +// device count to be specified, but in this case we duplicate existing +// devices to reach the min device count rather than skipping if it isn't met. +template +struct urMultiQueueMultiDeviceTest : uur::urAllDevicesTest { + void SetUp() override { + UUR_RETURN_ON_FATAL_FAILURE(uur::urAllDevicesTest::SetUp()); + + ASSERT_SUCCESS( + urContextCreate(devices.size(), devices.data(), nullptr, &context)); + + // Duplicate our devices until we hit the minimum size specified. + auto srcDevices = devices; + while (devices.size() < minDevices) { devices.insert(devices.end(), srcDevices.begin(), srcDevices.end()); } @@ -168,19 +178,38 @@ struct urMultiQueueMultiDeviceTest : uur::urMultiDeviceContextTestTemplate<1> { } } - // Default implementation that uses all available devices - void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE( - uur::urMultiDeviceContextTestTemplate<1>::SetUp()); - initQueues(uur::KernelsEnvironment::instance->devices, 1); + void TearDown() override { + for (auto &queue : queues) { + EXPECT_SUCCESS(urQueueRelease(queue)); + } + UUR_RETURN_ON_FATAL_FAILURE(uur::urAllDevicesTest::TearDown()); } - // Specialized implementation that duplicates all devices and queues - void SetUp(std::vector srcDevices, - size_t numDuplicate) { - UUR_RETURN_ON_FATAL_FAILURE( - uur::urMultiDeviceContextTestTemplate<1>::SetUp()); - initQueues(srcDevices, numDuplicate); + ur_context_handle_t context; + std::vector queues; +}; + +template +struct urMultiQueueMultiDeviceTestWithParam + : uur::urAllDevicesTestWithParam { + using uur::urAllDevicesTestWithParam::devices; + void SetUp() override { + UUR_RETURN_ON_FATAL_FAILURE(uur::urAllDevicesTestWithParam::SetUp()); + + ASSERT_SUCCESS( + urContextCreate(devices.size(), devices.data(), nullptr, &context)); + + // Duplicate our devices until we hit the minimum size specified. + auto srcDevices = devices; + while (devices.size() < minDevices) { + devices.insert(devices.end(), srcDevices.begin(), srcDevices.end()); + } + + for (auto &device : devices) { + ur_queue_handle_t queue = nullptr; + ASSERT_SUCCESS(urQueueCreate(context, device, nullptr, &queue)); + queues.push_back(queue); + } } void TearDown() override { @@ -188,13 +217,10 @@ struct urMultiQueueMultiDeviceTest : uur::urMultiDeviceContextTestTemplate<1> { EXPECT_SUCCESS(urQueueRelease(queue)); } UUR_RETURN_ON_FATAL_FAILURE( - uur::urMultiDeviceContextTestTemplate<1>::TearDown()); + uur::urAllDevicesTestWithParam::TearDown()); } - std::function, - std::vector>(void)> - makeQueues; - std::vector devices; + ur_context_handle_t context; std::vector queues; }; diff --git a/test/conformance/enqueue/urEnqueueEventsWait.cpp b/test/conformance/enqueue/urEnqueueEventsWait.cpp index 3d71200008..2c1b7459a7 100644 --- a/test/conformance/enqueue/urEnqueueEventsWait.cpp +++ b/test/conformance/enqueue/urEnqueueEventsWait.cpp @@ -2,7 +2,9 @@ // 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 +#include struct urEnqueueEventsWaitTest : uur::urMultiQueueTest { void SetUp() override { @@ -37,6 +39,8 @@ struct urEnqueueEventsWaitTest : uur::urMultiQueueTest { UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueEventsWaitTest); TEST_P(urEnqueueEventsWaitTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::NativeCPU{}); + ur_event_handle_t event1 = nullptr; ur_event_handle_t waitEvent = nullptr; ASSERT_SUCCESS(urEnqueueMemBufferCopy(queue1, src_buffer, dst_buffer, 0, 0, @@ -72,6 +76,8 @@ TEST_P(urEnqueueEventsWaitTest, InvalidNullHandleQueue) { } TEST_P(urEnqueueEventsWaitTest, InvalidNullPtrEventWaitList) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ASSERT_EQ_RESULT(urEnqueueEventsWait(queue1, 1, nullptr, nullptr), UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST); diff --git a/test/conformance/enqueue/urEnqueueEventsWaitMultiDevice.cpp b/test/conformance/enqueue/urEnqueueEventsWaitMultiDevice.cpp index 80da446814..a6be0f991e 100644 --- a/test/conformance/enqueue/urEnqueueEventsWaitMultiDevice.cpp +++ b/test/conformance/enqueue/urEnqueueEventsWaitMultiDevice.cpp @@ -4,27 +4,34 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "helpers.h" +#include "uur/known_failure.h" #include #include #include -struct urEnqueueEventsWaitMultiDeviceTest : uur::urMultiQueueMultiDeviceTest { - void SetUp() override { SetUp(2); /* we need at least 2 devices */ } +void checkDevicesSupportSharedUSM( + const std::vector &devices) { + for (auto device : devices) { + ur_device_usm_access_capability_flags_t shared_usm_single = 0; + EXPECT_SUCCESS( + uur::GetDeviceUSMSingleSharedSupport(device, shared_usm_single)); + if (!shared_usm_single) { + GTEST_SKIP() << "Shared USM is not supported by the device."; + } + } +} - void SetUp(size_t numDuplicateDevices) { - UUR_RETURN_ON_FATAL_FAILURE(uur::urMultiQueueMultiDeviceTest::SetUp( - uur::KernelsEnvironment::instance->devices, numDuplicateDevices)); +struct urEnqueueEventsWaitMultiDeviceTest + : uur::urMultiQueueMultiDeviceTest<2> { + void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); - for (auto device : devices) { - ur_device_usm_access_capability_flags_t shared_usm_single = 0; - EXPECT_SUCCESS(uur::GetDeviceUSMSingleSharedSupport( - device, shared_usm_single)); - if (!shared_usm_single) { - GTEST_SKIP() << "Shared USM is not supported by the device."; - } - } + UUR_RETURN_ON_FATAL_FAILURE( + uur::urMultiQueueMultiDeviceTest<2>::SetUp()); + + checkDevicesSupportSharedUSM(devices); ptrs.resize(devices.size()); for (size_t i = 0; i < devices.size(); i++) { @@ -40,7 +47,7 @@ struct urEnqueueEventsWaitMultiDeviceTest : uur::urMultiQueueMultiDeviceTest { } } UUR_RETURN_ON_FATAL_FAILURE( - uur::urMultiQueueMultiDeviceTest::TearDown()); + uur::urMultiQueueMultiDeviceTest<2>::TearDown()); } void initData() { @@ -61,8 +68,9 @@ struct urEnqueueEventsWaitMultiDeviceTest : uur::urMultiQueueMultiDeviceTest { std::vector ptrs; }; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urEnqueueEventsWaitMultiDeviceTest); -TEST_F(urEnqueueEventsWaitMultiDeviceTest, EmptyWaitList) { +TEST_P(urEnqueueEventsWaitMultiDeviceTest, EmptyWaitList) { initData(); ASSERT_SUCCESS(urEnqueueUSMMemcpy(queues[0], false, ptrs[1], ptrs[0], size, @@ -73,7 +81,7 @@ TEST_F(urEnqueueEventsWaitMultiDeviceTest, EmptyWaitList) { verifyData(ptrs[1], pattern); } -TEST_F(urEnqueueEventsWaitMultiDeviceTest, EmptyWaitListWithEvent) { +TEST_P(urEnqueueEventsWaitMultiDeviceTest, EmptyWaitListWithEvent) { initData(); ASSERT_SUCCESS(urEnqueueUSMMemcpy(queues[0], false, ptrs[1], ptrs[0], size, @@ -86,7 +94,7 @@ TEST_F(urEnqueueEventsWaitMultiDeviceTest, EmptyWaitListWithEvent) { verifyData(ptrs[1], pattern); } -TEST_F(urEnqueueEventsWaitMultiDeviceTest, EnqueueWaitOnADifferentQueue) { +TEST_P(urEnqueueEventsWaitMultiDeviceTest, EnqueueWaitOnADifferentQueue) { initData(); uur::raii::Event event; @@ -99,10 +107,9 @@ TEST_F(urEnqueueEventsWaitMultiDeviceTest, EnqueueWaitOnADifferentQueue) { } struct urEnqueueEventsWaitMultiDeviceMTTest - : urEnqueueEventsWaitMultiDeviceTest, - testing::WithParamInterface { + : uur::urMultiQueueMultiDeviceTestWithParam<8, uur::BoolTestParam> { void doComputation(std::function work) { - auto multiThread = GetParam().value; + auto multiThread = getParam().value; std::vector threads; for (size_t i = 0; i < devices.size(); i++) { if (multiThread) { @@ -117,29 +124,52 @@ struct urEnqueueEventsWaitMultiDeviceMTTest } void SetUp() override { - const size_t numDuplicateDevices = 8; - UUR_RETURN_ON_FATAL_FAILURE( - urEnqueueEventsWaitMultiDeviceTest::SetUp(numDuplicateDevices)); + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::NativeCPU{}); + + UUR_RETURN_ON_FATAL_FAILURE(uur::urMultiQueueMultiDeviceTestWithParam< + 8, uur::BoolTestParam>::SetUp()); + checkDevicesSupportSharedUSM(devices); + + ptrs.resize(devices.size()); + for (size_t i = 0; i < devices.size(); i++) { + EXPECT_SUCCESS(urUSMSharedAlloc(context, devices[i], nullptr, + nullptr, size, &ptrs[i])); + } } - void TearDown() override { urEnqueueEventsWaitMultiDeviceTest::TearDown(); } -}; + void TearDown() override { + for (auto ptr : ptrs) { + if (ptr) { + EXPECT_SUCCESS(urUSMFree(context, ptr)); + } + } + UUR_RETURN_ON_FATAL_FAILURE(uur::urMultiQueueMultiDeviceTestWithParam< + 8, uur::BoolTestParam>::TearDown()); + } -template -inline std::string -printParams(const testing::TestParamInfo &info) { - std::stringstream ss; + void initData() { + EXPECT_SUCCESS(urEnqueueUSMFill(queues[0], ptrs[0], sizeof(pattern), + &pattern, size, 0, nullptr, nullptr)); + EXPECT_SUCCESS(urQueueFinish(queues[0])); + } - auto param1 = info.param; - ss << (param1.value ? "" : "No") << param1.name; + void verifyData(void *ptr, uint32_t pattern) { + for (size_t i = 0; i < count; i++) { + ASSERT_EQ(reinterpret_cast(ptr)[i], pattern); + } + } - return ss.str(); -} + uint32_t pattern = 42; + const size_t count = 1024; + const size_t size = sizeof(uint32_t) * count; -INSTANTIATE_TEST_SUITE_P( - , urEnqueueEventsWaitMultiDeviceMTTest, + std::vector ptrs; +}; + +UUR_PLATFORM_TEST_SUITE_P( + urEnqueueEventsWaitMultiDeviceMTTest, testing::ValuesIn(uur::BoolTestParam::makeBoolParam("MultiThread")), - printParams); + uur::platformTestWithParamPrinter); TEST_P(urEnqueueEventsWaitMultiDeviceMTTest, EnqueueWaitSingleQueueMultiOps) { std::vector data(count, pattern); @@ -163,6 +193,13 @@ TEST_P(urEnqueueEventsWaitMultiDeviceMTTest, EnqueueWaitSingleQueueMultiOps) { } TEST_P(urEnqueueEventsWaitMultiDeviceMTTest, EnqueueWaitOnAllQueues) { + // Fails when -fsanitize=cfi +#ifdef UR_USE_CFI + if (getParam().value) { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{}); + } +#endif + std::vector eventsRaii(devices.size()); std::vector events(devices.size()); auto work = [this, &events, &eventsRaii](size_t i) { diff --git a/test/conformance/enqueue/urEnqueueEventsWaitWithBarrier.cpp b/test/conformance/enqueue/urEnqueueEventsWaitWithBarrier.cpp index ca464b48dd..df31ea4f16 100644 --- a/test/conformance/enqueue/urEnqueueEventsWaitWithBarrier.cpp +++ b/test/conformance/enqueue/urEnqueueEventsWaitWithBarrier.cpp @@ -3,6 +3,7 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include enum class BarrierType { Normal, @@ -71,10 +72,10 @@ struct urEnqueueEventsWaitWithBarrierTest std::vector input; }; -UUR_TEST_SUITE_P(urEnqueueEventsWaitWithBarrierTest, - ::testing::Values(BarrierType::Normal, - BarrierType::ExtLowPower), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urEnqueueEventsWaitWithBarrierTest, + ::testing::Values(BarrierType::Normal, + BarrierType::ExtLowPower), + uur::deviceTestWithParamPrinter); struct urEnqueueEventsWaitWithBarrierOrderingTest : uur::urProgramTest { void SetUp() override { @@ -103,6 +104,8 @@ struct urEnqueueEventsWaitWithBarrierOrderingTest : uur::urProgramTest { UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueEventsWaitWithBarrierOrderingTest); TEST_P(urEnqueueEventsWaitWithBarrierTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::NativeCPU{}); + ur_event_handle_t event1 = nullptr; ur_event_handle_t waitEvent = nullptr; ASSERT_SUCCESS(urEnqueueMemBufferCopy(queue1, src_buffer, dst_buffer, 0, 0, @@ -142,6 +145,8 @@ TEST_P(urEnqueueEventsWaitWithBarrierTest, InvalidNullHandleQueue) { } TEST_P(urEnqueueEventsWaitWithBarrierTest, InvalidNullPtrEventWaitList) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ASSERT_EQ_RESULT(EnqueueBarrier(queue1, 1, nullptr, nullptr), UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST); @@ -160,6 +165,8 @@ TEST_P(urEnqueueEventsWaitWithBarrierTest, InvalidNullPtrEventWaitList) { TEST_P(urEnqueueEventsWaitWithBarrierOrderingTest, SuccessEventDependenciesBarrierOnly) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + constexpr size_t offset = 0; constexpr size_t count = 1; ur_event_handle_t event; @@ -192,6 +199,8 @@ TEST_P(urEnqueueEventsWaitWithBarrierOrderingTest, TEST_P(urEnqueueEventsWaitWithBarrierOrderingTest, SuccessEventDependenciesLaunchOnly) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + constexpr size_t offset = 0; constexpr size_t count = 1; ur_event_handle_t event; @@ -223,6 +232,8 @@ TEST_P(urEnqueueEventsWaitWithBarrierOrderingTest, } TEST_P(urEnqueueEventsWaitWithBarrierOrderingTest, SuccessEventDependencies) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + constexpr size_t offset = 0; constexpr size_t count = 1; ur_event_handle_t event[6]; @@ -255,6 +266,8 @@ TEST_P(urEnqueueEventsWaitWithBarrierOrderingTest, SuccessEventDependencies) { TEST_P(urEnqueueEventsWaitWithBarrierOrderingTest, SuccessNonEventDependencies) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + constexpr size_t offset = 0; constexpr size_t count = 1; diff --git a/test/conformance/enqueue/urEnqueueKernelLaunch.cpp b/test/conformance/enqueue/urEnqueueKernelLaunch.cpp index 76260bbc9c..312bdc2eb9 100644 --- a/test/conformance/enqueue/urEnqueueKernelLaunch.cpp +++ b/test/conformance/enqueue/urEnqueueKernelLaunch.cpp @@ -4,7 +4,9 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include #include +#include struct urEnqueueKernelLaunchTest : uur::urKernelExecutionTest { void SetUp() override { @@ -38,6 +40,9 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueKernelLaunchKernelWgSizeTest); // Note: Due to an issue with HIP, the subgroup test is not generated struct urEnqueueKernelLaunchKernelSubGroupTest : uur::urKernelExecutionTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}, uur::LevelZero{}, + uur::LevelZeroV2{}); + program_name = "subgroup"; UUR_RETURN_ON_FATAL_FAILURE(urKernelExecutionTest::SetUp()); } @@ -135,6 +140,10 @@ TEST_P(urEnqueueKernelLaunchTest, InvalidWorkGroupSize) { } TEST_P(urEnqueueKernelLaunchTest, InvalidKernelArgs) { + // Cuda and hip both lack any way to validate kernel args + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); + ur_platform_backend_t backend; ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND, sizeof(ur_platform_backend_t), &backend, @@ -154,6 +163,8 @@ TEST_P(urEnqueueKernelLaunchTest, InvalidKernelArgs) { } TEST_P(urEnqueueKernelLaunchKernelWgSizeTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); + ASSERT_SUCCESS(urEnqueueKernelLaunch( queue, kernel, n_dimensions, global_offset.data(), global_size.data(), nullptr, 0, nullptr, nullptr)); @@ -168,6 +179,8 @@ TEST_P(urEnqueueKernelLaunchKernelWgSizeTest, SuccessWithExplicitLocalSize) { } TEST_P(urEnqueueKernelLaunchKernelWgSizeTest, NonMatchingLocalSize) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}); + std::array wrong_wg_size{8, 8, 8}; ASSERT_EQ_RESULT( urEnqueueKernelLaunch(queue, kernel, n_dimensions, global_offset.data(), @@ -177,6 +190,8 @@ TEST_P(urEnqueueKernelLaunchKernelWgSizeTest, NonMatchingLocalSize) { } TEST_P(urEnqueueKernelLaunchKernelSubGroupTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ur_mem_handle_t buffer = nullptr; AddBuffer1DArg(sizeof(size_t), &buffer); ASSERT_SUCCESS(urEnqueueKernelLaunch( @@ -218,7 +233,7 @@ struct testParametersEnqueueKernel { template inline std::string printKernelLaunchTestString( const testing::TestParamInfo &info) { - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); std::stringstream test_name; @@ -285,7 +300,7 @@ static std::vector test_cases{// 1D {1027, 1, 19, 3}, {1, 53, 19, 3}, {256, 79, 8, 3}}; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urEnqueueKernelLaunchTestWithParam, testing::ValuesIn(test_cases), printKernelLaunchTestString); @@ -426,6 +441,8 @@ struct urEnqueueKernelLaunchWithVirtualMemory : uur::urKernelExecutionTest { UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueKernelLaunchWithVirtualMemory); TEST_P(urEnqueueKernelLaunchWithVirtualMemory, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + size_t work_dim = 1; size_t global_offset = 0; size_t global_size = alloc_size / sizeof(uint32_t); @@ -452,34 +469,66 @@ TEST_P(urEnqueueKernelLaunchWithVirtualMemory, Success) { } } -struct urEnqueueKernelLaunchMultiDeviceTest : public urEnqueueKernelLaunchTest { +struct urEnqueueKernelLaunchMultiDeviceTest + : public uur::urMultiDeviceContextTest { void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urEnqueueKernelLaunchTest::SetUp()); + UUR_RETURN_ON_FATAL_FAILURE(uur::urMultiDeviceContextTest::SetUp()); queues.reserve(uur::DevicesEnvironment::instance->devices.size()); - for (const auto &device : uur::DevicesEnvironment::instance->devices) { + for (const auto &device : devices) { ur_queue_handle_t queue = nullptr; ASSERT_SUCCESS(urQueueCreate(this->context, device, 0, &queue)); queues.push_back(queue); } + auto kernelName = + uur::KernelsEnvironment::instance->GetEntryPointNames("foo")[0]; + + uur::KernelsEnvironment::instance->LoadSource("foo", platform, + il_binary); + + ASSERT_SUCCESS(uur::KernelsEnvironment::instance->CreateProgram( + platform, context, devices[0], *il_binary, nullptr, &program)); + + ASSERT_SUCCESS(urProgramBuild(context, program, nullptr)); + ASSERT_SUCCESS(urKernelCreate(program, kernelName.data(), &kernel)); } void TearDown() override { for (const auto &queue : queues) { EXPECT_SUCCESS(urQueueRelease(queue)); } - UUR_RETURN_ON_FATAL_FAILURE(urEnqueueKernelLaunchTest::TearDown()); + if (program) { + EXPECT_SUCCESS(urProgramRelease(program)); + } + if (kernel) { + EXPECT_SUCCESS(urKernelRelease(kernel)); + } + UUR_RETURN_ON_FATAL_FAILURE(uur::urMultiDeviceContextTest::TearDown()); } + ur_program_handle_t program = nullptr; + ur_kernel_handle_t kernel = nullptr; + + std::shared_ptr> il_binary; std::vector queues; + + uint32_t val = 42; + size_t global_size = 32; + size_t global_offset = 0; + size_t n_dimensions = 1; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueKernelLaunchMultiDeviceTest); +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urEnqueueKernelLaunchMultiDeviceTest); // TODO: rewrite this test, right now it only works for a single queue // (the context is only created for one device) TEST_P(urEnqueueKernelLaunchMultiDeviceTest, KernelLaunchReadDifferentQueues) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); + + uur::KernelLaunchHelper helper = + uur::KernelLaunchHelper{platform, context, kernel, queues[0]}; + ur_mem_handle_t buffer = nullptr; - AddBuffer1DArg(sizeof(val) * global_size, &buffer); - AddPodArg(val); + helper.AddBuffer1DArg(sizeof(val) * global_size, &buffer, nullptr); + helper.AddPodArg(val); ASSERT_SUCCESS(urEnqueueKernelLaunch(queues[0], kernel, n_dimensions, &global_offset, &global_size, nullptr, 0, nullptr, nullptr)); @@ -557,12 +606,16 @@ struct urEnqueueKernelLaunchUSMLinkedList ur_queue_handle_t queue = nullptr; }; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urEnqueueKernelLaunchUSMLinkedList, testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UsePool")), uur::deviceTestWithParamPrinter); TEST_P(urEnqueueKernelLaunchUSMLinkedList, Success) { + if (use_pool) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + } + ur_device_usm_access_capability_flags_t shared_usm_flags = 0; ASSERT_SUCCESS( uur::GetDeviceUSMSingleSharedSupport(device, shared_usm_flags)); diff --git a/test/conformance/enqueue/urEnqueueKernelLaunchAndMemcpyInOrder.cpp b/test/conformance/enqueue/urEnqueueKernelLaunchAndMemcpyInOrder.cpp index b6306f1693..97306b9f17 100644 --- a/test/conformance/enqueue/urEnqueueKernelLaunchAndMemcpyInOrder.cpp +++ b/test/conformance/enqueue/urEnqueueKernelLaunchAndMemcpyInOrder.cpp @@ -6,6 +6,7 @@ #include "helpers.h" #include +#include #include #include @@ -14,9 +15,9 @@ // There was a bug in previous L0 drivers that caused the test to fail std::tuple minL0DriverVersion = {1, 3, 29534}; -template -struct urMultiQueueLaunchMemcpyTest : uur::urMultiQueueMultiDeviceTest, - testing::WithParamInterface { +template +struct urMultiQueueLaunchMemcpyTest + : uur::urMultiQueueMultiDeviceTestWithParam { std::string KernelName; std::vector programs; std::vector kernels; @@ -26,12 +27,17 @@ struct urMultiQueueLaunchMemcpyTest : uur::urMultiQueueMultiDeviceTest, static constexpr size_t ArraySize = 100; static constexpr uint32_t InitialValue = 1; - void SetUp() override { throw std::runtime_error("Not implemented"); } + using uur::urMultiQueueMultiDeviceTestWithParam::devices; + using uur::urMultiQueueMultiDeviceTestWithParam::platform; + using uur::urMultiQueueMultiDeviceTestWithParam::context; + using uur::urMultiQueueMultiDeviceTestWithParam::queues; + + void SetUp() override { + // We haven't got device code tests working on native cpu yet. + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); - void SetUp(std::vector srcDevices, - size_t duplicateDevices) { - UUR_RETURN_ON_FATAL_FAILURE(uur::urMultiQueueMultiDeviceTest::SetUp( - srcDevices, duplicateDevices)); + UUR_RETURN_ON_FATAL_FAILURE( + uur::urMultiQueueMultiDeviceTestWithParam::SetUp()); for (auto &device : devices) { SKIP_IF_DRIVER_TOO_OLD("Level-Zero", minL0DriverVersion, platform, @@ -48,7 +54,8 @@ struct urMultiQueueLaunchMemcpyTest : uur::urMultiQueueMultiDeviceTest, std::shared_ptr> il_binary; std::vector metadatas{}; - uur::KernelsEnvironment::instance->LoadSource(ProgramName, il_binary); + uur::KernelsEnvironment::instance->LoadSource(ProgramName, platform, + il_binary); for (size_t i = 0; i < devices.size(); i++) { const ur_program_properties_t properties = { @@ -93,7 +100,8 @@ struct urMultiQueueLaunchMemcpyTest : uur::urMultiQueueMultiDeviceTest, urProgramRelease(program); } UUR_RETURN_ON_FATAL_FAILURE( - uur::urMultiDeviceContextTestTemplate<1>::TearDown()); + uur::urMultiQueueMultiDeviceTestWithParam::TearDown()); } void runBackgroundCheck(std::vector &Events) { @@ -122,60 +130,62 @@ struct urMultiQueueLaunchMemcpyTest : uur::urMultiQueueMultiDeviceTest, template struct urEnqueueKernelLaunchIncrementMultiDeviceTestWithParam - : public urMultiQueueLaunchMemcpyTest { + : public urMultiQueueLaunchMemcpyTest<8, Param> { static constexpr size_t duplicateDevices = 8; - using urMultiQueueLaunchMemcpyTest::context; - using urMultiQueueLaunchMemcpyTest::queues; - using urMultiQueueLaunchMemcpyTest::devices; - using urMultiQueueLaunchMemcpyTest::kernels; - using urMultiQueueLaunchMemcpyTest::SharedMem; + using urMultiQueueLaunchMemcpyTest::context; + using urMultiQueueLaunchMemcpyTest::queues; + using urMultiQueueLaunchMemcpyTest::devices; + using urMultiQueueLaunchMemcpyTest::kernels; + using urMultiQueueLaunchMemcpyTest::SharedMem; void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueLaunchMemcpyTest::SetUp( - uur::KernelsEnvironment::instance->devices, duplicateDevices)); + UUR_RETURN_ON_FATAL_FAILURE( + urMultiQueueLaunchMemcpyTest::SetUp()); } void TearDown() override { UUR_RETURN_ON_FATAL_FAILURE( - urMultiQueueLaunchMemcpyTest::TearDown()); + urMultiQueueLaunchMemcpyTest::TearDown()); } }; struct urEnqueueKernelLaunchIncrementTest - : urMultiQueueLaunchMemcpyTest< - std::tuple> { + : urMultiQueueLaunchMemcpyTest<50, uur::BoolTestParam> { static constexpr size_t numOps = 50; - using Param = std::tuple; - using urMultiQueueLaunchMemcpyTest::context; - using urMultiQueueLaunchMemcpyTest::queues; - using urMultiQueueLaunchMemcpyTest::devices; - using urMultiQueueLaunchMemcpyTest::kernels; - using urMultiQueueLaunchMemcpyTest::SharedMem; + using Param = uur::BoolTestParam; + + using urMultiQueueLaunchMemcpyTest::context; + using urMultiQueueLaunchMemcpyTest::queues; + using urMultiQueueLaunchMemcpyTest::devices; + using urMultiQueueLaunchMemcpyTest::kernels; + using urMultiQueueLaunchMemcpyTest::SharedMem; void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueLaunchMemcpyTest::SetUp( - std::vector{std::get<0>(GetParam())}, - numOps)); // Use single device, duplicated numOps times + UUR_RETURN_ON_FATAL_FAILURE( + urMultiQueueLaunchMemcpyTest:: + SetUp()); // Use single device, duplicated numOps times } void TearDown() override { UUR_RETURN_ON_FATAL_FAILURE( - urMultiQueueLaunchMemcpyTest::TearDown()); + urMultiQueueLaunchMemcpyTest::TearDown()); } }; -UUR_TEST_SUITE_P( +UUR_PLATFORM_TEST_SUITE_P( urEnqueueKernelLaunchIncrementTest, testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UseEvents")), - uur::deviceTestWithParamPrinter); + uur::platformTestWithParamPrinter); TEST_P(urEnqueueKernelLaunchIncrementTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + constexpr size_t global_offset = 0; constexpr size_t n_dimensions = 1; - auto useEvents = std::get<1>(GetParam()).value; + auto useEvents = getParam().value; std::vector kernelEvents(numOps); std::vector memcpyEvents(numOps - 1); @@ -229,25 +239,30 @@ inline std::string printParams(const testing::TestParamInfo &info) { std::stringstream ss; - auto param1 = std::get<0>(info.param); + auto boolParamTuple = std::get<1>(info.param); + + auto param1 = std::get<0>(boolParamTuple); ss << (param1.value ? "" : "No") << param1.name; - auto param2 = std::get<1>(info.param); + auto param2 = std::get<1>(boolParamTuple); ss << (param2.value ? "" : "No") << param2.name; if constexpr (std::tuple_size_v < typename T::ParamType >> 2) { auto param3 = std::get<2>(info.param); } - return ss.str(); + auto platform = std::get<0>(info.param); + + return uur::GetPlatformNameWithID(platform) + "__" + + uur::GTestSanitizeString(ss.str()); } using urEnqueueKernelLaunchIncrementMultiDeviceTest = urEnqueueKernelLaunchIncrementMultiDeviceTestWithParam< std::tuple>; -INSTANTIATE_TEST_SUITE_P( - , urEnqueueKernelLaunchIncrementMultiDeviceTest, +UUR_PLATFORM_TEST_SUITE_P( + urEnqueueKernelLaunchIncrementMultiDeviceTest, testing::Combine( testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UseEventWait")), testing::ValuesIn( @@ -256,8 +271,10 @@ INSTANTIATE_TEST_SUITE_P( // Do a chain of kernelLaunch(dev0) -> memcpy(dev0, dev1) -> kernelLaunch(dev1) ... ops TEST_P(urEnqueueKernelLaunchIncrementMultiDeviceTest, Success) { - auto waitOnEvent = std::get<0>(GetParam()).value; - auto runBackgroundCheck = std::get<1>(GetParam()).value; + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + + auto waitOnEvent = std::get<0>(getParam()).value; + auto runBackgroundCheck = std::get<1>(getParam()).value; size_t returned_size; ASSERT_SUCCESS(urDeviceGetInfo(devices[0], UR_DEVICE_INFO_EXTENSIONS, 0, @@ -333,8 +350,8 @@ using urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest = urEnqueueKernelLaunchIncrementMultiDeviceTestWithParam< std::tuple>; -INSTANTIATE_TEST_SUITE_P( - , urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest, +UUR_PLATFORM_TEST_SUITE_P( + urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest, testing::Combine( testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UseEvents")), testing::ValuesIn(uur::BoolTestParam::makeBoolParam("QueuePerThread"))), @@ -343,14 +360,18 @@ INSTANTIATE_TEST_SUITE_P( // Enqueue kernelLaunch concurrently from multiple threads // With !queuePerThread this becomes a test on a single device TEST_P(urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest, Success) { + auto useEvents = std::get<0>(getParam()).value; + auto queuePerThread = std::get<1>(getParam()).value; + + if (!queuePerThread) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); + } + size_t numThreads = devices.size(); std::vector threads; static constexpr size_t numOpsPerThread = 6; - auto useEvents = std::get<0>(GetParam()).value; - auto queuePerThread = std::get<1>(GetParam()).value; - for (size_t i = 0; i < numThreads; i++) { threads.emplace_back([this, i, queuePerThread, useEvents]() { constexpr size_t global_offset = 0; diff --git a/test/conformance/enqueue/urEnqueueMemBufferCopy.cpp b/test/conformance/enqueue/urEnqueueMemBufferCopy.cpp index ad73d4aa69..65c62e4adf 100644 --- a/test/conformance/enqueue/urEnqueueMemBufferCopy.cpp +++ b/test/conformance/enqueue/urEnqueueMemBufferCopy.cpp @@ -5,6 +5,7 @@ #include "helpers.h" #include +#include struct urEnqueueMemBufferCopyTestWithParam : uur::urQueueTestWithParam { void SetUp() override { @@ -38,11 +39,13 @@ struct urEnqueueMemBufferCopyTestWithParam : uur::urQueueTestWithParam { static std::vector test_parameters{1024, 2500, 4096, 6000}; -UUR_TEST_SUITE_P(urEnqueueMemBufferCopyTestWithParam, - ::testing::ValuesIn(test_parameters), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urEnqueueMemBufferCopyTestWithParam, + ::testing::ValuesIn(test_parameters), + uur::deviceTestWithParamPrinter); TEST_P(urEnqueueMemBufferCopyTestWithParam, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ASSERT_SUCCESS(urEnqueueMemBufferCopy(queue, src_buffer, dst_buffer, 0, 0, size, 0, nullptr, nullptr)); std::vector output(count, 1); @@ -70,6 +73,8 @@ TEST_P(urEnqueueMemBufferCopyTestWithParam, InvalidNullHandleBufferDst) { } TEST_P(urEnqueueMemBufferCopyTestWithParam, InvalidNullPtrEventWaitList) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ASSERT_EQ_RESULT(urEnqueueMemBufferCopy(queue, src_buffer, dst_buffer, 0, 0, size, 1, nullptr, nullptr), UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST); @@ -90,6 +95,8 @@ TEST_P(urEnqueueMemBufferCopyTestWithParam, InvalidNullPtrEventWaitList) { } TEST_P(urEnqueueMemBufferCopyTestWithParam, InvalidSize) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, urEnqueueMemBufferCopy(queue, src_buffer, dst_buffer, 1, 0, size, 0, nullptr, nullptr)); @@ -100,8 +107,9 @@ TEST_P(urEnqueueMemBufferCopyTestWithParam, InvalidSize) { using urEnqueueMemBufferCopyMultiDeviceTest = uur::urMultiDeviceMemBufferQueueTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urEnqueueMemBufferCopyMultiDeviceTest); -TEST_F(urEnqueueMemBufferCopyMultiDeviceTest, CopyReadDifferentQueues) { +TEST_P(urEnqueueMemBufferCopyMultiDeviceTest, CopyReadDifferentQueues) { // First queue does a fill. const uint32_t input = 42; ASSERT_SUCCESS(urEnqueueMemBufferFill(queues[0], buffer, &input, diff --git a/test/conformance/enqueue/urEnqueueMemBufferCopyRect.cpp b/test/conformance/enqueue/urEnqueueMemBufferCopyRect.cpp index 8c7fe5d430..d300c5f702 100644 --- a/test/conformance/enqueue/urEnqueueMemBufferCopyRect.cpp +++ b/test/conformance/enqueue/urEnqueueMemBufferCopyRect.cpp @@ -3,6 +3,7 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "helpers.h" +#include "uur/known_failure.h" #include static std::vector generateParameterizations() { @@ -45,22 +46,22 @@ static std::vector generateParameterizations() { 256, 256, 256, 512); // Tests that a 8x8x8 region can be read from a 8x8x8 device buffer at // offset {0,0,0} to a 8x8x8 host buffer at offset {0,0,0}. - PARAMETERIZATION(copy_3d, 512, 512, (ur_rect_offset_t{0, 0, 0}), + PARAMETERIZATION(copy_3D, 512, 512, (ur_rect_offset_t{0, 0, 0}), (ur_rect_offset_t{0, 0, 0}), (ur_rect_region_t{8, 8, 8}), 8, 64, 8, 64); // Tests that a 4x3x2 region can be read from a 8x8x8 device buffer at // offset {1,2,3} to a 8x8x8 host buffer at offset {4,1,3}. - PARAMETERIZATION(copy_3d_with_offsets, 512, 512, + PARAMETERIZATION(copy_3D_with_offsets, 512, 512, (ur_rect_offset_t{1, 2, 3}), (ur_rect_offset_t{4, 1, 3}), (ur_rect_region_t{4, 3, 2}), 8, 64, 8, 64); // Tests that a 4x16x2 region can be read from a 8x32x1 device buffer at // offset {1,2,0} to a 8x32x4 host buffer at offset {4,1,3}. - PARAMETERIZATION(copy_2d_3d, 256, 1024, (ur_rect_offset_t{1, 2, 0}), + PARAMETERIZATION(copy_2D_3D, 256, 1024, (ur_rect_offset_t{1, 2, 0}), (ur_rect_offset_t{4, 1, 3}), (ur_rect_region_t{4, 16, 1}), 8, 256, 8, 256); // Tests that a 1x4x1 region can be read from a 8x16x4 device buffer at // offset {7,3,3} to a 2x8x1 host buffer at offset {1,3,0}. - PARAMETERIZATION(copy_3d_2d, 512, 16, (ur_rect_offset_t{7, 3, 3}), + PARAMETERIZATION(copy_3D_2D, 512, 16, (ur_rect_offset_t{7, 3, 3}), (ur_rect_offset_t{1, 3, 0}), (ur_rect_region_t{1, 4, 1}), 8, 128, 2, 16); #undef PARAMETERIZATION @@ -70,12 +71,23 @@ static std::vector generateParameterizations() { struct urEnqueueMemBufferCopyRectTestWithParam : public uur::urQueueTestWithParam {}; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urEnqueueMemBufferCopyRectTestWithParam, testing::ValuesIn(generateParameterizations()), uur::printRectTestString); TEST_P(urEnqueueMemBufferCopyRectTestWithParam, Success) { + const auto name = getParam().name; + if (name.find("copy_row_2D") != std::string::npos) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + } + + if (name.find("copy_3D_2D") != std::string::npos) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + } + + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); + // Unpack the parameters. const auto src_buffer_size = getParam().src_size; const auto dst_buffer_size = getParam().dst_size; @@ -202,6 +214,8 @@ TEST_P(urEnqueueMemBufferCopyRectTest, InvalidNullHandleBufferDst) { } TEST_P(urEnqueueMemBufferCopyRectTest, InvalidNullPtrEventWaitList) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_rect_region_t src_region{size, 1, 1}; ur_rect_offset_t src_origin{0, 0, 0}; ur_rect_offset_t dst_origin{0, 0, 0}; @@ -232,8 +246,10 @@ TEST_P(urEnqueueMemBufferCopyRectTest, InvalidNullPtrEventWaitList) { using urEnqueueMemBufferCopyRectMultiDeviceTest = uur::urMultiDeviceMemBufferQueueTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P( + urEnqueueMemBufferCopyRectMultiDeviceTest); -TEST_F(urEnqueueMemBufferCopyRectMultiDeviceTest, CopyRectReadDifferentQueues) { +TEST_P(urEnqueueMemBufferCopyRectMultiDeviceTest, CopyRectReadDifferentQueues) { // First queue does a fill. const uint32_t input = 42; ASSERT_SUCCESS(urEnqueueMemBufferFill(queues[0], buffer, &input, @@ -272,6 +288,8 @@ TEST_F(urEnqueueMemBufferCopyRectMultiDeviceTest, CopyRectReadDifferentQueues) { } TEST_P(urEnqueueMemBufferCopyRectTest, InvalidSize) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + // out-of-bounds access with potential overflow ur_rect_region_t src_region{size, 1, 1}; ur_rect_offset_t src_origin{std::numeric_limits::max(), 1, 1}; diff --git a/test/conformance/enqueue/urEnqueueMemBufferFill.cpp b/test/conformance/enqueue/urEnqueueMemBufferFill.cpp index 89539557fe..e79dbb22d5 100644 --- a/test/conformance/enqueue/urEnqueueMemBufferFill.cpp +++ b/test/conformance/enqueue/urEnqueueMemBufferFill.cpp @@ -68,10 +68,13 @@ static std::vector test_cases{ {256, 16}, {256, 32}}; -UUR_TEST_SUITE_P(urEnqueueMemBufferFillTest, testing::ValuesIn(test_cases), - uur::printFillTestString); +UUR_DEVICE_TEST_SUITE_P(urEnqueueMemBufferFillTest, + testing::ValuesIn(test_cases), + uur::printFillTestString); TEST_P(urEnqueueMemBufferFillTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ASSERT_SUCCESS(urEnqueueMemBufferFill(queue, buffer, pattern.data(), pattern_size, 0, size, 0, nullptr, nullptr)); @@ -81,6 +84,8 @@ TEST_P(urEnqueueMemBufferFillTest, Success) { verifyData(output, size); } TEST_P(urEnqueueMemBufferFillTest, SuccessPartialFill) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + if (size == 1) { // Can't partially fill one byte GTEST_SKIP(); @@ -106,6 +111,8 @@ TEST_P(urEnqueueMemBufferFillTest, SuccessPartialFill) { } TEST_P(urEnqueueMemBufferFillTest, SuccessOffset) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + if (size == 1) { // No room for an offset GTEST_SKIP(); @@ -163,6 +170,8 @@ TEST_P(urEnqueueMemBufferFillNegativeTest, InvalidNullHandlePointerPattern) { } TEST_P(urEnqueueMemBufferFillNegativeTest, InvalidNullPtrEventWaitList) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + const uint32_t pattern = 0xdeadbeef; ASSERT_EQ_RESULT(urEnqueueMemBufferFill(queue, buffer, &pattern, sizeof(uint32_t), 0, size, 1, @@ -196,8 +205,9 @@ TEST_P(urEnqueueMemBufferFillNegativeTest, InvalidSize) { using urEnqueueMemBufferFillMultiDeviceTest = uur::urMultiDeviceMemBufferQueueTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urEnqueueMemBufferFillMultiDeviceTest); -TEST_F(urEnqueueMemBufferFillMultiDeviceTest, FillReadDifferentQueues) { +TEST_P(urEnqueueMemBufferFillMultiDeviceTest, FillReadDifferentQueues) { // First queue does a fill. const uint32_t input = 42; ASSERT_SUCCESS(urEnqueueMemBufferFill(queues[0], buffer, &input, diff --git a/test/conformance/enqueue/urEnqueueMemBufferMap.cpp b/test/conformance/enqueue/urEnqueueMemBufferMap.cpp index eb06724139..75e4566c1a 100644 --- a/test/conformance/enqueue/urEnqueueMemBufferMap.cpp +++ b/test/conformance/enqueue/urEnqueueMemBufferMap.cpp @@ -4,16 +4,19 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "helpers.h" #include +#include using urEnqueueMemBufferMapTestWithParam = uur::urMemBufferQueueTestWithParam; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urEnqueueMemBufferMapTestWithParam, ::testing::ValuesIn(uur::mem_buffer_test_parameters), uur::printMemBufferTestString); TEST_P(urEnqueueMemBufferMapTestWithParam, SuccessRead) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{"Data Center GPU Max"}); + const std::vector input(count, 42); ASSERT_SUCCESS(urEnqueueMemBufferWrite(queue, buffer, true, 0, size, input.data(), 0, nullptr, nullptr)); @@ -37,12 +40,18 @@ using urEnqueueMemBufferMapTestWithWriteFlagParam = uur::urMemBufferQueueTestWithParam< uur::mem_buffer_map_write_test_parameters_t>; -UUR_TEST_SUITE_P(urEnqueueMemBufferMapTestWithWriteFlagParam, - ::testing::ValuesIn(map_write_test_parameters), - uur::printMemBufferMapWriteTestString< - urEnqueueMemBufferMapTestWithWriteFlagParam>); +UUR_DEVICE_TEST_SUITE_P(urEnqueueMemBufferMapTestWithWriteFlagParam, + ::testing::ValuesIn(map_write_test_parameters), + uur::printMemBufferMapWriteTestString< + urEnqueueMemBufferMapTestWithWriteFlagParam>); TEST_P(urEnqueueMemBufferMapTestWithWriteFlagParam, SuccessWrite) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + + if (getParam().map_flag == UR_MAP_FLAG_WRITE_INVALIDATE_REGION) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + } + const std::vector input(count, 0); ASSERT_SUCCESS(urEnqueueMemBufferWrite(queue, buffer, true, 0, size, input.data(), 0, nullptr, nullptr)); @@ -64,6 +73,8 @@ TEST_P(urEnqueueMemBufferMapTestWithWriteFlagParam, SuccessWrite) { } TEST_P(urEnqueueMemBufferMapTestWithParam, SuccessOffset) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + const std::vector input(count, 0); ASSERT_SUCCESS(urEnqueueMemBufferWrite(queue, buffer, true, 0, size, input.data(), 0, nullptr, nullptr)); @@ -93,6 +104,8 @@ TEST_P(urEnqueueMemBufferMapTestWithParam, SuccessOffset) { } TEST_P(urEnqueueMemBufferMapTestWithParam, SuccessPartialMap) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + const std::vector input(count, 0); ASSERT_SUCCESS(urEnqueueMemBufferWrite(queue, buffer, true, 0, size, input.data(), 0, nullptr, nullptr)); @@ -145,6 +158,8 @@ TEST_P(urEnqueueMemBufferMapTestWithParam, SuccesPinnedRead) { } TEST_P(urEnqueueMemBufferMapTestWithParam, SuccesPinnedWrite) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + const size_t memSize = sizeof(int); const int value = 30; @@ -172,6 +187,8 @@ TEST_P(urEnqueueMemBufferMapTestWithParam, SuccesPinnedWrite) { } TEST_P(urEnqueueMemBufferMapTestWithParam, SuccessMultiMaps) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + const std::vector input(count, 0); ASSERT_SUCCESS(urEnqueueMemBufferWrite(queue, buffer, true, 0, size, input.data(), 0, nullptr, nullptr)); @@ -245,6 +262,8 @@ TEST_P(urEnqueueMemBufferMapTestWithParam, InvalidNullPointerRetMap) { } TEST_P(urEnqueueMemBufferMapTestWithParam, InvalidNullPtrEventWaitList) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + void *map; ASSERT_EQ_RESULT(urEnqueueMemBufferMap(queue, buffer, true, UR_MAP_FLAG_READ | UR_MAP_FLAG_WRITE, @@ -270,6 +289,8 @@ TEST_P(urEnqueueMemBufferMapTestWithParam, InvalidNullPtrEventWaitList) { } TEST_P(urEnqueueMemBufferMapTestWithParam, InvalidSize) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + void *map = nullptr; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, urEnqueueMemBufferMap(queue, buffer, true, 0, 1, size, 0, @@ -278,8 +299,11 @@ TEST_P(urEnqueueMemBufferMapTestWithParam, InvalidSize) { using urEnqueueMemBufferMapMultiDeviceTest = uur::urMultiDeviceMemBufferQueueTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urEnqueueMemBufferMapMultiDeviceTest); + +TEST_P(urEnqueueMemBufferMapMultiDeviceTest, WriteMapDifferentQueues) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); -TEST_F(urEnqueueMemBufferMapMultiDeviceTest, WriteMapDifferentQueues) { // First queue does a blocking write of 42 into the buffer. std::vector input(count, 42); ASSERT_SUCCESS(urEnqueueMemBufferWrite(queues[0], buffer, true, 0, size, diff --git a/test/conformance/enqueue/urEnqueueMemBufferRead.cpp b/test/conformance/enqueue/urEnqueueMemBufferRead.cpp index 5c36ffc11c..ddbc570cae 100644 --- a/test/conformance/enqueue/urEnqueueMemBufferRead.cpp +++ b/test/conformance/enqueue/urEnqueueMemBufferRead.cpp @@ -4,11 +4,12 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "helpers.h" #include +#include using urEnqueueMemBufferReadTestWithParam = uur::urMemBufferQueueTestWithParam; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urEnqueueMemBufferReadTestWithParam, ::testing::ValuesIn(uur::mem_buffer_test_parameters), uur::printMemBufferTestString); @@ -43,6 +44,8 @@ TEST_P(urEnqueueMemBufferReadTestWithParam, InvalidNullPointerDst) { } TEST_P(urEnqueueMemBufferReadTestWithParam, InvalidNullPtrEventWaitList) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + std::vector output(count, 42); ASSERT_EQ_RESULT(urEnqueueMemBufferRead(queue, buffer, true, 0, size, output.data(), 1, nullptr, nullptr), @@ -66,6 +69,8 @@ TEST_P(urEnqueueMemBufferReadTestWithParam, InvalidNullPtrEventWaitList) { } TEST_P(urEnqueueMemBufferReadTestWithParam, InvalidSize) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + std::vector output(count, 42); ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, urEnqueueMemBufferRead(queue, buffer, true, 1, size, @@ -100,6 +105,9 @@ TEST_P(urEnqueueMemBufferReadTestWithParam, Blocking) { } TEST_P(urEnqueueMemBufferReadTestWithParam, NonBlocking) { + // This is a flaky fail. + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + constexpr const size_t memSize = 10u; constexpr const size_t bytes = memSize * sizeof(int); const int data[memSize] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; @@ -132,8 +140,9 @@ TEST_P(urEnqueueMemBufferReadTestWithParam, NonBlocking) { using urEnqueueMemBufferReadMultiDeviceTest = uur::urMultiDeviceMemBufferQueueTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urEnqueueMemBufferReadMultiDeviceTest); -TEST_F(urEnqueueMemBufferReadMultiDeviceTest, WriteReadDifferentQueues) { +TEST_P(urEnqueueMemBufferReadMultiDeviceTest, WriteReadDifferentQueues) { // First queue does a blocking write of 42 into the buffer. std::vector input(count, 42); ASSERT_SUCCESS(urEnqueueMemBufferWrite(queues[0], buffer, true, 0, size, diff --git a/test/conformance/enqueue/urEnqueueMemBufferReadRect.cpp b/test/conformance/enqueue/urEnqueueMemBufferReadRect.cpp index 549f095dfc..af2d04dd51 100644 --- a/test/conformance/enqueue/urEnqueueMemBufferReadRect.cpp +++ b/test/conformance/enqueue/urEnqueueMemBufferReadRect.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "helpers.h" #include +#include // Choose parameters so that we get good coverage and catch some edge cases. static std::vector generateParameterizations() { @@ -71,12 +72,14 @@ static std::vector generateParameterizations() { struct urEnqueueMemBufferReadRectTestWithParam : public uur::urQueueTestWithParam {}; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urEnqueueMemBufferReadRectTestWithParam, testing::ValuesIn(generateParameterizations()), uur::printRectTestString); TEST_P(urEnqueueMemBufferReadRectTestWithParam, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); + // Unpack the parameters. const auto buffer_size = getParam().src_size; const auto host_size = getParam().dst_size; @@ -158,6 +161,8 @@ TEST_P(urEnqueueMemBufferReadRectTest, InvalidNullPointerDst) { } TEST_P(urEnqueueMemBufferReadRectTest, InvalidNullPtrEventWaitList) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + std::vector dst(count); ur_rect_region_t region{size, 1, 1}; ur_rect_offset_t buffer_offset{0, 0, 0}; @@ -189,8 +194,10 @@ TEST_P(urEnqueueMemBufferReadRectTest, InvalidNullPtrEventWaitList) { using urEnqueueMemBufferReadRectMultiDeviceTest = uur::urMultiDeviceMemBufferQueueTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P( + urEnqueueMemBufferReadRectMultiDeviceTest); -TEST_F(urEnqueueMemBufferReadRectMultiDeviceTest, +TEST_P(urEnqueueMemBufferReadRectMultiDeviceTest, WriteRectReadDifferentQueues) { // First queue does a blocking write of 42 into the buffer. // Then a rectangular write the buffer as 1024x1x1 1D. @@ -215,6 +222,8 @@ TEST_F(urEnqueueMemBufferReadRectMultiDeviceTest, } TEST_P(urEnqueueMemBufferReadRectTest, InvalidSize) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + std::vector dst(count); // out-of-bounds access with potential overflow ur_rect_region_t region{size, 1, 1}; diff --git a/test/conformance/enqueue/urEnqueueMemBufferWrite.cpp b/test/conformance/enqueue/urEnqueueMemBufferWrite.cpp index c5ac53f14a..1fa5dfb32c 100644 --- a/test/conformance/enqueue/urEnqueueMemBufferWrite.cpp +++ b/test/conformance/enqueue/urEnqueueMemBufferWrite.cpp @@ -4,11 +4,12 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "helpers.h" #include +#include using urEnqueueMemBufferWriteTestWithParam = uur::urMemBufferQueueTestWithParam; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urEnqueueMemBufferWriteTestWithParam, ::testing::ValuesIn(uur::mem_buffer_test_parameters), uur::printMemBufferTestString); @@ -55,6 +56,8 @@ TEST_P(urEnqueueMemBufferWriteTestWithParam, InvalidNullPointerSrc) { } TEST_P(urEnqueueMemBufferWriteTestWithParam, InvalidNullPtrEventWaitList) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + std::vector input(count, 42); ASSERT_EQ_RESULT(urEnqueueMemBufferWrite(queue, buffer, true, 0, size, input.data(), 1, nullptr, nullptr), @@ -78,6 +81,8 @@ TEST_P(urEnqueueMemBufferWriteTestWithParam, InvalidNullPtrEventWaitList) { } TEST_P(urEnqueueMemBufferWriteTestWithParam, InvalidSize) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + std::vector output(count, 42); ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, urEnqueueMemBufferWrite(queue, buffer, true, 1, size, diff --git a/test/conformance/enqueue/urEnqueueMemBufferWriteRect.cpp b/test/conformance/enqueue/urEnqueueMemBufferWriteRect.cpp index d832fe29ed..48fd4c39fa 100644 --- a/test/conformance/enqueue/urEnqueueMemBufferWriteRect.cpp +++ b/test/conformance/enqueue/urEnqueueMemBufferWriteRect.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "helpers.h" #include +#include static std::vector generateParameterizations() { std::vector parameterizations; @@ -45,22 +46,22 @@ static std::vector generateParameterizations() { 256, 256, 256, 512); // Tests that a 8x8x8 region can be written from a 8x8x8 host buffer at // offset {0,0,0} to a 8x8x8 device buffer at offset {0,0,0}. - PARAMETERIZATION(write_3d, 512, 512, (ur_rect_offset_t{0, 0, 0}), + PARAMETERIZATION(write_3D, 512, 512, (ur_rect_offset_t{0, 0, 0}), (ur_rect_offset_t{0, 0, 0}), (ur_rect_region_t{8, 8, 8}), 8, 64, 8, 64); // Tests that a 4x3x2 region can be written from a 8x8x8 host buffer at // offset {1,2,3} to a 8x8x8 device buffer at offset {4,1,3}. - PARAMETERIZATION(write_3d_with_offsets, 512, 512, + PARAMETERIZATION(write_3D_with_offsets, 512, 512, (ur_rect_offset_t{1, 2, 3}), (ur_rect_offset_t{4, 1, 3}), (ur_rect_region_t{4, 3, 2}), 8, 64, 8, 64); // Tests that a 4x16x2 region can be written from a 8x32x1 host buffer at // offset {1,2,0} to a 8x32x4 device buffer at offset {4,1,3}. - PARAMETERIZATION(write_2d_3d, 256, 1024, (ur_rect_offset_t{1, 2, 0}), + PARAMETERIZATION(write_2D_3D, 256, 1024, (ur_rect_offset_t{1, 2, 0}), (ur_rect_offset_t{4, 1, 3}), (ur_rect_region_t{4, 16, 1}), 8, 256, 8, 256); // Tests that a 1x4x1 region can be written from a 8x16x4 host buffer at // offset {7,3,3} to a 2x8x1 device buffer at offset {1,3,0}. - PARAMETERIZATION(write_3d_2d, 512, 16, (ur_rect_offset_t{7, 3, 3}), + PARAMETERIZATION(write_3D_2D, 512, 16, (ur_rect_offset_t{7, 3, 3}), (ur_rect_offset_t{1, 3, 0}), (ur_rect_region_t{1, 4, 1}), 8, 128, 2, 16); #undef PARAMETERIZATION @@ -70,12 +71,23 @@ static std::vector generateParameterizations() { struct urEnqueueMemBufferWriteRectTestWithParam : public uur::urQueueTestWithParam {}; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urEnqueueMemBufferWriteRectTestWithParam, testing::ValuesIn(generateParameterizations()), uur::printRectTestString); TEST_P(urEnqueueMemBufferWriteRectTestWithParam, Success) { + const auto name = getParam().name; + if (name.find("write_row_2D") != std::string::npos) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + } + + if (name.find("write_3D_2D") != std::string::npos) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + } + + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); + // Unpack the parameters. const auto host_size = getParam().src_size; const auto buffer_size = getParam().dst_size; @@ -165,6 +177,8 @@ TEST_P(urEnqueueMemBufferWriteRectTest, InvalidNullPointerSrc) { } TEST_P(urEnqueueMemBufferWriteRectTest, InvalidNullPtrEventWaitList) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + std::vector src(count); ur_rect_region_t region{size, 1, 1}; ur_rect_offset_t buffer_offset{0, 0, 0}; @@ -195,6 +209,8 @@ TEST_P(urEnqueueMemBufferWriteRectTest, InvalidNullPtrEventWaitList) { } TEST_P(urEnqueueMemBufferWriteRectTest, InvalidSize) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + std::vector src(count); std::fill(src.begin(), src.end(), 1); diff --git a/test/conformance/enqueue/urEnqueueMemImageCopy.cpp b/test/conformance/enqueue/urEnqueueMemImageCopy.cpp index 715fd66773..17c7f7d391 100644 --- a/test/conformance/enqueue/urEnqueueMemImageCopy.cpp +++ b/test/conformance/enqueue/urEnqueueMemImageCopy.cpp @@ -3,6 +3,7 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urEnqueueMemImageCopyTest : public uur::urQueueTestWithParam { @@ -11,6 +12,8 @@ struct urEnqueueMemImageCopyTest uint32_t data[4]; }; void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}, uur::NativeCPU{}); + UUR_RETURN_ON_FATAL_FAILURE(urQueueTestWithParam::SetUp()); ur_bool_t imageSupported; @@ -108,7 +111,7 @@ template inline std::string printImageCopyTestString( const testing::TestParamInfo &info) { // ParamType will be std::tuple - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); const auto image_type = std::get<1>(info.param); @@ -118,12 +121,15 @@ inline std::string printImageCopyTestString( return platform_device_name + "__" + test_name; } -UUR_TEST_SUITE_P(urEnqueueMemImageCopyTest, - testing::ValuesIn({UR_MEM_TYPE_IMAGE1D, UR_MEM_TYPE_IMAGE2D, - UR_MEM_TYPE_IMAGE3D}), - printImageCopyTestString); +UUR_DEVICE_TEST_SUITE_P(urEnqueueMemImageCopyTest, + testing::ValuesIn({UR_MEM_TYPE_IMAGE1D, + UR_MEM_TYPE_IMAGE2D, + UR_MEM_TYPE_IMAGE3D}), + printImageCopyTestString); TEST_P(urEnqueueMemImageCopyTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ASSERT_SUCCESS(urEnqueueMemImageCopy(queue, srcImage, dstImage, {0, 0, 0}, {0, 0, 0}, size, 0, nullptr, nullptr)); std::vector output(buffSize, {1, 1, 1, 1}); @@ -134,6 +140,8 @@ TEST_P(urEnqueueMemImageCopyTest, Success) { } TEST_P(urEnqueueMemImageCopyTest, SuccessPartialCopy) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ASSERT_SUCCESS(urEnqueueMemImageCopy(queue, srcImage, dstImage, {0, 0, 0}, {0, 0, 0}, partialRegion, 0, nullptr, nullptr)); @@ -158,6 +166,8 @@ TEST_P(urEnqueueMemImageCopyTest, SuccessPartialCopy) { } TEST_P(urEnqueueMemImageCopyTest, SuccessPartialCopyWithSrcOffset) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ASSERT_SUCCESS(urEnqueueMemImageCopy(queue, srcImage, dstImage, partialRegionOffset, {0, 0, 0}, partialRegion, 0, nullptr, nullptr)); @@ -182,6 +192,8 @@ TEST_P(urEnqueueMemImageCopyTest, SuccessPartialCopyWithSrcOffset) { } TEST_P(urEnqueueMemImageCopyTest, SuccessPartialCopyWithDstOffset) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ASSERT_SUCCESS(urEnqueueMemImageCopy(queue, srcImage, dstImage, {0, 0, 0}, partialRegionOffset, partialRegion, 0, nullptr, nullptr)); @@ -253,6 +265,8 @@ TEST_P(urEnqueueMemImageCopyTest, InvalidNullPtrEventWaitList) { } TEST_P(urEnqueueMemImageCopyTest, InvalidSize) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, urEnqueueMemImageCopy(queue, srcImage, dstImage, {1, 0, 0}, {0, 0, 0}, size, 0, nullptr, @@ -265,8 +279,9 @@ TEST_P(urEnqueueMemImageCopyTest, InvalidSize) { using urEnqueueMemImageCopyMultiDeviceTest = uur::urMultiDeviceMemImageWriteTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urEnqueueMemImageCopyMultiDeviceTest); -TEST_F(urEnqueueMemImageCopyMultiDeviceTest, CopyReadDifferentQueues) { +TEST_P(urEnqueueMemImageCopyMultiDeviceTest, CopyReadDifferentQueues) { ur_mem_handle_t dstImage1D = nullptr; ASSERT_SUCCESS(urMemImageCreate(context, UR_MEM_FLAG_READ_WRITE, &format, &desc1D, nullptr, &dstImage1D)); diff --git a/test/conformance/enqueue/urEnqueueMemImageRead.cpp b/test/conformance/enqueue/urEnqueueMemImageRead.cpp index af65d6feab..ad0c4b1afa 100644 --- a/test/conformance/enqueue/urEnqueueMemImageRead.cpp +++ b/test/conformance/enqueue/urEnqueueMemImageRead.cpp @@ -3,8 +3,14 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include -using urEnqueueMemImageReadTest = uur::urMemImageQueueTest; +struct urEnqueueMemImageReadTest : uur::urMemImageQueueTest { + void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(uur::urMemImageQueueTest::SetUp()); + } +}; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueMemImageReadTest); // Note that for each test, we multiply the size in pixels by 4 to account for @@ -80,6 +86,8 @@ TEST_P(urEnqueueMemImageReadTest, InvalidNullPtrEventWaitList) { } TEST_P(urEnqueueMemImageReadTest, InvalidOrigin1D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector output(width * 4, 42); ur_rect_offset_t bad_origin{1, 0, 0}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -89,6 +97,8 @@ TEST_P(urEnqueueMemImageReadTest, InvalidOrigin1D) { } TEST_P(urEnqueueMemImageReadTest, InvalidOrigin2D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector output(width * height * 4, 42); ur_rect_offset_t bad_origin{0, 1, 0}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -98,6 +108,8 @@ TEST_P(urEnqueueMemImageReadTest, InvalidOrigin2D) { } TEST_P(urEnqueueMemImageReadTest, InvalidOrigin3D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector output(width * height * depth * 4, 42); ur_rect_offset_t bad_origin{0, 0, 1}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -107,6 +119,8 @@ TEST_P(urEnqueueMemImageReadTest, InvalidOrigin3D) { } TEST_P(urEnqueueMemImageReadTest, InvalidRegion1D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector output(width * 4, 42); ur_rect_region_t bad_region{width + 1, 1, 1}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -116,6 +130,8 @@ TEST_P(urEnqueueMemImageReadTest, InvalidRegion1D) { } TEST_P(urEnqueueMemImageReadTest, InvalidRegion2D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector output(width * height * 4, 42); ur_rect_region_t bad_region{width, height + 1, 1}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -125,6 +141,8 @@ TEST_P(urEnqueueMemImageReadTest, InvalidRegion2D) { } TEST_P(urEnqueueMemImageReadTest, InvalidRegion3D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector output(width * height * depth * 4, 42); ur_rect_region_t bad_region{width, height, depth + 1}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -135,8 +153,9 @@ TEST_P(urEnqueueMemImageReadTest, InvalidRegion3D) { using urEnqueueMemImageReadMultiDeviceTest = uur::urMultiDeviceMemImageWriteTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urEnqueueMemImageReadMultiDeviceTest); -TEST_F(urEnqueueMemImageReadMultiDeviceTest, WriteReadDifferentQueues) { +TEST_P(urEnqueueMemImageReadMultiDeviceTest, WriteReadDifferentQueues) { // The remaining queues do blocking reads from the image1D/2D/3D. Since the // queues target different devices this checks that any devices memory has // been synchronized. diff --git a/test/conformance/enqueue/urEnqueueMemImageWrite.cpp b/test/conformance/enqueue/urEnqueueMemImageWrite.cpp index ab8a652d4b..936b0494d1 100644 --- a/test/conformance/enqueue/urEnqueueMemImageWrite.cpp +++ b/test/conformance/enqueue/urEnqueueMemImageWrite.cpp @@ -3,8 +3,14 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include - -using urEnqueueMemImageWriteTest = uur::urMemImageQueueTest; +#include + +struct urEnqueueMemImageWriteTest : uur::urMemImageQueueTest { + void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(uur::urMemImageQueueTest::SetUp()); + } +}; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueMemImageWriteTest); TEST_P(urEnqueueMemImageWriteTest, Success1D) { @@ -77,6 +83,8 @@ TEST_P(urEnqueueMemImageWriteTest, InvalidNullPtrEventWaitList) { } TEST_P(urEnqueueMemImageWriteTest, InvalidOrigin1D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector input(width * 4, 42); ur_rect_offset_t bad_origin{1, 0, 0}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -86,6 +94,8 @@ TEST_P(urEnqueueMemImageWriteTest, InvalidOrigin1D) { } TEST_P(urEnqueueMemImageWriteTest, InvalidOrigin2D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector input(width * height * 4, 42); ur_rect_offset_t bad_origin{0, 1, 0}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -95,6 +105,8 @@ TEST_P(urEnqueueMemImageWriteTest, InvalidOrigin2D) { } TEST_P(urEnqueueMemImageWriteTest, InvalidOrigin3D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector input(width * height * depth * 4, 42); ur_rect_offset_t bad_origin{0, 0, 1}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -104,6 +116,8 @@ TEST_P(urEnqueueMemImageWriteTest, InvalidOrigin3D) { } TEST_P(urEnqueueMemImageWriteTest, InvalidRegion1D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector input(width * 4, 42); ur_rect_region_t bad_region{width + 1, 1, 1}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -113,6 +127,8 @@ TEST_P(urEnqueueMemImageWriteTest, InvalidRegion1D) { } TEST_P(urEnqueueMemImageWriteTest, InvalidRegion2D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector input(width * height * 4, 42); ur_rect_region_t bad_region{width, height + 1, 1}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -122,6 +138,8 @@ TEST_P(urEnqueueMemImageWriteTest, InvalidRegion2D) { } TEST_P(urEnqueueMemImageWriteTest, InvalidRegion3D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector input(width * height * depth * 4, 42); ur_rect_region_t bad_region{width, height, depth + 1}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, diff --git a/test/conformance/enqueue/urEnqueueMemUnmap.cpp b/test/conformance/enqueue/urEnqueueMemUnmap.cpp index 41b604abeb..8eb42ec136 100644 --- a/test/conformance/enqueue/urEnqueueMemUnmap.cpp +++ b/test/conformance/enqueue/urEnqueueMemUnmap.cpp @@ -24,9 +24,10 @@ struct urEnqueueMemUnmapTestWithParam uint32_t *map = nullptr; }; -UUR_TEST_SUITE_P(urEnqueueMemUnmapTestWithParam, - ::testing::ValuesIn(uur::mem_buffer_test_parameters), - uur::printMemBufferTestString); +UUR_DEVICE_TEST_SUITE_P( + urEnqueueMemUnmapTestWithParam, + ::testing::ValuesIn(uur::mem_buffer_test_parameters), + uur::printMemBufferTestString); TEST_P(urEnqueueMemUnmapTestWithParam, Success) { ASSERT_SUCCESS(urEnqueueMemUnmap(queue, buffer, map, 0, nullptr, nullptr)); @@ -51,6 +52,8 @@ TEST_P(urEnqueueMemUnmapTestWithParam, InvalidNullPtrMap) { } TEST_P(urEnqueueMemUnmapTestWithParam, InvalidNullPtrEventWaitList) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ASSERT_EQ_RESULT(urEnqueueMemUnmap(queue, buffer, map, 1, nullptr, nullptr), UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST); diff --git a/test/conformance/enqueue/urEnqueueTimestampRecording.cpp b/test/conformance/enqueue/urEnqueueTimestampRecording.cpp index d3a97e3b48..42100ef0b5 100644 --- a/test/conformance/enqueue/urEnqueueTimestampRecording.cpp +++ b/test/conformance/enqueue/urEnqueueTimestampRecording.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urEnqueueTimestampRecordingExpTest : uur::urQueueTest { void SetUp() override { @@ -45,6 +46,8 @@ void common_check(ur_event_handle_t event) { } TEST_P(urEnqueueTimestampRecordingExpTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}, uur::CUDA{}); + ur_event_handle_t event = nullptr; ASSERT_SUCCESS( urEnqueueTimestampRecordingExp(queue, false, 0, nullptr, &event)); @@ -54,6 +57,8 @@ TEST_P(urEnqueueTimestampRecordingExpTest, Success) { } TEST_P(urEnqueueTimestampRecordingExpTest, SuccessBlocking) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}, uur::HIP{}, uur::CUDA{}); + ur_event_handle_t event = nullptr; ASSERT_SUCCESS( urEnqueueTimestampRecordingExp(queue, true, 0, nullptr, &event)); diff --git a/test/conformance/enqueue/urEnqueueUSMAdvise.cpp b/test/conformance/enqueue/urEnqueueUSMAdvise.cpp index 10a1e03670..cd52f8413e 100644 --- a/test/conformance/enqueue/urEnqueueUSMAdvise.cpp +++ b/test/conformance/enqueue/urEnqueueUSMAdvise.cpp @@ -4,14 +4,29 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include -using urEnqueueUSMAdviseWithParamTest = - uur::urUSMDeviceAllocTestWithParam; -UUR_TEST_SUITE_P(urEnqueueUSMAdviseWithParamTest, - ::testing::Values(UR_USM_ADVICE_FLAG_DEFAULT), - uur::deviceTestWithParamPrinter); +struct urEnqueueUSMAdviseWithParamTest + : uur::urUSMDeviceAllocTestWithParam { + void SetUp() override { + // The setup for the parent fixture does a urQueueFlush, which isn't + // supported by native cpu. + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + + UUR_RETURN_ON_FATAL_FAILURE( + uur::urUSMDeviceAllocTestWithParam::SetUp()); + } +}; +UUR_DEVICE_TEST_SUITE_P(urEnqueueUSMAdviseWithParamTest, + ::testing::Values(UR_USM_ADVICE_FLAG_DEFAULT), + uur::deviceTestWithParamPrinter); TEST_P(urEnqueueUSMAdviseWithParamTest, Success) { + // HIP and CUDA return UR_RESULT_ERROR_ADAPTER_SPECIFIC to issue a warning + // about the hint being unsupported. + // TODO: codify this in the spec and account for it in the CTS. + UUR_KNOWN_FAILURE_ON(uur::HIP{}, uur::CUDA{}); + ur_event_handle_t advise_event = nullptr; ASSERT_SUCCESS(urEnqueueUSMAdvise(queue, ptr, allocation_size, getParam(), &advise_event)); @@ -28,10 +43,20 @@ TEST_P(urEnqueueUSMAdviseWithParamTest, Success) { ASSERT_SUCCESS(urEventRelease(advise_event)); } -using urEnqueueUSMAdviseTest = uur::urUSMDeviceAllocTest; +struct urEnqueueUSMAdviseTest : uur::urUSMDeviceAllocTest { + void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + uur::urUSMDeviceAllocTest::SetUp(); + } +}; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueUSMAdviseTest); TEST_P(urEnqueueUSMAdviseTest, MultipleParamsSuccess) { + // HIP and CUDA return UR_RESULT_ERROR_ADAPTER_SPECIFIC to issue a warning + // about the hint being unsupported. + // TODO: codify this in the spec and account for it in the CTS. + UUR_KNOWN_FAILURE_ON(uur::HIP{}, uur::CUDA{}); + ASSERT_SUCCESS(urEnqueueUSMAdvise(queue, ptr, allocation_size, UR_USM_ADVICE_FLAG_SET_READ_MOSTLY | UR_USM_ADVICE_FLAG_BIAS_CACHED, @@ -64,6 +89,8 @@ TEST_P(urEnqueueUSMAdviseTest, InvalidSizeZero) { } TEST_P(urEnqueueUSMAdviseTest, InvalidSizeTooLarge) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, urEnqueueUSMAdvise(queue, ptr, allocation_size * 2, UR_USM_ADVICE_FLAG_DEFAULT, nullptr)); diff --git a/test/conformance/enqueue/urEnqueueUSMFill.cpp b/test/conformance/enqueue/urEnqueueUSMFill.cpp index 815c5bd2a5..02a5e6df21 100644 --- a/test/conformance/enqueue/urEnqueueUSMFill.cpp +++ b/test/conformance/enqueue/urEnqueueUSMFill.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct testParametersFill { size_t size; @@ -13,7 +14,7 @@ struct testParametersFill { template inline std::string printFillTestString(const testing::TestParamInfo &info) { - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); std::stringstream test_name; @@ -90,10 +91,12 @@ static std::vector test_cases{ {256, 16}, {256, 32}}; -UUR_TEST_SUITE_P(urEnqueueUSMFillTestWithParam, testing::ValuesIn(test_cases), - printFillTestString); +UUR_DEVICE_TEST_SUITE_P(urEnqueueUSMFillTestWithParam, + testing::ValuesIn(test_cases), + printFillTestString); TEST_P(urEnqueueUSMFillTestWithParam, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); ur_event_handle_t event = nullptr; @@ -113,6 +116,8 @@ TEST_P(urEnqueueUSMFillTestWithParam, Success) { struct urEnqueueUSMFillNegativeTest : uur::urQueueTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + UUR_RETURN_ON_FATAL_FAILURE(uur::urQueueTest::SetUp()); ur_device_usm_access_capability_flags_t device_usm = 0; diff --git a/test/conformance/enqueue/urEnqueueUSMFill2D.cpp b/test/conformance/enqueue/urEnqueueUSMFill2D.cpp index e5d3186b81..84d5d0e3d3 100644 --- a/test/conformance/enqueue/urEnqueueUSMFill2D.cpp +++ b/test/conformance/enqueue/urEnqueueUSMFill2D.cpp @@ -4,7 +4,9 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include + #include +#include struct testParametersFill2D { size_t pitch; @@ -16,7 +18,7 @@ struct testParametersFill2D { template inline std::string printFill2DTestString( const testing::TestParamInfo &info) { - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); std::stringstream test_name; @@ -127,8 +129,9 @@ static std::vector test_cases{ /* Height != power_of_2 && width == power_of_2 && pattern_size == 128 */ {1024, 256, 35, 128}}; -UUR_TEST_SUITE_P(urEnqueueUSMFill2DTestWithParam, testing::ValuesIn(test_cases), - printFill2DTestString); +UUR_DEVICE_TEST_SUITE_P(urEnqueueUSMFill2DTestWithParam, + testing::ValuesIn(test_cases), + printFill2DTestString); TEST_P(urEnqueueUSMFill2DTestWithParam, Success) { @@ -151,6 +154,8 @@ TEST_P(urEnqueueUSMFill2DTestWithParam, Success) { struct urEnqueueUSMFill2DNegativeTest : uur::urQueueTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + UUR_RETURN_ON_FATAL_FAILURE(uur::urQueueTest::SetUp()); ur_device_usm_access_capability_flags_t device_usm = 0; @@ -243,6 +248,8 @@ TEST_P(urEnqueueUSMFill2DNegativeTest, InvalidSize) { } TEST_P(urEnqueueUSMFill2DNegativeTest, OutOfBounds) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); + size_t out_of_bounds = pitch * height + 1; /* Interpret memory as having just one row */ diff --git a/test/conformance/enqueue/urEnqueueUSMMemcpy.cpp b/test/conformance/enqueue/urEnqueueUSMMemcpy.cpp index 9189eaea4d..2c7807e60a 100644 --- a/test/conformance/enqueue/urEnqueueUSMMemcpy.cpp +++ b/test/conformance/enqueue/urEnqueueUSMMemcpy.cpp @@ -4,10 +4,12 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include #include struct urEnqueueUSMMemcpyTest : uur::urQueueTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp()); ur_device_usm_access_capability_flags_t device_usm = 0; @@ -75,6 +77,8 @@ struct urEnqueueUSMMemcpyTest : uur::urQueueTest { * true. */ TEST_P(urEnqueueUSMMemcpyTest, Blocking) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ASSERT_SUCCESS(urEventWait(1, &memset_event)); ASSERT_TRUE(memsetHasFinished()); ASSERT_SUCCESS(urEnqueueUSMMemcpy(queue, true, device_dst, device_src, @@ -87,6 +91,8 @@ TEST_P(urEnqueueUSMMemcpyTest, Blocking) { * UR_EVENT_STATUS_COMPLETE when the blocking parameter is set to true. */ TEST_P(urEnqueueUSMMemcpyTest, BlockingWithEvent) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ur_event_handle_t memcpy_event = nullptr; ASSERT_SUCCESS(urEventWait(1, &memset_event)); ASSERT_TRUE(memsetHasFinished()); @@ -125,6 +131,8 @@ TEST_P(urEnqueueUSMMemcpyTest, NonBlocking) { * the memory. */ TEST_P(urEnqueueUSMMemcpyTest, WaitForDependencies) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ASSERT_SUCCESS(urEnqueueUSMMemcpy(queue, true, device_dst, device_src, allocation_size, 1, &memset_event, nullptr)); @@ -244,8 +252,9 @@ struct urEnqueueUSMMemcpyMultiDeviceTest : uur::urAllDevicesTest { size_t alloc_size = 64; uint8_t fill_pattern = 42; }; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urEnqueueUSMMemcpyMultiDeviceTest); -TEST_F(urEnqueueUSMMemcpyMultiDeviceTest, DeviceToDeviceCopyBlocking) { +TEST_P(urEnqueueUSMMemcpyMultiDeviceTest, DeviceToDeviceCopyBlocking) { ASSERT_SUCCESS(urEnqueueUSMMemcpy(src_queue, true, dst_alloc, src_alloc, alloc_size, 0, nullptr, nullptr)); ASSERT_SUCCESS(urEnqueueUSMMemcpy(dst_queue, true, host_alloc, dst_alloc, @@ -253,7 +262,7 @@ TEST_F(urEnqueueUSMMemcpyMultiDeviceTest, DeviceToDeviceCopyBlocking) { verifyData(); } -TEST_F(urEnqueueUSMMemcpyMultiDeviceTest, DeviceToDeviceCopyNonBlocking) { +TEST_P(urEnqueueUSMMemcpyMultiDeviceTest, DeviceToDeviceCopyNonBlocking) { ur_event_handle_t device_copy_event = nullptr; ASSERT_SUCCESS(urEnqueueUSMMemcpy(src_queue, false, dst_alloc, src_alloc, alloc_size, 0, nullptr, diff --git a/test/conformance/enqueue/urEnqueueUSMMemcpy2D.cpp b/test/conformance/enqueue/urEnqueueUSMMemcpy2D.cpp index e12e79a295..edb8f4c1b1 100644 --- a/test/conformance/enqueue/urEnqueueUSMMemcpy2D.cpp +++ b/test/conformance/enqueue/urEnqueueUSMMemcpy2D.cpp @@ -4,7 +4,9 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "helpers.h" + #include +#include using TestParametersMemcpy2D = std::tuple; @@ -12,6 +14,8 @@ using TestParametersMemcpy2D = struct urEnqueueUSMMemcpy2DTestWithParam : uur::urQueueTestWithParam { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + UUR_RETURN_ON_FATAL_FAILURE( uur::urQueueTestWithParam::SetUp()); @@ -108,7 +112,7 @@ static std::vector test_sizes{ /* Height == 1 && Pitch == width + 1 */ {234, 233, 1}}; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urEnqueueUSMMemcpy2DTestWithParam, ::testing::Combine(::testing::ValuesIn(test_sizes), ::testing::Values(ur_usm_type_t::UR_USM_TYPE_DEVICE, @@ -142,12 +146,13 @@ TEST_P(urEnqueueUSMMemcpy2DTestWithParam, SuccessNonBlocking) { } using urEnqueueUSMMemcpy2DNegativeTest = urEnqueueUSMMemcpy2DTestWithParam; -UUR_TEST_SUITE_P(urEnqueueUSMMemcpy2DNegativeTest, - ::testing::Values(TestParametersMemcpy2D{ - {1, 1, 1}, - ur_usm_type_t::UR_USM_TYPE_DEVICE, - ur_usm_type_t::UR_USM_TYPE_DEVICE}), - uur::print2DTestString); +UUR_DEVICE_TEST_SUITE_P( + urEnqueueUSMMemcpy2DNegativeTest, + ::testing::Values(TestParametersMemcpy2D{ + {1, 1, 1}, + ur_usm_type_t::UR_USM_TYPE_DEVICE, + ur_usm_type_t::UR_USM_TYPE_DEVICE}), + uur::print2DTestString); TEST_P(urEnqueueUSMMemcpy2DNegativeTest, InvalidNullHandleQueue) { ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, diff --git a/test/conformance/enqueue/urEnqueueUSMPrefetch.cpp b/test/conformance/enqueue/urEnqueueUSMPrefetch.cpp index 2b0dbacb74..ccae55624b 100644 --- a/test/conformance/enqueue/urEnqueueUSMPrefetch.cpp +++ b/test/conformance/enqueue/urEnqueueUSMPrefetch.cpp @@ -4,15 +4,35 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include - -using urEnqueueUSMPrefetchWithParamTest = - uur::urUSMDeviceAllocTestWithParam; - -UUR_TEST_SUITE_P(urEnqueueUSMPrefetchWithParamTest, - ::testing::Values(UR_USM_MIGRATION_FLAG_DEFAULT), - uur::deviceTestWithParamPrinter); +#include + +struct urEnqueueUSMPrefetchWithParamTest + : uur::urUSMDeviceAllocTestWithParam { + void SetUp() override { + // The setup for the parent fixture does a urQueueFlush, which isn't + // supported by native cpu. + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + uur::urUSMDeviceAllocTestWithParam::SetUp(); + } +}; + +UUR_DEVICE_TEST_SUITE_P( + urEnqueueUSMPrefetchWithParamTest, + ::testing::Values(UR_USM_MIGRATION_FLAG_DEFAULT), + uur::deviceTestWithParamPrinter); TEST_P(urEnqueueUSMPrefetchWithParamTest, Success) { + UUR_KNOWN_FAILURE_ON( + // HIP and CUDA return UR_RESULT_ERROR_ADAPTER_SPECIFIC to issue a + // warning about the hint being unsupported. The same applies for + // subsequent fails in this file. + // TODO: codify this in the spec and account for it in the CTS. + uur::HIP{}, uur::CUDA{}, + // The setup for the parent fixture does a urQueueFlush, which isn't + // supported by native cpu. Again same goes for subsequent fails in + // this file. + uur::NativeCPU{}); + ur_event_handle_t prefetch_event = nullptr; ASSERT_SUCCESS(urEnqueueUSMPrefetch(queue, ptr, allocation_size, getParam(), 0, nullptr, &prefetch_event)); @@ -32,6 +52,7 @@ TEST_P(urEnqueueUSMPrefetchWithParamTest, Success) { * executing. */ TEST_P(urEnqueueUSMPrefetchWithParamTest, CheckWaitEvent) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}, uur::CUDA{}, uur::NativeCPU{}); ur_queue_handle_t fill_queue; ASSERT_SUCCESS(urQueueCreate(context, device, nullptr, &fill_queue)); @@ -71,7 +92,14 @@ TEST_P(urEnqueueUSMPrefetchWithParamTest, CheckWaitEvent) { ASSERT_SUCCESS(urUSMFree(context, fill_ptr)); } -using urEnqueueUSMPrefetchTest = uur::urUSMDeviceAllocTest; +struct urEnqueueUSMPrefetchTest : uur::urUSMDeviceAllocTest { + void SetUp() override { + // The setup for the parent fixture does a urQueueFlush, which isn't + // supported by native cpu. + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + UUR_RETURN_ON_FATAL_FAILURE(uur::urUSMDeviceAllocTest::SetUp()); + } +}; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueUSMPrefetchTest); TEST_P(urEnqueueUSMPrefetchTest, InvalidNullHandleQueue) { @@ -103,6 +131,9 @@ TEST_P(urEnqueueUSMPrefetchTest, InvalidSizeZero) { } TEST_P(urEnqueueUSMPrefetchTest, InvalidSizeTooLarge) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}, + uur::NativeCPU{}); + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, urEnqueueUSMPrefetch(queue, ptr, allocation_size * 2, UR_USM_MIGRATION_FLAG_DEFAULT, 0, diff --git a/test/conformance/event/event_adapter_cuda.match b/test/conformance/event/event_adapter_cuda.match deleted file mode 100644 index daa3c281bc..0000000000 --- a/test/conformance/event/event_adapter_cuda.match +++ /dev/null @@ -1,6 +0,0 @@ -urEventGetProfilingInfoTest.Success/*__UR_PROFILING_INFO_COMMAND_COMPLETE -urEventGetProfilingInfoWithTimingComparisonTest.Success/* -urEventSetCallbackTest.Success/* -urEventSetCallbackTest.ValidateParameters/* -urEventSetCallbackTest.AllStates/* -urEventSetCallbackTest.EventAlreadyCompleted/* diff --git a/test/conformance/event/event_adapter_hip.match b/test/conformance/event/event_adapter_hip.match deleted file mode 100644 index daa3c281bc..0000000000 --- a/test/conformance/event/event_adapter_hip.match +++ /dev/null @@ -1,6 +0,0 @@ -urEventGetProfilingInfoTest.Success/*__UR_PROFILING_INFO_COMMAND_COMPLETE -urEventGetProfilingInfoWithTimingComparisonTest.Success/* -urEventSetCallbackTest.Success/* -urEventSetCallbackTest.ValidateParameters/* -urEventSetCallbackTest.AllStates/* -urEventSetCallbackTest.EventAlreadyCompleted/* diff --git a/test/conformance/event/event_adapter_level_zero.match b/test/conformance/event/event_adapter_level_zero.match deleted file mode 100644 index e7fe14c234..0000000000 --- a/test/conformance/event/event_adapter_level_zero.match +++ /dev/null @@ -1,10 +0,0 @@ -{{OPT}}urEventGetInfoTest.Success/*__UR_EVENT_INFO_COMMAND_TYPE -{{OPT}}urEventGetProfilingInfoTest.Success/*__UR_PROFILING_INFO_COMMAND_QUEUED -{{OPT}}urEventGetProfilingInfoTest.Success/*__UR_PROFILING_INFO_COMMAND_SUBMIT -{{OPT}}urEventGetProfilingInfoTest.Success/*__UR_PROFILING_INFO_COMMAND_COMPLETE -{{OPT}}urEventGetProfilingInfoWithTimingComparisonTest.Success/* -urEventCreateWithNativeHandleTest.Success/* -urEventSetCallbackTest.AllStates/* -urEventSetCallbackTest.EventAlreadyCompleted/* -urEventSetCallbackTest.Success/* -urEventSetCallbackTest.ValidateParameters/* diff --git a/test/conformance/event/event_adapter_level_zero_v2.match b/test/conformance/event/event_adapter_level_zero_v2.match deleted file mode 100644 index dd70962041..0000000000 --- a/test/conformance/event/event_adapter_level_zero_v2.match +++ /dev/null @@ -1,7 +0,0 @@ -urEventGetProfilingInfoTest.Success/*__UR_PROFILING_INFO_COMMAND_QUEUED -urEventGetProfilingInfoTest.Success/*__UR_PROFILING_INFO_COMMAND_SUBMIT -urEventGetProfilingInfoWithTimingComparisonTest.Success/* -urEventSetCallbackTest.Success/* -urEventSetCallbackTest.ValidateParameters/* -urEventSetCallbackTest.AllStates/* -urEventSetCallbackTest.EventAlreadyCompleted/* diff --git a/test/conformance/event/event_adapter_native_cpu.match b/test/conformance/event/event_adapter_native_cpu.match deleted file mode 100644 index 1716dea0ca..0000000000 --- a/test/conformance/event/event_adapter_native_cpu.match +++ /dev/null @@ -1,17 +0,0 @@ -urEventGetProfilingInfoTest.Success/*__UR_PROFILING_INFO_COMMAND_QUEUED -urEventGetProfilingInfoTest.Success/*__UR_PROFILING_INFO_COMMAND_SUBMIT -urEventGetProfilingInfoTest.Success/*__UR_PROFILING_INFO_COMMAND_COMPLETE -urEventGetProfilingInfoWithTimingComparisonTest.Success/* -urEventGetProfilingInfoNegativeTest.InvalidNullHandle/* -urEventGetProfilingInfoNegativeTest.InvalidValue/* -urEventWaitTest.Success/* -urEventSetCallbackTest.Success/* -urEventSetCallbackTest.ValidateParameters/* -urEventSetCallbackTest.AllStates/* -urEventSetCallbackTest.EventAlreadyCompleted/* - -# These crash when ran through the loader -{{OPT}}urEventRetainTest.InvalidNullHandle/* -{{OPT}}urEventReleaseTest.InvalidNullHandle/* -{{OPT}}urEventGetNativeHandleTest.InvalidNullHandleEvent/* -{{OPT}}urEventSetCallbackNegativeTest.InvalidNullHandleEvent/* diff --git a/test/conformance/event/event_adapter_opencl.match b/test/conformance/event/event_adapter_opencl.match deleted file mode 100644 index 2c65414d2d..0000000000 --- a/test/conformance/event/event_adapter_opencl.match +++ /dev/null @@ -1,3 +0,0 @@ -# Note: This file is only for use with cts_exe.py, not the legacy match checker -# These crash when ran through the loader -{{OPT}}urEventSetCallbackTest.ValidateParameters/* diff --git a/test/conformance/event/urEventCreateWithNativeHandle.cpp b/test/conformance/event/urEventCreateWithNativeHandle.cpp index bfb7113053..75e52f9a07 100644 --- a/test/conformance/event/urEventCreateWithNativeHandle.cpp +++ b/test/conformance/event/urEventCreateWithNativeHandle.cpp @@ -4,12 +4,15 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "fixtures.h" +#include "uur/known_failure.h" #include "uur/raii.h" using urEventCreateWithNativeHandleTest = uur::event::urEventTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEventCreateWithNativeHandleTest); TEST_P(urEventCreateWithNativeHandleTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ur_native_handle_t native_event = 0; UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( diff --git a/test/conformance/event/urEventGetInfo.cpp b/test/conformance/event/urEventGetInfo.cpp index f4c9fa37ff..f72b91f00a 100644 --- a/test/conformance/event/urEventGetInfo.cpp +++ b/test/conformance/event/urEventGetInfo.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "fixtures.h" +#include "uur/known_failure.h" using urEventGetInfoTest = uur::event::urEventTest; @@ -36,6 +37,8 @@ TEST_P(urEventGetInfoTest, SuccessContext) { } TEST_P(urEventGetInfoTest, SuccessCommandType) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ur_event_info_t info_type = UR_EVENT_INFO_COMMAND_TYPE; size_t size = 0; diff --git a/test/conformance/event/urEventGetProfilingInfo.cpp b/test/conformance/event/urEventGetProfilingInfo.cpp index e96b577caf..491030c1df 100644 --- a/test/conformance/event/urEventGetProfilingInfo.cpp +++ b/test/conformance/event/urEventGetProfilingInfo.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "fixtures.h" +#include "uur/known_failure.h" using urEventGetProfilingInfoTest = uur::event::urEventTestWithParam; @@ -11,6 +12,22 @@ using urEventGetProfilingInfoTest = TEST_P(urEventGetProfilingInfoTest, Success) { ur_profiling_info_t info_type = getParam(); + + if (info_type == UR_PROFILING_INFO_COMMAND_COMPLETE) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}, uur::LevelZero{}, + uur::NativeCPU{}); + } + + if (info_type == UR_PROFILING_INFO_COMMAND_QUEUED) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}, + uur::NativeCPU{}); + } + + if (info_type == UR_PROFILING_INFO_COMMAND_SUBMIT) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}, + uur::NativeCPU{}); + } + size_t size; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( urEventGetProfilingInfo(event, info_type, 0, nullptr, &size), @@ -27,17 +44,20 @@ TEST_P(urEventGetProfilingInfoTest, Success) { } } -UUR_TEST_SUITE_P(urEventGetProfilingInfoTest, - ::testing::Values(UR_PROFILING_INFO_COMMAND_QUEUED, - UR_PROFILING_INFO_COMMAND_SUBMIT, - UR_PROFILING_INFO_COMMAND_START, - UR_PROFILING_INFO_COMMAND_END, - UR_PROFILING_INFO_COMMAND_COMPLETE), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urEventGetProfilingInfoTest, + ::testing::Values(UR_PROFILING_INFO_COMMAND_QUEUED, + UR_PROFILING_INFO_COMMAND_SUBMIT, + UR_PROFILING_INFO_COMMAND_START, + UR_PROFILING_INFO_COMMAND_END, + UR_PROFILING_INFO_COMMAND_COMPLETE), + uur::deviceTestWithParamPrinter); using urEventGetProfilingInfoWithTimingComparisonTest = uur::event::urEventTest; TEST_P(urEventGetProfilingInfoWithTimingComparisonTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}, uur::LevelZero{}, + uur::LevelZeroV2{}, uur::NativeCPU{}); + uint8_t size = 8; std::vector queued_data(size); @@ -86,6 +106,8 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P( using urEventGetProfilingInfoNegativeTest = uur::event::urEventTest; TEST_P(urEventGetProfilingInfoNegativeTest, InvalidNullHandle) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_profiling_info_t info_type = UR_PROFILING_INFO_COMMAND_QUEUED; size_t size; ASSERT_SUCCESS( @@ -108,6 +130,8 @@ TEST_P(urEventGetProfilingInfoNegativeTest, InvalidEnumeration) { } TEST_P(urEventGetProfilingInfoNegativeTest, InvalidValue) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_profiling_info_t info_type = UR_PROFILING_INFO_COMMAND_QUEUED; size_t size; ASSERT_SUCCESS( diff --git a/test/conformance/event/urEventSetCallback.cpp b/test/conformance/event/urEventSetCallback.cpp index ac6f988e71..ffcf70aff5 100644 --- a/test/conformance/event/urEventSetCallback.cpp +++ b/test/conformance/event/urEventSetCallback.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "fixtures.h" +#include "uur/known_failure.h" /* Using urEventReferenceTest to be able to release the event during the test */ using urEventSetCallbackTest = uur::event::urEventReferenceTest; @@ -12,6 +13,8 @@ using urEventSetCallbackTest = uur::event::urEventReferenceTest; * Checks that the callback function is called. */ TEST_P(urEventSetCallbackTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}, uur::LevelZero{}, + uur::LevelZeroV2{}, uur::NativeCPU{}); struct Callback { static void callback([[maybe_unused]] ur_event_handle_t hEvent, @@ -37,6 +40,8 @@ TEST_P(urEventSetCallbackTest, Success) { * Check that the callback function parameters are correct */ TEST_P(urEventSetCallbackTest, ValidateParameters) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}, uur::LevelZero{}, + uur::LevelZeroV2{}, uur::OpenCL{}, uur::NativeCPU{}); struct CallbackParameters { ur_event_handle_t event; @@ -70,6 +75,8 @@ TEST_P(urEventSetCallbackTest, ValidateParameters) { * Check that the callback function is called for each execution state. */ TEST_P(urEventSetCallbackTest, AllStates) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}, uur::LevelZero{}, + uur::LevelZeroV2{}, uur::NativeCPU{}); struct CallbackStatus { bool submitted = false; @@ -127,6 +134,8 @@ TEST_P(urEventSetCallbackTest, AllStates) { * completed */ TEST_P(urEventSetCallbackTest, EventAlreadyCompleted) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}, uur::LevelZero{}, + uur::LevelZeroV2{}, uur::NativeCPU{}); ASSERT_SUCCESS(urEventWait(1, &event)); diff --git a/test/conformance/event/urEventWait.cpp b/test/conformance/event/urEventWait.cpp index 1fbfaa09c3..a89d8b76b9 100644 --- a/test/conformance/event/urEventWait.cpp +++ b/test/conformance/event/urEventWait.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urEventWaitTest : uur::urQueueTest { void SetUp() override { @@ -42,6 +43,8 @@ struct urEventWaitTest : uur::urQueueTest { UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEventWaitTest); TEST_P(urEventWaitTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_event_handle_t event1 = nullptr; ASSERT_SUCCESS(urEnqueueMemBufferCopy(queue, src_buffer, dst_buffer, 0, 0, size, 0, nullptr, &event1)); diff --git a/test/conformance/exp_command_buffer/exp_command_buffer_adapter_level_zero_v2.match b/test/conformance/exp_command_buffer/exp_command_buffer_adapter_level_zero_v2.match deleted file mode 100644 index f6efce7966..0000000000 --- a/test/conformance/exp_command_buffer/exp_command_buffer_adapter_level_zero_v2.match +++ /dev/null @@ -1,51 +0,0 @@ -urCommandBufferReleaseExpTest.Success/* -urCommandBufferReleaseExpTest.InvalidNullHandle/* -urCommandBufferRetainExpTest.Success/* -urCommandBufferRetainExpTest.InvalidNullHandle/* -urCommandBufferCommandsTest.urCommandBufferAppendUSMMemcpyExp/* -urCommandBufferCommandsTest.urCommandBufferAppendUSMFillExp/* -urCommandBufferCommandsTest.urCommandBufferAppendMemBufferCopyExp/* -urCommandBufferCommandsTest.urCommandBufferAppendMemBufferCopyRectExp/* -urCommandBufferCommandsTest.urCommandBufferAppendMemBufferReadExp/* -urCommandBufferCommandsTest.urCommandBufferAppendMemBufferReadRectExp/* -urCommandBufferCommandsTest.urCommandBufferAppendMemBufferWriteExp/* -urCommandBufferCommandsTest.urCommandBufferAppendMemBufferWriteRectExp/* -urCommandBufferCommandsTest.urCommandBufferAppendMemBufferFillExp/* -urCommandBufferCommandsTest.urCommandBufferAppendUSMPrefetchExp/* -urCommandBufferCommandsTest.urCommandBufferAppendUSMAdviseExp/* -urCommandBufferAppendKernelLaunchExpTest.Basic/* -urCommandBufferAppendKernelLaunchExpTest.FinalizeTwice/* -urCommandBufferFillCommandsTest.Buffer/* -urCommandBufferFillCommandsTest.USM/* -KernelCommandEventSyncTest.Basic/* -KernelCommandEventSyncTest.InterCommandBuffer/* -KernelCommandEventSyncTest.SignalWaitBeforeEnqueue/* -CommandEventSyncTest.USMMemcpyExp/* -CommandEventSyncTest.USMFillExp/* -CommandEventSyncTest.MemBufferCopyExp/* -CommandEventSyncTest.MemBufferCopyRectExp/* -CommandEventSyncTest.MemBufferReadExp/* -CommandEventSyncTest.MemBufferReadRectExp/* -CommandEventSyncTest.MemBufferWriteExp/* -CommandEventSyncTest.MemBufferWriteRectExp/* -CommandEventSyncTest.MemBufferFillExp/* -CommandEventSyncTest.USMPrefetchExp/* -CommandEventSyncTest.USMAdviseExp/* -CommandEventSyncTest.MultipleEventCommands/* -CommandEventSyncTest.MultipleEventCommandsBetweenCommandBuffers/* -CommandEventSyncTest.USMFillLargePatternExp/* -CommandEventSyncTest.MemBufferFillLargePatternExp/* -CommandEventSyncUpdateTest.USMMemcpyExp/* -CommandEventSyncUpdateTest.USMFillExp/* -CommandEventSyncUpdateTest.MemBufferCopyExp/* -CommandEventSyncUpdateTest.MemBufferCopyRectExp/* -CommandEventSyncUpdateTest.MemBufferReadExp/* -CommandEventSyncUpdateTest.MemBufferReadRectExp/* -CommandEventSyncUpdateTest.MemBufferWriteExp/* -CommandEventSyncUpdateTest.MemBufferWriteRectExp/* -CommandEventSyncUpdateTest.MemBufferFillExp/* -CommandEventSyncUpdateTest.USMPrefetchExp/* -CommandEventSyncUpdateTest.USMAdviseExp/* -CommandEventSyncUpdateTest.MultipleEventCommands/* -CommandEventSyncUpdateTest.USMFillLargePatternExp/* -CommandEventSyncUpdateTest.MemBufferFillLargePatternExp/* diff --git a/test/conformance/exp_command_buffer/exp_command_buffer_adapter_native_cpu.match b/test/conformance/exp_command_buffer/exp_command_buffer_adapter_native_cpu.match deleted file mode 100644 index 5d4ca6fb80..0000000000 --- a/test/conformance/exp_command_buffer/exp_command_buffer_adapter_native_cpu.match +++ /dev/null @@ -1,49 +0,0 @@ -{{OPT}}urCommandBufferReleaseCommandExpTest.Success/* -{{OPT}}urCommandBufferReleaseCommandExpTest.ReleaseCmdBufBeforeHandle/* -{{OPT}}urCommandBufferReleaseCommandExpTest.ReleaseCmdBufMultipleHandles/* -{{OPT}}urCommandBufferReleaseCommandExpTest.InvalidNullHandle/* -{{OPT}}urCommandBufferRetainCommandExpTest.Success/* -{{OPT}}urCommandBufferRetainCommandExpTest.InvalidNullHandle/* -{{OPT}}urCommandBufferAppendKernelLaunchExpTest.Basic/* -{{OPT}}urCommandBufferAppendKernelLaunchExpTest.FinalizeTwice/* -{{OPT}}BufferFillCommandTest.UpdateParameters/* -{{OPT}}BufferFillCommandTest.UpdateGlobalSize/* -{{OPT}}BufferFillCommandTest.SeparateUpdateCalls/* -{{OPT}}BufferFillCommandTest.OverrideUpdate/* -{{OPT}}BufferFillCommandTest.OverrideArgList/* -{{OPT}}InvalidUpdateTest.NotFinalizedCommandBuffer/* -{{OPT}}InvalidUpdateTest.NotUpdatableCommandBuffer/* -{{OPT}}InvalidUpdateTest.InvalidDimensions/* -{{OPT}}USMFillCommandTest.UpdateParameters/* -{{OPT}}USMFillCommandTest.UpdateNull/* -{{OPT}}USMFillCommandTest.UpdateBeforeEnqueue/* -{{OPT}}USMMultipleFillCommandTest.UpdateAllKernels/* -{{OPT}}BufferSaxpyKernelTest.UpdateParameters/* -{{OPT}}USMSaxpyKernelTest.UpdateParameters/* -{{OPT}}USMMultiSaxpyKernelTest.UpdateParameters/* -{{OPT}}USMMultiSaxpyKernelTest.UpdateWithoutBlocking/* -{{OPT}}USMMultiSaxpyKernelTest.UpdateNullptrKernel/* -{{OPT}}NDRangeUpdateTest.Update3D/* -{{OPT}}NDRangeUpdateTest.Update2D/* -{{OPT}}NDRangeUpdateTest.Update1D/* -{{OPT}}NDRangeUpdateTest.ImplToUserDefinedLocalSize/* -{{OPT}}NDRangeUpdateTest.UserToImplDefinedLocalSize/* -{{OPT}}USMSaxpyKernelTest.UpdateParameters/* -{{OPT}}USMMultiSaxpyKernelTest.UpdateParameters/* -{{OPT}}USMMultiSaxpyKernelTest.UpdateWithoutBlocking/* -{{OPT}}KernelCommandEventSyncTest.Basic/* -{{OPT}}KernelCommandEventSyncTest.InterCommandBuffer/* -{{OPT}}KernelCommandEventSyncTest.SignalWaitBeforeEnqueue/* -{{OPT}}KernelCommandEventSyncUpdateTest.Basic/* -{{OPT}}KernelCommandEventSyncUpdateTest.TwoWaitEvents/* -{{OPT}}KernelCommandEventSyncUpdateTest.InvalidWaitUpdate/* -{{OPT}}KernelCommandEventSyncUpdateTest.InvalidSignalUpdate/* -{{OPT}}LocalMemoryUpdateTest.UpdateParametersSameLocalSize/* -{{OPT}}LocalMemoryUpdateTest.UpdateLocalOnly/* -{{OPT}}LocalMemoryUpdateTest.UpdateParametersEmptyLocalSize/* -{{OPT}}LocalMemoryUpdateTest.UpdateParametersSmallerLocalSize/* -{{OPT}}LocalMemoryUpdateTest.UpdateParametersLargerLocalSize/* -{{OPT}}LocalMemoryUpdateTest.UpdateParametersPartialLocalSize/* -{{OPT}}LocalMemoryMultiUpdateTest.UpdateParameters/* -{{OPT}}LocalMemoryMultiUpdateTest.UpdateWithoutBlocking/* -{{OPT}}InvalidUpdateCommandBufferExpExecutionTest.* diff --git a/test/conformance/exp_command_buffer/fill.cpp b/test/conformance/exp_command_buffer/fill.cpp index 278cc4578e..9717a1a2ef 100644 --- a/test/conformance/exp_command_buffer/fill.cpp +++ b/test/conformance/exp_command_buffer/fill.cpp @@ -88,7 +88,7 @@ static std::vector test_cases{ template static std::string printFillTestString(const testing::TestParamInfo &info) { - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); std::stringstream test_name; @@ -98,8 +98,9 @@ printFillTestString(const testing::TestParamInfo &info) { return test_name.str(); } -UUR_TEST_SUITE_P(urCommandBufferFillCommandsTest, testing::ValuesIn(test_cases), - printFillTestString); +UUR_DEVICE_TEST_SUITE_P(urCommandBufferFillCommandsTest, + testing::ValuesIn(test_cases), + printFillTestString); TEST_P(urCommandBufferFillCommandsTest, Buffer) { ASSERT_SUCCESS(urCommandBufferAppendMemBufferFillExp( diff --git a/test/conformance/exp_command_buffer/fixtures.h b/test/conformance/exp_command_buffer/fixtures.h index 959b3e7bb1..242af1121e 100644 --- a/test/conformance/exp_command_buffer/fixtures.h +++ b/test/conformance/exp_command_buffer/fixtures.h @@ -7,7 +7,9 @@ #define UR_CONFORMANCE_COMMAND_BUFFER_FIXTURES_H_INCLUDED #include + #include +#include namespace uur { namespace command_buffer { @@ -52,6 +54,8 @@ static void checkCommandBufferUpdateSupport( struct urCommandBufferExpTest : uur::urContextTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(uur::urContextTest::SetUp()); UUR_RETURN_ON_FATAL_FAILURE(checkCommandBufferSupport(device)); @@ -73,6 +77,8 @@ struct urCommandBufferExpTest : uur::urContextTest { template struct urCommandBufferExpTestWithParam : urQueueTestWithParam { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(uur::urQueueTestWithParam::SetUp()); UUR_RETURN_ON_FATAL_FAILURE(checkCommandBufferSupport(this->device)); @@ -93,6 +99,8 @@ struct urCommandBufferExpTestWithParam : urQueueTestWithParam { struct urCommandBufferExpExecutionTest : uur::urKernelExecutionTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(uur::urKernelExecutionTest::SetUp()); UUR_RETURN_ON_FATAL_FAILURE(checkCommandBufferSupport(device)); @@ -113,6 +121,8 @@ struct urCommandBufferExpExecutionTest : uur::urKernelExecutionTest { struct urUpdatableCommandBufferExpTest : uur::urQueueTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(uur::urQueueTest::SetUp()); UUR_RETURN_ON_FATAL_FAILURE(checkCommandBufferSupport(device)); @@ -148,6 +158,8 @@ struct urUpdatableCommandBufferExpTest : uur::urQueueTest { struct urUpdatableCommandBufferExpExecutionTest : uur::urKernelExecutionTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(uur::urKernelExecutionTest::SetUp()); ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND, @@ -244,8 +256,8 @@ struct TestKernel { ASSERT_SUCCESS(urPlatformGetInfo(Platform, UR_PLATFORM_INFO_BACKEND, sizeof(Backend), &Backend, nullptr)); - ASSERT_NO_FATAL_FAILURE( - uur::KernelsEnvironment::instance->LoadSource(Name, ILBinary)); + ASSERT_NO_FATAL_FAILURE(uur::KernelsEnvironment::instance->LoadSource( + Name, Platform, ILBinary)); const ur_program_properties_t Properties = { UR_STRUCTURE_TYPE_PROGRAM_PROPERTIES, nullptr, diff --git a/test/conformance/exp_enqueue_native/enqueue_native_cuda.cpp b/test/conformance/exp_enqueue_native/enqueue_native_cuda.cpp index 8029d3ce6f..a7e4405d52 100644 --- a/test/conformance/exp_enqueue_native/enqueue_native_cuda.cpp +++ b/test/conformance/exp_enqueue_native/enqueue_native_cuda.cpp @@ -5,14 +5,25 @@ #include #include +#include #include using T = uint32_t; struct urCudaEnqueueNativeCommandTest : uur::urQueueTest { void SetUp() { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(uur::urQueueTest::SetUp()); + ur_bool_t native_enqueue_support = false; + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP, + sizeof(native_enqueue_support), &native_enqueue_support, nullptr)); + if (!native_enqueue_support) { + GTEST_SKIP(); + } + host_vec = std::vector(global_size, 0); ASSERT_EQ(host_vec.size(), global_size); ASSERT_SUCCESS(urUSMDeviceAlloc(context, device, nullptr, nullptr, diff --git a/test/conformance/exp_enqueue_native/exp_enqueue_native_adapter_level_zero_v2.match b/test/conformance/exp_enqueue_native/exp_enqueue_native_adapter_level_zero_v2.match deleted file mode 100644 index f8cf4c4c88..0000000000 --- a/test/conformance/exp_enqueue_native/exp_enqueue_native_adapter_level_zero_v2.match +++ /dev/null @@ -1,4 +0,0 @@ -urLevelZeroEnqueueNativeCommandTest.Success* -urLevelZeroEnqueueNativeCommandTest.Dependencies* -urLevelZeroEnqueueNativeCommandTest.DependenciesURBefore* -urLevelZeroEnqueueNativeCommandTest.DependenciesURAfter* diff --git a/test/conformance/exp_launch_properties/exp_launch_properties_adapter_native_cpu.match b/test/conformance/exp_launch_properties/exp_launch_properties_adapter_native_cpu.match deleted file mode 100644 index 4a4837c5ab..0000000000 --- a/test/conformance/exp_launch_properties/exp_launch_properties_adapter_native_cpu.match +++ /dev/null @@ -1 +0,0 @@ -urEnqueueKernelLaunchCustomTest.Success/* diff --git a/test/conformance/exp_launch_properties/launch_properties.cpp b/test/conformance/exp_launch_properties/launch_properties.cpp index 23ba56ff4b..bb3bdd426b 100644 --- a/test/conformance/exp_launch_properties/launch_properties.cpp +++ b/test/conformance/exp_launch_properties/launch_properties.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urEnqueueKernelLaunchCustomTest : uur::urKernelExecutionTest { void SetUp() override { @@ -19,6 +20,7 @@ struct urEnqueueKernelLaunchCustomTest : uur::urKernelExecutionTest { UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueKernelLaunchCustomTest); TEST_P(urEnqueueKernelLaunchCustomTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); size_t returned_size; ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_EXTENSIONS, 0, diff --git a/test/conformance/exp_usm_p2p/usm_p2p.cpp b/test/conformance/exp_usm_p2p/usm_p2p.cpp index 94a566914c..599e0f8817 100644 --- a/test/conformance/exp_usm_p2p/usm_p2p.cpp +++ b/test/conformance/exp_usm_p2p/usm_p2p.cpp @@ -4,11 +4,11 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "uur/fixtures.h" -#include "uur/raii.h" using urP2PTest = uur::urAllDevicesTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urP2PTest); -TEST_F(urP2PTest, Success) { +TEST_P(urP2PTest, Success) { if (devices.size() < 2) { GTEST_SKIP(); diff --git a/test/conformance/integration/QueueBuffer.cpp b/test/conformance/integration/QueueBuffer.cpp index d801ebf684..3ff05057ec 100644 --- a/test/conformance/integration/QueueBuffer.cpp +++ b/test/conformance/integration/QueueBuffer.cpp @@ -6,9 +6,13 @@ #include "fixtures.h" #include #include +#include struct QueueBufferTestWithParam : uur::IntegrationQueueTestWithParam { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}, + uur::NativeCPU{}); + program_name = "cpy_and_mult"; UUR_RETURN_ON_FATAL_FAILURE( uur::IntegrationQueueTestWithParam::SetUp()); @@ -31,10 +35,11 @@ struct QueueBufferTestWithParam : uur::IntegrationQueueTestWithParam { ur_mem_handle_t Buffer2 = nullptr; }; -UUR_TEST_SUITE_P(QueueBufferTestWithParam, - testing::Values(0, /* In-Order */ - UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE), - uur::IntegrationQueueTestWithParam::paramPrinter); +UUR_DEVICE_TEST_SUITE_P( + QueueBufferTestWithParam, + testing::Values(0, /* In-Order */ + UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE), + uur::IntegrationQueueTestWithParam::paramPrinter); /* Submits multiple kernels that interact with each other by accessing and * writing to the same buffers. diff --git a/test/conformance/integration/QueueEmptyStatus.cpp b/test/conformance/integration/QueueEmptyStatus.cpp index fd49ae7915..c7a3c8b81f 100644 --- a/test/conformance/integration/QueueEmptyStatus.cpp +++ b/test/conformance/integration/QueueEmptyStatus.cpp @@ -6,10 +6,13 @@ #include "fixtures.h" #include #include +#include struct QueueEmptyStatusTestWithParam : uur::IntegrationQueueTestWithParam { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}, + uur::NativeCPU{}); program_name = "multiply"; UUR_RETURN_ON_FATAL_FAILURE( @@ -98,10 +101,11 @@ struct QueueEmptyStatusTestWithParam : uur::IntegrationQueueTestWithParam { void *SharedMem = nullptr; }; -UUR_TEST_SUITE_P(QueueEmptyStatusTestWithParam, - testing::Values(0, /* In-Order */ - UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE), - uur::IntegrationQueueTestWithParam::paramPrinter); +UUR_DEVICE_TEST_SUITE_P( + QueueEmptyStatusTestWithParam, + testing::Values(0, /* In-Order */ + UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE), + uur::IntegrationQueueTestWithParam::paramPrinter); /* Submits kernels that have a dependency on each other and checks that the * queue submits all the work in the correct order to the device. diff --git a/test/conformance/integration/QueueUSM.cpp b/test/conformance/integration/QueueUSM.cpp index 1a48576a05..18056fd38e 100644 --- a/test/conformance/integration/QueueUSM.cpp +++ b/test/conformance/integration/QueueUSM.cpp @@ -6,9 +6,13 @@ #include "fixtures.h" #include #include +#include struct QueueUSMTestWithParam : uur::IntegrationQueueTestWithParam { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}, + uur::NativeCPU{}); + program_name = "cpy_and_mult_usm"; UUR_RETURN_ON_FATAL_FAILURE( uur::IntegrationQueueTestWithParam::SetUp()); @@ -30,8 +34,12 @@ struct QueueUSMTestWithParam : uur::IntegrationQueueTestWithParam { } void TearDown() override { - ASSERT_SUCCESS(urUSMFree(context, DeviceMem1)); - ASSERT_SUCCESS(urUSMFree(context, DeviceMem2)); + if (DeviceMem1) { + ASSERT_SUCCESS(urUSMFree(context, DeviceMem1)); + } + if (DeviceMem2) { + ASSERT_SUCCESS(urUSMFree(context, DeviceMem2)); + } uur::IntegrationQueueTestWithParam::TearDown(); } @@ -50,10 +58,11 @@ struct QueueUSMTestWithParam : uur::IntegrationQueueTestWithParam { void *DeviceMem2 = nullptr; }; -UUR_TEST_SUITE_P(QueueUSMTestWithParam, - testing::Values(0, /* In-Order */ - UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE), - uur::IntegrationQueueTestWithParam::paramPrinter); +UUR_DEVICE_TEST_SUITE_P( + QueueUSMTestWithParam, + testing::Values(0, /* In-Order */ + UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE), + uur::IntegrationQueueTestWithParam::paramPrinter); /* Submits multiple kernels that interact with each other by accessing and * writing to the same USM memory locations. diff --git a/test/conformance/integration/fixtures.h b/test/conformance/integration/fixtures.h index aca70a5245..2fa9d9f54f 100644 --- a/test/conformance/integration/fixtures.h +++ b/test/conformance/integration/fixtures.h @@ -54,10 +54,10 @@ struct IntegrationQueueTestWithParam static constexpr size_t ArraySize = 100; static constexpr uint32_t InitialValue = 100; - static std::string - paramPrinter(const ::testing::TestParamInfo< - std::tuple> &info) { - auto device = std::get<0>(info.param); + static std::string paramPrinter( + const ::testing::TestParamInfo> + &info) { + auto device = std::get<0>(info.param).device; auto param = std::get<1>(info.param); std::stringstream ss; diff --git a/test/conformance/integration/integration_adapter_level_zero.match b/test/conformance/integration/integration_adapter_level_zero.match deleted file mode 100644 index 460aa8cf4e..0000000000 --- a/test/conformance/integration/integration_adapter_level_zero.match +++ /dev/null @@ -1,3 +0,0 @@ -{{OPT}}QueueEmptyStatusTestWithParam.QueueEmptyStatusTest/* -{{OPT}}QueueUSMTestWithParam.QueueUSMTest/* -{{OPT}}QueueBufferTestWithParam.QueueBufferTest/* diff --git a/test/conformance/integration/integration_adapter_level_zero_v2.match b/test/conformance/integration/integration_adapter_level_zero_v2.match deleted file mode 100644 index 460aa8cf4e..0000000000 --- a/test/conformance/integration/integration_adapter_level_zero_v2.match +++ /dev/null @@ -1,3 +0,0 @@ -{{OPT}}QueueEmptyStatusTestWithParam.QueueEmptyStatusTest/* -{{OPT}}QueueUSMTestWithParam.QueueUSMTest/* -{{OPT}}QueueBufferTestWithParam.QueueBufferTest/* diff --git a/test/conformance/integration/integration_adapter_native_cpu.match b/test/conformance/integration/integration_adapter_native_cpu.match deleted file mode 100644 index fe5e7567ed..0000000000 --- a/test/conformance/integration/integration_adapter_native_cpu.match +++ /dev/null @@ -1,3 +0,0 @@ -QueueEmptyStatusTestWithParam.QueueEmptyStatusTest/* -QueueUSMTestWithParam.QueueUSMTest/* -QueueBufferTestWithParam.QueueBufferTest/* diff --git a/test/conformance/kernel/kernel_adapter_cuda.match b/test/conformance/kernel/kernel_adapter_cuda.match deleted file mode 100644 index 8fa606404e..0000000000 --- a/test/conformance/kernel/kernel_adapter_cuda.match +++ /dev/null @@ -1,9 +0,0 @@ -urKernelGetGroupInfoFixedWorkGroupSizeTest.CompileWorkGroupSize/* -urKernelGetGroupInfoMaxWorkGroupSizeTest.CompileMaxWorkGroupSize/* -urKernelGetGroupInfoMaxWorkGroupSizeTest.CompileMaxLinearWorkGroupSize/* -urKernelGetSubGroupInfoFixedSubGroupSizeTest.CompileNumSubGroups/* -{{OPT}}urKernelSetArgLocalTest.InvalidKernelArgumentIndex/* -{{OPT}}urKernelSetArgMemObjTest.InvalidKernelArgumentIndex/* -{{OPT}}urKernelSetArgPointerNegativeTest.InvalidKernelArgumentIndex/* -{{OPT}}urKernelSetArgSamplerTest.InvalidKernelArgumentIndex/* -{{OPT}}urKernelSetArgValueTest.InvalidKernelArgumentIndex/* diff --git a/test/conformance/kernel/kernel_adapter_hip.match b/test/conformance/kernel/kernel_adapter_hip.match deleted file mode 100644 index 59d417902c..0000000000 --- a/test/conformance/kernel/kernel_adapter_hip.match +++ /dev/null @@ -1,7 +0,0 @@ -urKernelGetGroupInfoFixedWorkGroupSizeTest.CompileWorkGroupSize/* -urKernelGetSubGroupInfoFixedSubGroupSizeTest.CompileNumSubGroups/* -urKernelSetArgLocalTest.InvalidKernelArgumentIndex/* -urKernelSetArgMemObjTest.InvalidKernelArgumentIndex/* -urKernelSetArgPointerNegativeTest.InvalidKernelArgumentIndex/* -urKernelSetArgValueTest.InvalidKernelArgumentIndex/* -urKernelSetArgValueTest.InvalidKernelArgumentSize/* diff --git a/test/conformance/kernel/kernel_adapter_level_zero.match b/test/conformance/kernel/kernel_adapter_level_zero.match deleted file mode 100644 index 67880465fb..0000000000 --- a/test/conformance/kernel/kernel_adapter_level_zero.match +++ /dev/null @@ -1,8 +0,0 @@ -# Match tests that use fixed_sg_size.cpp as it fails to compile on some -# hardware. -{{OPT}}urKernelGetSubGroupInfoFixedSubGroupSizeTest.CompileNumSubGroups/* - -urKernelSetExecInfoTest.SuccessIndirectAccess/* -urKernelSetExecInfoUSMPointersTest.SuccessHost/* -urKernelSetExecInfoUSMPointersTest.SuccessDevice/* -urKernelSetExecInfoUSMPointersTest.SuccessShared/* diff --git a/test/conformance/kernel/kernel_adapter_level_zero_v2.match b/test/conformance/kernel/kernel_adapter_level_zero_v2.match deleted file mode 100644 index 67880465fb..0000000000 --- a/test/conformance/kernel/kernel_adapter_level_zero_v2.match +++ /dev/null @@ -1,8 +0,0 @@ -# Match tests that use fixed_sg_size.cpp as it fails to compile on some -# hardware. -{{OPT}}urKernelGetSubGroupInfoFixedSubGroupSizeTest.CompileNumSubGroups/* - -urKernelSetExecInfoTest.SuccessIndirectAccess/* -urKernelSetExecInfoUSMPointersTest.SuccessHost/* -urKernelSetExecInfoUSMPointersTest.SuccessDevice/* -urKernelSetExecInfoUSMPointersTest.SuccessShared/* diff --git a/test/conformance/kernel/kernel_adapter_native_cpu.match b/test/conformance/kernel/kernel_adapter_native_cpu.match deleted file mode 100644 index 81e557226e..0000000000 --- a/test/conformance/kernel/kernel_adapter_native_cpu.match +++ /dev/null @@ -1,104 +0,0 @@ -urKernelCreateTest.Success/* -urKernelCreateTest.InvalidNullHandleProgram/* -urKernelCreateTest.InvalidNullPointerName/* -urKernelCreateTest.InvalidNullPointerKernel/* -urKernelCreateTest.InvalidKernelName/* -urKernelCreateWithNativeHandleTest.Success/* -urKernelCreateWithNativeHandleTest.InvalidNullHandleContext/* -urKernelCreateWithNativeHandleTest.InvalidNullPointerNativeKernel/* -urKernelGetGroupInfoFixedWorkGroupSizeTest.CompileWorkGroupSize/* -urKernelGetGroupInfoMaxWorkGroupSizeTest.CompileMaxWorkGroupSize/* -urKernelGetGroupInfoMaxWorkGroupSizeTest.CompileMaxLinearWorkGroupSize/* -urKernelGetGroupInfoTest.GlobalWorkSize/* -urKernelGetGroupInfoTest.WorkGroupSize/* -urKernelGetGroupInfoTest.LocalMemSize/* -urKernelGetGroupInfoTest.PreferredWorkGroupSizeMultiple/* -urKernelGetGroupInfoTest.PrivateMemSize/* -urKernelGetGroupInfoTest.CompileWorkGroupSizeEmpty/* -urKernelGetGroupInfoTest.CompileMaxWorkGroupSizeEmpty/* -urKernelGetGroupInfoTest.InvalidNullHandleKernel/* -urKernelGetGroupInfoTest.InvalidNullHandleDevice/* -urKernelGetGroupInfoTest.InvalidEnumeration/* -urKernelGetInfoTest.FunctionName/* -urKernelGetInfoTest.NumArgs/* -urKernelGetInfoTest.ReferenceCount/* -urKernelGetInfoTest.Context/* -urKernelGetInfoTest.Program/* -urKernelGetInfoTest.Attributes/* -urKernelGetInfoTest.NumRegs/* -urKernelGetInfoTest.KernelNameCorrect/* -urKernelGetInfoTest.KernelContextCorrect/* -urKernelGetInfoTest.InvalidNullHandleKernel/* -urKernelGetInfoTest.InvalidEnumeration/* -urKernelGetInfoTest.InvalidSizeZero/* -urKernelGetInfoTest.InvalidSizeSmall/* -urKernelGetInfoTest.InvalidNullPointerPropValue/* -urKernelGetInfoTest.InvalidNullPointerPropSizeRet/* -urKernelGetNativeHandleTest.Success/* -urKernelGetNativeHandleTest.InvalidNullHandleKernel/* -urKernelGetNativeHandleTest.InvalidNullPointerNativeKernel/* -urKernelGetSubGroupInfoFixedSubGroupSizeTest.CompileNumSubGroups/* -urKernelGetSubGroupInfoTest.MaxSubGroupSize/* -urKernelGetSubGroupInfoTest.MaxNumSubGroups/* -urKernelGetSubGroupInfoTest.SubGroupSizeIntel/* -urKernelGetSubGroupInfoTest.CompileNumSubgroupsIsZero/* -urKernelGetSubGroupInfoTest.InvalidNullHandleKernel/* -urKernelGetSubGroupInfoTest.InvalidNullHandleDevice/* -urKernelGetSubGroupInfoTest.InvalidEnumeration/* -urKernelReleaseTest.Success/* -urKernelReleaseTest.CheckReferenceCount/* -urKernelReleaseTest.KernelReleaseAfterProgramRelease/* -urKernelReleaseTest.InvalidNullHandleKernel/* -urKernelRetainTest.Success/* -urKernelRetainTest.CheckReferenceCount/* -urKernelRetainTest.InvalidNullHandleKernel/* -urKernelSetArgLocalTest.Success/* -urKernelSetArgLocalTest.InvalidNullHandleKernel/* -urKernelSetArgLocalTest.InvalidKernelArgumentIndex/* -urKernelSetArgLocalMultiTest.Basic/* -urKernelSetArgLocalMultiTest.ReLaunch/* -urKernelSetArgLocalMultiTest.Overwrite/* -urKernelSetArgMemObjTest.Success/* -urKernelSetArgMemObjTest.InvalidNullHandleKernel/* -urKernelSetArgMemObjTest.InvalidKernelArgumentIndex/* -urKernelSetArgMemObjTest.InvalidEnumeration/* -urKernelSetArgPointerTest.SuccessHost/* -urKernelSetArgPointerTest.SuccessDevice/* -urKernelSetArgPointerTest.SuccessShared/* -urKernelSetArgPointerNegativeTest.InvalidNullHandleKernel/* -urKernelSetArgPointerNegativeTest.InvalidKernelArgumentIndex/* -urKernelSetArgSamplerTestWithParam.Success/* -urKernelSetArgSamplerTest.SuccessWithProps/* -urKernelSetArgSamplerTest.InvalidNullHandleKernel/* -urKernelSetArgSamplerTest.InvalidNullHandleArgValue/* -urKernelSetArgSamplerTest.InvalidKernelArgumentIndex/* -urKernelSetArgValueTest.Success/* -urKernelSetArgValueTest.InvalidNullHandleKernel/* -urKernelSetArgValueTest.InvalidNullPointerArgValue/* -urKernelSetArgValueTest.InvalidKernelArgumentIndex/* -urKernelSetArgValueTest.InvalidKernelArgumentSize/* -urKernelSetExecInfoTest.SuccessIndirectAccess/* -urKernelSetExecInfoTest.InvalidNullHandleKernel/* -urKernelSetExecInfoTest.InvalidEnumeration/* -urKernelSetExecInfoTest.InvalidNullPointerPropValue/* -urKernelSetExecInfoUSMPointersTest.SuccessHost/* -urKernelSetExecInfoUSMPointersTest.SuccessDevice/* -urKernelSetExecInfoUSMPointersTest.SuccessShared/* -urKernelSetExecInfoCacheConfigTest.Success/* -urKernelSetSpecializationConstantsTest.Success/* -urKernelSetSpecializationConstantsTest.InvalidNullHandleKernel/* -urKernelSetSpecializationConstantsTest.InvalidNullPointerSpecConstants/* -urKernelSetSpecializationConstantsTest.InvalidSizeCount/* -urKernelSetSpecializationConstantsTest.InvalidValueSize/* -urKernelSetSpecializationConstantsTest.InvalidValueId/* -urKernelSetSpecializationConstantsTest.InvalidValuePtr/* -urKernelSetSpecializationConstantsNegativeTest.Unsupported/* -urKernelGetSuggestedLocalWorkSizeTest.Success/* -urKernelGetSuggestedLocalWorkSizeTest.Success2D/* -urKernelGetSuggestedLocalWorkSizeTest.Success3D/* -urKernelGetSuggestedLocalWorkSizeTest.InvalidNullHandleKernel/* -urKernelGetSuggestedLocalWorkSizeTest.InvalidNullHandleQueue/* -urKernelGetSuggestedLocalWorkSizeTest.InvalidWorkDimension/* -urKernelGetSuggestedLocalWorkSizeTest.InvalidGlobalOffset/* -urKernelGetSuggestedLocalWorkSizeTest.InvalidGlobalSize/* -urKernelGetSuggestedLocalWorkSizeTest.InvalidSuggestedLocalWorkSize/* diff --git a/test/conformance/kernel/urKernelCreate.cpp b/test/conformance/kernel/urKernelCreate.cpp index 4629d3f87e..bc43b6dbd1 100644 --- a/test/conformance/kernel/urKernelCreate.cpp +++ b/test/conformance/kernel/urKernelCreate.cpp @@ -26,7 +26,7 @@ struct urKernelCreateTest : uur::urProgramTest { std::string kernel_name; ur_kernel_handle_t kernel = nullptr; }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelCreateTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urKernelCreateTest); TEST_P(urKernelCreateTest, Success) { ASSERT_SUCCESS(urKernelCreate(program, kernel_name.data(), &kernel)); @@ -54,8 +54,9 @@ TEST_P(urKernelCreateTest, InvalidKernelName) { } using urMultiDeviceKernelCreateTest = uur::urMultiDeviceQueueTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urMultiDeviceKernelCreateTest); -TEST_F(urMultiDeviceKernelCreateTest, WithProgramBuild) { +TEST_P(urMultiDeviceKernelCreateTest, WithProgramBuild) { constexpr size_t global_offset = 0; constexpr size_t n_dimensions = 1; constexpr size_t global_size = 100; @@ -65,9 +66,8 @@ TEST_F(urMultiDeviceKernelCreateTest, WithProgramBuild) { uur::KernelsEnvironment::instance->GetEntryPointNames("foo")[0]; std::shared_ptr> il_binary; - uur::KernelsEnvironment::instance->LoadSource("foo", il_binary); + uur::KernelsEnvironment::instance->LoadSource("foo", platform, il_binary); - auto &devices = uur::KernelsEnvironment::instance->devices; for (size_t i = 0; i < devices.size(); i++) { uur::raii::Program program; uur::raii::Kernel kernel; @@ -90,7 +90,7 @@ TEST_F(urMultiDeviceKernelCreateTest, WithProgramBuild) { } } -TEST_F(urMultiDeviceKernelCreateTest, WithProgramCompileAndLink) { +TEST_P(urMultiDeviceKernelCreateTest, WithProgramCompileAndLink) { constexpr size_t global_offset = 0; constexpr size_t n_dimensions = 1; constexpr size_t global_size = 100; @@ -100,9 +100,8 @@ TEST_F(urMultiDeviceKernelCreateTest, WithProgramCompileAndLink) { uur::KernelsEnvironment::instance->GetEntryPointNames("foo")[0]; std::shared_ptr> il_binary; - uur::KernelsEnvironment::instance->LoadSource("foo", il_binary); + uur::KernelsEnvironment::instance->LoadSource("foo", platform, il_binary); - auto &devices = uur::KernelsEnvironment::instance->devices; for (size_t i = 0; i < devices.size(); i++) { uur::raii::Program program; uur::raii::Kernel kernel; diff --git a/test/conformance/kernel/urKernelCreateWithNativeHandle.cpp b/test/conformance/kernel/urKernelCreateWithNativeHandle.cpp index 1c7acf5fab..f10738ba4e 100644 --- a/test/conformance/kernel/urKernelCreateWithNativeHandle.cpp +++ b/test/conformance/kernel/urKernelCreateWithNativeHandle.cpp @@ -28,7 +28,7 @@ struct urKernelCreateWithNativeHandleTest : uur::urKernelTest { false /*isNativeHandleOwned*/ }; }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelCreateWithNativeHandleTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urKernelCreateWithNativeHandleTest); TEST_P(urKernelCreateWithNativeHandleTest, Success) { UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urKernelCreateWithNativeHandle( diff --git a/test/conformance/kernel/urKernelGetGroupInfo.cpp b/test/conformance/kernel/urKernelGetGroupInfo.cpp index 227836f16a..2562761025 100644 --- a/test/conformance/kernel/urKernelGetGroupInfo.cpp +++ b/test/conformance/kernel/urKernelGetGroupInfo.cpp @@ -6,6 +6,7 @@ #include "ur_api.h" #include #include +#include struct urKernelGetGroupInfoFixedWorkGroupSizeTest : uur::urKernelTest { void SetUp() override { @@ -22,6 +23,8 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urKernelGetGroupInfoFixedWorkGroupSizeTest); struct urKernelGetGroupInfoMaxWorkGroupSizeTest : uur::urKernelTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}, + uur::OpenCL{"13th Gen", "Intel(R) Xeon"}); program_name = "max_wg_size"; UUR_RETURN_ON_FATAL_FAILURE(urKernelTest::SetUp()); } @@ -69,6 +72,8 @@ TEST_P(urKernelGetGroupInfoTest, WorkGroupSize) { } TEST_P(urKernelGetGroupInfoFixedWorkGroupSizeTest, CompileWorkGroupSize) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}); + auto property_name = UR_KERNEL_GROUP_INFO_COMPILE_WORK_GROUP_SIZE; size_t property_size = 0; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( diff --git a/test/conformance/kernel/urKernelGetInfo.cpp b/test/conformance/kernel/urKernelGetInfo.cpp index cfee485f54..1a98aea30b 100644 --- a/test/conformance/kernel/urKernelGetInfo.cpp +++ b/test/conformance/kernel/urKernelGetInfo.cpp @@ -5,9 +5,10 @@ #include "ur_api.h" #include +#include using urKernelGetInfoTest = uur::urKernelTest; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelGetInfoTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urKernelGetInfoTest); TEST_P(urKernelGetInfoTest, FunctionName) { auto property_name = UR_KERNEL_INFO_FUNCTION_NAME; @@ -114,6 +115,7 @@ TEST_P(urKernelGetInfoTest, Attributes) { } TEST_P(urKernelGetInfoTest, NumRegs) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}, uur::OpenCL{}); auto property_name = UR_KERNEL_INFO_NUM_REGS; size_t property_size = 0; diff --git a/test/conformance/kernel/urKernelGetNativeHandle.cpp b/test/conformance/kernel/urKernelGetNativeHandle.cpp index c7432ab4f9..090c6535ac 100644 --- a/test/conformance/kernel/urKernelGetNativeHandle.cpp +++ b/test/conformance/kernel/urKernelGetNativeHandle.cpp @@ -6,7 +6,7 @@ #include using urKernelGetNativeHandleTest = uur::urKernelTest; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelGetNativeHandleTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urKernelGetNativeHandleTest); TEST_P(urKernelGetNativeHandleTest, Success) { ur_native_handle_t native_kernel_handle = 0; diff --git a/test/conformance/kernel/urKernelGetSubGroupInfo.cpp b/test/conformance/kernel/urKernelGetSubGroupInfo.cpp index 3b7324e5a4..9c6e3c07a2 100644 --- a/test/conformance/kernel/urKernelGetSubGroupInfo.cpp +++ b/test/conformance/kernel/urKernelGetSubGroupInfo.cpp @@ -4,10 +4,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "ur_api.h" +#include "uur/known_failure.h" #include struct urKernelGetSubGroupInfoFixedSubGroupSizeTest : uur::urKernelTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}, uur::OpenCL{}, + uur::LevelZero{}, uur::LevelZeroV2{}); program_name = "fixed_sg_size"; UUR_RETURN_ON_FATAL_FAILURE(urKernelTest::SetUp()); } diff --git a/test/conformance/kernel/urKernelRelease.cpp b/test/conformance/kernel/urKernelRelease.cpp index cda79617d8..bf72d5de5c 100644 --- a/test/conformance/kernel/urKernelRelease.cpp +++ b/test/conformance/kernel/urKernelRelease.cpp @@ -6,7 +6,7 @@ #include using urKernelReleaseTest = uur::urKernelTest; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelReleaseTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urKernelReleaseTest); TEST_P(urKernelReleaseTest, Success) { ASSERT_SUCCESS(urKernelRetain(kernel)); diff --git a/test/conformance/kernel/urKernelRetain.cpp b/test/conformance/kernel/urKernelRetain.cpp index 1c0332ad0f..30904f39c4 100644 --- a/test/conformance/kernel/urKernelRetain.cpp +++ b/test/conformance/kernel/urKernelRetain.cpp @@ -7,7 +7,7 @@ #include using urKernelRetainTest = uur::urKernelTest; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelRetainTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urKernelRetainTest); TEST_P(urKernelRetainTest, Success) { ASSERT_SUCCESS(urKernelRetain(kernel)); diff --git a/test/conformance/kernel/urKernelSetArgLocal.cpp b/test/conformance/kernel/urKernelSetArgLocal.cpp index 380085bd16..467fa7b920 100644 --- a/test/conformance/kernel/urKernelSetArgLocal.cpp +++ b/test/conformance/kernel/urKernelSetArgLocal.cpp @@ -5,6 +5,7 @@ #include #include +#include struct urKernelSetArgLocalTest : uur::urKernelTest { void SetUp() { @@ -13,7 +14,7 @@ struct urKernelSetArgLocalTest : uur::urKernelTest { } size_t local_mem_size = 4 * sizeof(uint32_t); }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelSetArgLocalTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urKernelSetArgLocalTest); TEST_P(urKernelSetArgLocalTest, Success) { ASSERT_SUCCESS(urKernelSetArgLocal(kernel, 1, local_mem_size, nullptr)); @@ -25,6 +26,8 @@ TEST_P(urKernelSetArgLocalTest, InvalidNullHandleKernel) { } TEST_P(urKernelSetArgLocalTest, InvalidKernelArgumentIndex) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}); + uint32_t num_kernel_args = 0; ASSERT_SUCCESS(urKernelGetInfo(kernel, UR_KERNEL_INFO_NUM_ARGS, sizeof(num_kernel_args), &num_kernel_args, @@ -143,7 +146,7 @@ struct urKernelSetArgLocalMultiTest : uur::urKernelExecutionTest { static constexpr uint64_t hip_local_offset = 0; ur_platform_backend_t backend{}; }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelSetArgLocalMultiTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urKernelSetArgLocalMultiTest); TEST_P(urKernelSetArgLocalMultiTest, Basic) { ASSERT_SUCCESS(urEnqueueKernelLaunch(queue, kernel, n_dimensions, diff --git a/test/conformance/kernel/urKernelSetArgMemObj.cpp b/test/conformance/kernel/urKernelSetArgMemObj.cpp index afa00d3345..267a0b4afa 100644 --- a/test/conformance/kernel/urKernelSetArgMemObj.cpp +++ b/test/conformance/kernel/urKernelSetArgMemObj.cpp @@ -5,6 +5,7 @@ #include "ur_api.h" #include +#include struct urKernelSetArgMemObjTest : uur::urKernelTest { void SetUp() { @@ -24,7 +25,7 @@ struct urKernelSetArgMemObjTest : uur::urKernelTest { ur_mem_handle_t buffer = nullptr; }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelSetArgMemObjTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urKernelSetArgMemObjTest); TEST_P(urKernelSetArgMemObjTest, Success) { ASSERT_SUCCESS(urKernelSetArgMemObj(kernel, 0, nullptr, buffer)); @@ -36,6 +37,8 @@ TEST_P(urKernelSetArgMemObjTest, InvalidNullHandleKernel) { } TEST_P(urKernelSetArgMemObjTest, InvalidKernelArgumentIndex) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}); + uint32_t num_kernel_args = 0; ASSERT_SUCCESS(urKernelGetInfo(kernel, UR_KERNEL_INFO_NUM_ARGS, sizeof(num_kernel_args), &num_kernel_args, diff --git a/test/conformance/kernel/urKernelSetArgPointer.cpp b/test/conformance/kernel/urKernelSetArgPointer.cpp index e037ada8f1..7cdb10b19d 100644 --- a/test/conformance/kernel/urKernelSetArgPointer.cpp +++ b/test/conformance/kernel/urKernelSetArgPointer.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urKernelSetArgPointerTest : uur::urKernelExecutionTest { void SetUp() { @@ -29,7 +30,7 @@ struct urKernelSetArgPointerTest : uur::urKernelExecutionTest { size_t allocation_size = array_size * sizeof(uint32_t); uint32_t data = 42; }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelSetArgPointerTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urKernelSetArgPointerTest); TEST_P(urKernelSetArgPointerTest, SuccessHost) { ur_device_usm_access_capability_flags_t host_usm_flags = 0; @@ -130,11 +131,11 @@ struct urKernelSetArgPointerNegativeTest : urKernelSetArgPointerTest { void SetUp() { UUR_RETURN_ON_FATAL_FAILURE(urKernelSetArgPointerTest::SetUp()); - SetUpAllocation(); + UUR_RETURN_ON_FATAL_FAILURE(SetUpAllocation()); ASSERT_NE(allocation, nullptr); } }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelSetArgPointerNegativeTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urKernelSetArgPointerNegativeTest); TEST_P(urKernelSetArgPointerNegativeTest, InvalidNullHandleKernel) { ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, @@ -142,6 +143,8 @@ TEST_P(urKernelSetArgPointerNegativeTest, InvalidNullHandleKernel) { } TEST_P(urKernelSetArgPointerNegativeTest, InvalidKernelArgumentIndex) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}); + uint32_t num_kernel_args = 0; ASSERT_SUCCESS(urKernelGetInfo(kernel, UR_KERNEL_INFO_NUM_ARGS, sizeof(num_kernel_args), &num_kernel_args, diff --git a/test/conformance/kernel/urKernelSetArgSampler.cpp b/test/conformance/kernel/urKernelSetArgSampler.cpp index 83a65613e5..f6950ffd53 100644 --- a/test/conformance/kernel/urKernelSetArgSampler.cpp +++ b/test/conformance/kernel/urKernelSetArgSampler.cpp @@ -4,10 +4,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urKernelSetArgSamplerTestWithParam : uur::urBaseKernelTestWithParam { void SetUp() { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); + const auto param = getParam(); const auto normalized = std::get<0>(param); const auto addr_mode = std::get<1>(param); @@ -48,7 +51,7 @@ struct urKernelSetArgSamplerTestWithParam ur_sampler_handle_t sampler = nullptr; }; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urKernelSetArgSamplerTestWithParam, ::testing::Combine( ::testing::Values(true, false), @@ -68,6 +71,8 @@ TEST_P(urKernelSetArgSamplerTestWithParam, Success) { struct urKernelSetArgSamplerTest : uur::urBaseKernelTest { void SetUp() { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); + program_name = "image_copy"; UUR_RETURN_ON_FATAL_FAILURE(urBaseKernelTest::SetUp()); @@ -100,7 +105,7 @@ struct urKernelSetArgSamplerTest : uur::urBaseKernelTest { ur_sampler_handle_t sampler = nullptr; }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelSetArgSamplerTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urKernelSetArgSamplerTest); TEST_P(urKernelSetArgSamplerTest, SuccessWithProps) { ur_kernel_arg_sampler_properties_t props{ @@ -120,6 +125,8 @@ TEST_P(urKernelSetArgSamplerTest, InvalidNullHandleArgValue) { } TEST_P(urKernelSetArgSamplerTest, InvalidKernelArgumentIndex) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + uint32_t num_kernel_args = 0; ASSERT_SUCCESS(urKernelGetInfo(kernel, UR_KERNEL_INFO_NUM_ARGS, sizeof(num_kernel_args), &num_kernel_args, diff --git a/test/conformance/kernel/urKernelSetArgValue.cpp b/test/conformance/kernel/urKernelSetArgValue.cpp index 84dd3ee86c..b8dfda3810 100644 --- a/test/conformance/kernel/urKernelSetArgValue.cpp +++ b/test/conformance/kernel/urKernelSetArgValue.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urKernelSetArgValueTest : uur::urKernelTest { void SetUp() { @@ -13,7 +14,7 @@ struct urKernelSetArgValueTest : uur::urKernelTest { uint32_t arg_value = 42; }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelSetArgValueTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urKernelSetArgValueTest); TEST_P(urKernelSetArgValueTest, Success) { ASSERT_SUCCESS( @@ -33,6 +34,8 @@ TEST_P(urKernelSetArgValueTest, InvalidNullPointerArgValue) { } TEST_P(urKernelSetArgValueTest, InvalidKernelArgumentIndex) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}); + uint32_t num_kernel_args = 0; ASSERT_SUCCESS(urKernelGetInfo(kernel, UR_KERNEL_INFO_NUM_ARGS, sizeof(num_kernel_args), &num_kernel_args, @@ -45,6 +48,8 @@ TEST_P(urKernelSetArgValueTest, InvalidKernelArgumentIndex) { } TEST_P(urKernelSetArgValueTest, InvalidKernelArgumentSize) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}, uur::OpenCL{"Intel(R) UHD Graphics 770"}); + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE, urKernelSetArgValue(kernel, 2, 0, nullptr, &arg_value)); } diff --git a/test/conformance/kernel/urKernelSetExecInfo.cpp b/test/conformance/kernel/urKernelSetExecInfo.cpp index aa1a2c1088..9953c34b00 100644 --- a/test/conformance/kernel/urKernelSetExecInfo.cpp +++ b/test/conformance/kernel/urKernelSetExecInfo.cpp @@ -4,11 +4,14 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urKernelSetExecInfoTest = uur::urKernelTest; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelSetExecInfoTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urKernelSetExecInfoTest); TEST_P(urKernelSetExecInfoTest, SuccessIndirectAccess) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); + bool property_value = false; ASSERT_SUCCESS( urKernelSetExecInfo(kernel, UR_KERNEL_EXEC_INFO_USM_INDIRECT_ACCESS, @@ -55,9 +58,11 @@ struct urKernelSetExecInfoUSMPointersTest : uur::urKernelTest { size_t allocation_size = 16; void *allocation = nullptr; }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelSetExecInfoUSMPointersTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urKernelSetExecInfoUSMPointersTest); TEST_P(urKernelSetExecInfoUSMPointersTest, SuccessHost) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); + ur_device_usm_access_capability_flags_t host_supported = 0; ASSERT_SUCCESS(uur::GetDeviceUSMHostSupport(device, host_supported)); if (!host_supported) { @@ -74,6 +79,8 @@ TEST_P(urKernelSetExecInfoUSMPointersTest, SuccessHost) { } TEST_P(urKernelSetExecInfoUSMPointersTest, SuccessDevice) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); + ur_device_usm_access_capability_flags_t device_supported = 0; ASSERT_SUCCESS(uur::GetDeviceUSMDeviceSupport(device, device_supported)); if (!device_supported) { @@ -90,6 +97,8 @@ TEST_P(urKernelSetExecInfoUSMPointersTest, SuccessDevice) { } TEST_P(urKernelSetExecInfoUSMPointersTest, SuccessShared) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); + ur_device_usm_access_capability_flags_t shared_supported = 0; ASSERT_SUCCESS( uur::GetDeviceUSMSingleSharedSupport(device, shared_supported)); @@ -109,11 +118,12 @@ TEST_P(urKernelSetExecInfoUSMPointersTest, SuccessShared) { using urKernelSetExecInfoCacheConfigTest = uur::urKernelTestWithParam; -UUR_TEST_SUITE_P(urKernelSetExecInfoCacheConfigTest, - ::testing::Values(UR_KERNEL_CACHE_CONFIG_DEFAULT, - UR_KERNEL_CACHE_CONFIG_LARGE_SLM, - UR_KERNEL_CACHE_CONFIG_LARGE_DATA), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P( + urKernelSetExecInfoCacheConfigTest, + ::testing::Values(UR_KERNEL_CACHE_CONFIG_DEFAULT, + UR_KERNEL_CACHE_CONFIG_LARGE_SLM, + UR_KERNEL_CACHE_CONFIG_LARGE_DATA), + uur::deviceTestWithParamPrinter); TEST_P(urKernelSetExecInfoCacheConfigTest, Success) { auto property_value = getParam(); diff --git a/test/conformance/kernel/urKernelSetSpecializationConstants.cpp b/test/conformance/kernel/urKernelSetSpecializationConstants.cpp index e12df68db0..cedbb58f29 100644 --- a/test/conformance/kernel/urKernelSetSpecializationConstants.cpp +++ b/test/conformance/kernel/urKernelSetSpecializationConstants.cpp @@ -25,7 +25,7 @@ struct urKernelSetSpecializationConstantsTest : uur::urBaseKernelExecutionTest { ur_specialization_constant_info_t info = {0, sizeof(spec_value), &spec_value}; }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelSetSpecializationConstantsTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urKernelSetSpecializationConstantsTest); struct urKernelSetSpecializationConstantsNegativeTest : uur::urBaseKernelExecutionTest { @@ -46,7 +46,7 @@ struct urKernelSetSpecializationConstantsNegativeTest ur_specialization_constant_info_t info = {0, sizeof(spec_value), &spec_value}; }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P( +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P( urKernelSetSpecializationConstantsNegativeTest); TEST_P(urKernelSetSpecializationConstantsTest, Success) { diff --git a/test/conformance/memory-migrate/urMemBufferMigrateAcrossDevices.cpp b/test/conformance/memory-migrate/urMemBufferMigrateAcrossDevices.cpp index 040634898f..1dae781e67 100644 --- a/test/conformance/memory-migrate/urMemBufferMigrateAcrossDevices.cpp +++ b/test/conformance/memory-migrate/urMemBufferMigrateAcrossDevices.cpp @@ -63,7 +63,7 @@ struct urMultiDeviceContextMemBufferTest : urMultiDeviceContextTest { UUR_RETURN_ON_FATAL_FAILURE( uur::KernelsEnvironment::instance->LoadSource(program_name, - il_binary)); + platform, il_binary)); programs = std::vector(num_devices); kernels = std::vector(num_devices); diff --git a/test/conformance/memory/memory_adapter_cuda.match b/test/conformance/memory/memory_adapter_cuda.match deleted file mode 100644 index 255559f575..0000000000 --- a/test/conformance/memory/memory_adapter_cuda.match +++ /dev/null @@ -1,6 +0,0 @@ -urMemImageCreateTest.InvalidSize/* -{{OPT}}urMemImageCremBufferCrateTestWith1DMemoryTypeParam.Success/*__UR_MEM_TYPE_IMAGE1D_ARRAY -{{OPT}}urMemImageCreateTestWith2DMemoryTypeParam.Success/*__UR_MEM_TYPE_IMAGE2D_ARRAY -urMemBufferCreateWithNativeHandleTest.Success/* -urMemBufferCreateWithNativeHandleTest.SuccessWithOwnedNativeHandle/* -urMemBufferCreateWithNativeHandleTest.SuccessWithUnOwnedNativeHandle/* diff --git a/test/conformance/memory/memory_adapter_hip.match b/test/conformance/memory/memory_adapter_hip.match deleted file mode 100644 index 2acbdfb2e8..0000000000 --- a/test/conformance/memory/memory_adapter_hip.match +++ /dev/null @@ -1,4 +0,0 @@ -urMemImageCreateTest.InvalidSize/* -urMemBufferCreateWithNativeHandleTest.Success/* -urMemBufferCreateWithNativeHandleTest.SuccessWithOwnedNativeHandle/* -urMemBufferCreateWithNativeHandleTest.SuccessWithUnOwnedNativeHandle/* diff --git a/test/conformance/memory/memory_adapter_level_zero.match b/test/conformance/memory/memory_adapter_level_zero.match deleted file mode 100644 index f9002d81fd..0000000000 --- a/test/conformance/memory/memory_adapter_level_zero.match +++ /dev/null @@ -1,15 +0,0 @@ -{{OPT}}urMemBufferMultiQueueMemBufferTest.WriteBack -urMemBufferPartitionWithFlagsTest.Success/*__UR_MEM_FLAG_WRITE_ONLY -urMemBufferPartitionWithFlagsTest.Success/*__UR_MEM_FLAG_READ_ONLY -urMemBufferPartitionTest.InvalidValueCreateType/* -urMemBufferPartitionTest.InvalidValueBufferCreateInfoOutOfBounds/* -{{OPT}}urMemImageCreateWithNativeHandleTest.Success/* -{{OPT}}urMemGetInfoImageTest.SuccessSize/* -{{OPT}}urMemImageCreateTestWithImageFormatParam.Success/*__UR_IMAGE_CHANNEL_ORDER_RGBA__* - -# These tests fail in the "Multi device testing" job, but pass in the hardware specific test -{{OPT}}urMemImageCreateTest.InvalidImageDescStype/* -{{OPT}}urMemImageCreateTest.InvalidSize/* -{{OPT}}urMemImageCreateWithHostPtrFlagsTest.Success/* -{{OPT}}urMemImageGetInfoTest.InvalidSizeSmall/* -{{OPT}}urMemImageGetInfoTest.Success/* diff --git a/test/conformance/memory/memory_adapter_native_cpu.match b/test/conformance/memory/memory_adapter_native_cpu.match deleted file mode 100644 index 0f97c5285d..0000000000 --- a/test/conformance/memory/memory_adapter_native_cpu.match +++ /dev/null @@ -1,17 +0,0 @@ -urMemBufferPartitionWithFlagsTest.Success/*__UR_MEM_FLAG_WRITE_ONLY -urMemBufferPartitionWithFlagsTest.Success/*__UR_MEM_FLAG_READ_ONLY -urMemBufferPartitionTest.InvalidValueCreateType/* -urMemBufferPartitionTest.InvalidValueBufferCreateInfoOutOfBounds/* -urMemGetInfoTest.SuccessSize/* -urMemGetInfoTest.SuccessContext/* -urMemGetInfoTest.SuccessReferenceCount/* -urMemGetInfoTest.InvalidSizeSmall/* -urMemReleaseTest.Success/* -urMemReleaseTest.CheckReferenceCount/* -urMemRetainTest.Success/* -urMemRetainTest.CheckReferenceCount/* -urMemBufferCreateWithNativeHandleTest.Success/* -urMemBufferCreateWithNativeHandleTest.SuccessWithOwnedNativeHandle/* -urMemBufferCreateWithNativeHandleTest.SuccessWithUnOwnedNativeHandle/* -urMemBufferCreateWithNativeHandleTest.InvalidNullHandle/* -urMemBufferCreateWithNativeHandleTest.InvalidNullPointer/* diff --git a/test/conformance/memory/urMemBufferCreate.cpp b/test/conformance/memory/urMemBufferCreate.cpp index df90c4b63a..7238119de5 100644 --- a/test/conformance/memory/urMemBufferCreate.cpp +++ b/test/conformance/memory/urMemBufferCreate.cpp @@ -10,12 +10,12 @@ using urMemBufferCreateTestWithFlagsParam = uur::urContextTestWithParam; using urMemBufferCreateWithFlagsTest = urMemBufferCreateTestWithFlagsParam; -UUR_TEST_SUITE_P(urMemBufferCreateWithFlagsTest, - ::testing::Values(UR_MEM_FLAG_READ_WRITE, - UR_MEM_FLAG_WRITE_ONLY, - UR_MEM_FLAG_READ_ONLY, - UR_MEM_FLAG_ALLOC_HOST_POINTER), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urMemBufferCreateWithFlagsTest, + ::testing::Values(UR_MEM_FLAG_READ_WRITE, + UR_MEM_FLAG_WRITE_ONLY, + UR_MEM_FLAG_READ_ONLY, + UR_MEM_FLAG_ALLOC_HOST_POINTER), + uur::deviceTestWithParamPrinter); TEST_P(urMemBufferCreateWithFlagsTest, Success) { uur::raii::Mem buffer = nullptr; @@ -87,10 +87,10 @@ TEST_P(urMemBufferCreateTest, InvalidHostPtrValidHost) { using urMemBufferCreateWithHostPtrFlagsTest = urMemBufferCreateTestWithFlagsParam; -UUR_TEST_SUITE_P(urMemBufferCreateWithHostPtrFlagsTest, - ::testing::Values(UR_MEM_FLAG_ALLOC_COPY_HOST_POINTER, - UR_MEM_FLAG_USE_HOST_POINTER), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urMemBufferCreateWithHostPtrFlagsTest, + ::testing::Values(UR_MEM_FLAG_ALLOC_COPY_HOST_POINTER, + UR_MEM_FLAG_USE_HOST_POINTER), + uur::deviceTestWithParamPrinter); TEST_P(urMemBufferCreateWithHostPtrFlagsTest, SUCCESS) { uur::raii::Mem host_ptr_buffer = nullptr; diff --git a/test/conformance/memory/urMemBufferCreateWithNativeHandle.cpp b/test/conformance/memory/urMemBufferCreateWithNativeHandle.cpp index 78e2510369..f9db8b3d56 100644 --- a/test/conformance/memory/urMemBufferCreateWithNativeHandle.cpp +++ b/test/conformance/memory/urMemBufferCreateWithNativeHandle.cpp @@ -4,12 +4,16 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include #include using urMemBufferCreateWithNativeHandleTest = uur::urMemBufferTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urMemBufferCreateWithNativeHandleTest); TEST_P(urMemBufferCreateWithNativeHandleTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::LevelZeroV2{}, uur::HIP{}, + uur::NativeCPU{}); + ur_native_handle_t hNativeMem = 0; ASSERT_SUCCESS(urMemGetNativeHandle(buffer, device, &hNativeMem)); @@ -30,6 +34,9 @@ TEST_P(urMemBufferCreateWithNativeHandleTest, Success) { } TEST_P(urMemBufferCreateWithNativeHandleTest, SuccessWithOwnedNativeHandle) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::LevelZeroV2{}, uur::HIP{}, + uur::NativeCPU{}); + ur_native_handle_t native_handle = 0; ASSERT_SUCCESS(urMemGetNativeHandle(buffer, device, &native_handle)); @@ -51,6 +58,9 @@ TEST_P(urMemBufferCreateWithNativeHandleTest, SuccessWithOwnedNativeHandle) { } TEST_P(urMemBufferCreateWithNativeHandleTest, SuccessWithUnOwnedNativeHandle) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::LevelZeroV2{}, uur::HIP{}, + uur::NativeCPU{}); + ur_native_handle_t native_handle = 0; ASSERT_SUCCESS(urMemGetNativeHandle(buffer, device, &native_handle)); @@ -72,6 +82,8 @@ TEST_P(urMemBufferCreateWithNativeHandleTest, SuccessWithUnOwnedNativeHandle) { } TEST_P(urMemBufferCreateWithNativeHandleTest, InvalidNullHandle) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}, uur::NativeCPU{}); + ur_native_handle_t hNativeMem = 0; ASSERT_SUCCESS(urMemGetNativeHandle(buffer, device, &hNativeMem)); @@ -87,6 +99,8 @@ TEST_P(urMemBufferCreateWithNativeHandleTest, InvalidNullHandle) { } TEST_P(urMemBufferCreateWithNativeHandleTest, InvalidNullPointer) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}, uur::NativeCPU{}); + ur_native_handle_t hNativeMem = 0; ASSERT_SUCCESS(urMemGetNativeHandle(buffer, device, &hNativeMem)); @@ -101,7 +115,11 @@ TEST_P(urMemBufferCreateWithNativeHandleTest, InvalidNullPointer) { } using urMemBufferMultiQueueMemBufferTest = uur::urMultiDeviceMemBufferQueueTest; -TEST_F(urMemBufferMultiQueueMemBufferTest, WriteBack) { +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urMemBufferMultiQueueMemBufferTest); + +TEST_P(urMemBufferMultiQueueMemBufferTest, WriteBack) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + void *ptr; ASSERT_SUCCESS(urUSMHostAlloc(context, nullptr, nullptr, size, &ptr)); ur_mem_handle_t mem = nullptr; diff --git a/test/conformance/memory/urMemBufferPartition.cpp b/test/conformance/memory/urMemBufferPartition.cpp index fca20693c7..92c4cd5ed4 100644 --- a/test/conformance/memory/urMemBufferPartition.cpp +++ b/test/conformance/memory/urMemBufferPartition.cpp @@ -4,17 +4,28 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "uur/fixtures.h" +#include "uur/known_failure.h" #include "uur/raii.h" using urMemBufferPartitionWithFlagsTest = uur::urContextTestWithParam; -UUR_TEST_SUITE_P(urMemBufferPartitionWithFlagsTest, - ::testing::Values(UR_MEM_FLAG_READ_WRITE, - UR_MEM_FLAG_WRITE_ONLY, - UR_MEM_FLAG_READ_ONLY), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urMemBufferPartitionWithFlagsTest, + ::testing::Values(UR_MEM_FLAG_READ_WRITE, + UR_MEM_FLAG_WRITE_ONLY, + UR_MEM_FLAG_READ_ONLY), + uur::deviceTestWithParamPrinter); TEST_P(urMemBufferPartitionWithFlagsTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + + if (getParam() == UR_MEM_FLAG_WRITE_ONLY) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::NativeCPU{}); + } + + if (getParam() == UR_MEM_FLAG_READ_ONLY) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::NativeCPU{}); + } + uur::raii::Mem buffer = nullptr; ASSERT_SUCCESS( @@ -53,6 +64,9 @@ TEST_P(urMemBufferPartitionTest, InvalidEnumerationFlags) { } TEST_P(urMemBufferPartitionTest, InvalidEnumerationBufferCreateType) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}, + uur::NativeCPU{}); + ur_buffer_region_t region{UR_STRUCTURE_TYPE_BUFFER_REGION, nullptr, 0, 1024}; uur::raii::Mem partition = nullptr; @@ -89,6 +103,8 @@ TEST_P(urMemBufferPartitionTest, InvalidBufferSize) { } TEST_P(urMemBufferPartitionTest, InvalidValueCreateType) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::NativeCPU{}); + // create a read only buffer uur::raii::Mem ro_buffer = nullptr; ASSERT_SUCCESS(urMemBufferCreate(context, UR_MEM_FLAG_READ_ONLY, 4096, @@ -105,6 +121,9 @@ TEST_P(urMemBufferPartitionTest, InvalidValueCreateType) { } TEST_P(urMemBufferPartitionTest, InvalidValueBufferCreateInfoOutOfBounds) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}, + uur::NativeCPU{}); + ur_buffer_region_t region{UR_STRUCTURE_TYPE_BUFFER_REGION, nullptr, 0, 8192}; uur::raii::Mem partition = nullptr; diff --git a/test/conformance/memory/urMemGetInfo.cpp b/test/conformance/memory/urMemGetInfo.cpp index 99bba35a50..f016656b6b 100644 --- a/test/conformance/memory/urMemGetInfo.cpp +++ b/test/conformance/memory/urMemGetInfo.cpp @@ -5,11 +5,13 @@ #include #include #include +#include using urMemGetInfoTest = uur::urMemBufferTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urMemGetInfoTest); TEST_P(urMemGetInfoTest, SuccessSize) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); ur_mem_info_t info_type = UR_MEM_INFO_SIZE; size_t size = 0; @@ -24,6 +26,7 @@ TEST_P(urMemGetInfoTest, SuccessSize) { } TEST_P(urMemGetInfoTest, SuccessContext) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); ur_mem_info_t info_type = UR_MEM_INFO_CONTEXT; size_t size = 0; @@ -38,6 +41,7 @@ TEST_P(urMemGetInfoTest, SuccessContext) { } TEST_P(urMemGetInfoTest, SuccessReferenceCount) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); ur_mem_info_t info_type = UR_MEM_INFO_REFERENCE_COUNT; size_t size = 0; @@ -73,6 +77,8 @@ TEST_P(urMemGetInfoTest, InvalidSizeZero) { } TEST_P(urMemGetInfoTest, InvalidSizeSmall) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t mem_size = 0; ASSERT_EQ_RESULT(urMemGetInfo(buffer, UR_MEM_INFO_SIZE, sizeof(mem_size) - 1, &mem_size, nullptr), @@ -92,10 +98,16 @@ TEST_P(urMemGetInfoTest, InvalidNullPointerPropSizeRet) { UR_RESULT_ERROR_INVALID_NULL_POINTER); } -using urMemGetInfoImageTest = uur::urMemImageTest; +struct urMemGetInfoImageTest : uur::urMemImageTest { + void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + uur::urMemImageTest::SetUp(); + } +}; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urMemGetInfoImageTest); TEST_P(urMemGetInfoImageTest, SuccessSize) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::OpenCL{"UHD Graphics"}); ur_mem_info_t info_type = UR_MEM_INFO_SIZE; size_t size = 0; diff --git a/test/conformance/memory/urMemImageCreate.cpp b/test/conformance/memory/urMemImageCreate.cpp index bfb4f6e719..cef704e365 100644 --- a/test/conformance/memory/urMemImageCreate.cpp +++ b/test/conformance/memory/urMemImageCreate.cpp @@ -2,6 +2,7 @@ // 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 "uur/known_failure.h" #include #include @@ -24,6 +25,7 @@ static ur_image_desc_t image_desc{ struct urMemImageCreateTest : public uur::urContextTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); UUR_RETURN_ON_FATAL_FAILURE(uur::urContextTest::SetUp()); uur::raii::Mem image_handle = nullptr; @@ -69,12 +71,18 @@ struct urMemImageCreateTestWithParam using urMemImageCreateTestWith1DMemoryTypeParam = urMemImageCreateTestWithParam; -UUR_TEST_SUITE_P(urMemImageCreateTestWith1DMemoryTypeParam, - ::testing::Values(UR_MEM_TYPE_IMAGE1D, - UR_MEM_TYPE_IMAGE1D_ARRAY), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urMemImageCreateTestWith1DMemoryTypeParam, + ::testing::Values(UR_MEM_TYPE_IMAGE1D, + UR_MEM_TYPE_IMAGE1D_ARRAY), + uur::deviceTestWithParamPrinter); TEST_P(urMemImageCreateTestWith1DMemoryTypeParam, Success) { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); + + if (getParam() == UR_MEM_TYPE_IMAGE1D_ARRAY) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + } + ur_image_desc_t image_desc_with_param{ UR_STRUCTURE_TYPE_IMAGE_DESC, ///< [in] type of this structure nullptr, ///< [in][optional] pointer to extension-specific structure @@ -99,12 +107,18 @@ TEST_P(urMemImageCreateTestWith1DMemoryTypeParam, Success) { using urMemImageCreateTestWith2DMemoryTypeParam = urMemImageCreateTestWithParam; -UUR_TEST_SUITE_P(urMemImageCreateTestWith2DMemoryTypeParam, - ::testing::Values(UR_MEM_TYPE_IMAGE2D, - UR_MEM_TYPE_IMAGE2D_ARRAY), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urMemImageCreateTestWith2DMemoryTypeParam, + ::testing::Values(UR_MEM_TYPE_IMAGE2D, + UR_MEM_TYPE_IMAGE2D_ARRAY), + uur::deviceTestWithParamPrinter); TEST_P(urMemImageCreateTestWith2DMemoryTypeParam, Success) { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); + + if (getParam() == UR_MEM_TYPE_IMAGE2D_ARRAY) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + } + ur_image_desc_t image_desc_with_param{ UR_STRUCTURE_TYPE_IMAGE_DESC, ///< [in] type of this structure nullptr, ///< [in][optional] pointer to extension-specific structure @@ -188,6 +202,11 @@ TEST_P(urMemImageCreateTest, InvalidNullPointerImageFormat) { } TEST_P(urMemImageCreateTest, InvalidSize) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}, + uur::OpenCL{"Intel(R) UHD Graphics 770"}); + + // This fail is specific to the "Multi device testing" ci job. + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); uur::raii::Mem image_handle = nullptr; @@ -217,6 +236,9 @@ TEST_P(urMemImageCreateTest, InvalidSize) { } TEST_P(urMemImageCreateTest, InvalidImageDescStype) { + // This fail is specific to the "Multi device testing" ci job. + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + uur::raii::Mem image_handle = nullptr; ur_image_desc_t invalid_image_desc = image_desc; invalid_image_desc.stype = UR_STRUCTURE_TYPE_FORCE_UINT32; @@ -308,12 +330,17 @@ TEST_P(urMemImageCreateTest, InvalidHostPtrValidHost) { using urMemImageCreateWithHostPtrFlagsTest = urMemImageCreateTestWithParam; -UUR_TEST_SUITE_P(urMemImageCreateWithHostPtrFlagsTest, - ::testing::Values(UR_MEM_FLAG_ALLOC_COPY_HOST_POINTER, - UR_MEM_FLAG_USE_HOST_POINTER), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urMemImageCreateWithHostPtrFlagsTest, + ::testing::Values(UR_MEM_FLAG_ALLOC_COPY_HOST_POINTER, + UR_MEM_FLAG_USE_HOST_POINTER), + uur::deviceTestWithParamPrinter); TEST_P(urMemImageCreateWithHostPtrFlagsTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); + + // This fail is specific to the "Multi device testing" ci job. + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + uur::raii::Mem host_ptr_buffer = nullptr; ASSERT_SUCCESS(urMemImageCreate(context, UR_MEM_FLAG_ALLOC_HOST_POINTER, &image_format, &image_desc, nullptr, diff --git a/test/conformance/memory/urMemImageCreateWithImageFormatParam.cpp b/test/conformance/memory/urMemImageCreateWithImageFormatParam.cpp index b72b5a9425..63bf65f768 100644 --- a/test/conformance/memory/urMemImageCreateWithImageFormatParam.cpp +++ b/test/conformance/memory/urMemImageCreateWithImageFormatParam.cpp @@ -3,6 +3,7 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include #include static ur_image_desc_t image_desc{ @@ -65,6 +66,7 @@ std::vector all_image_formats; struct urMemImageCreateTestWithImageFormatParam : uur::urContextTestWithParam { void SetUp() { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); UUR_RETURN_ON_FATAL_FAILURE( uur::urContextTestWithParam::SetUp()); } @@ -83,17 +85,24 @@ struct urMemImageCreateTestWithImageFormatParam } }; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urMemImageCreateTestWithImageFormatParam, ::testing::ValuesIn( urMemImageCreateTestWithImageFormatParam::makeImageFormats()), uur::deviceTestWithParamPrinter); TEST_P(urMemImageCreateTestWithImageFormatParam, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}, uur::NativeCPU{}, + uur::OpenCL{"Intel(R) UHD Graphics 770"}); + ur_image_channel_order_t channel_order = std::get<1>(GetParam()).channelOrder; ur_image_channel_type_t channel_type = std::get<1>(GetParam()).channelType; + if (channel_order == UR_IMAGE_CHANNEL_ORDER_RGBA) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + } + ur_image_format_t image_format{channel_order, channel_type}; ur_mem_handle_t image_handle = nullptr; diff --git a/test/conformance/memory/urMemImageCreateWithNativeHandle.cpp b/test/conformance/memory/urMemImageCreateWithNativeHandle.cpp index a881af0752..374b2fe5aa 100644 --- a/test/conformance/memory/urMemImageCreateWithNativeHandle.cpp +++ b/test/conformance/memory/urMemImageCreateWithNativeHandle.cpp @@ -4,11 +4,19 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include - -using urMemImageCreateWithNativeHandleTest = uur::urMemImageTest; +#include + +struct urMemImageCreateWithNativeHandleTest : uur::urMemImageTest { + void SetUp() { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(urMemImageTest::SetUp()); + } +}; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urMemImageCreateWithNativeHandleTest); TEST_P(urMemImageCreateWithNativeHandleTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}, uur::LevelZero{}); + ur_native_handle_t native_handle = 0; UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( urMemGetNativeHandle(image, device, &native_handle)); diff --git a/test/conformance/memory/urMemImageGetInfo.cpp b/test/conformance/memory/urMemImageGetInfo.cpp index 1a67e42fad..78bc3b7513 100644 --- a/test/conformance/memory/urMemImageGetInfo.cpp +++ b/test/conformance/memory/urMemImageGetInfo.cpp @@ -2,9 +2,17 @@ // 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 +#include -using urMemImageGetInfoTest = uur::urMemImageTestWithParam; +struct urMemImageGetInfoTest : uur::urMemImageTestWithParam { + void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE( + uur::urMemImageTestWithParam::SetUp()); + } +}; static std::unordered_map image_info_size_map = { {UR_IMAGE_INFO_FORMAT, sizeof(ur_image_format_t)}, @@ -16,16 +24,19 @@ static std::unordered_map image_info_size_map = { {UR_IMAGE_INFO_DEPTH, sizeof(size_t)}, }; -UUR_TEST_SUITE_P(urMemImageGetInfoTest, - ::testing::Values(UR_IMAGE_INFO_FORMAT, - UR_IMAGE_INFO_ELEMENT_SIZE, - UR_IMAGE_INFO_ROW_PITCH, - UR_IMAGE_INFO_SLICE_PITCH, - UR_IMAGE_INFO_WIDTH, UR_IMAGE_INFO_HEIGHT, - UR_IMAGE_INFO_DEPTH), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P( + urMemImageGetInfoTest, + ::testing::Values(UR_IMAGE_INFO_FORMAT, UR_IMAGE_INFO_ELEMENT_SIZE, + UR_IMAGE_INFO_ROW_PITCH, UR_IMAGE_INFO_SLICE_PITCH, + UR_IMAGE_INFO_WIDTH, UR_IMAGE_INFO_HEIGHT, + UR_IMAGE_INFO_DEPTH), + uur::deviceTestWithParamPrinter); TEST_P(urMemImageGetInfoTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + // This fail is specific to the "Multi device testing" ci job. + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ur_image_info_t info = getParam(); size_t size = 0; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( @@ -66,6 +77,9 @@ TEST_P(urMemImageGetInfoTest, InvalidSizeZero) { } TEST_P(urMemImageGetInfoTest, InvalidSizeSmall) { + // This fail is specific to the "Multi device testing" ci job. + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + int info_size = 0; ASSERT_EQ_RESULT(urMemImageGetInfo(image, UR_IMAGE_INFO_FORMAT, sizeof(info_size) - 1, &info_size, diff --git a/test/conformance/memory/urMemRelease.cpp b/test/conformance/memory/urMemRelease.cpp index 730b6aa854..3493d502c5 100644 --- a/test/conformance/memory/urMemRelease.cpp +++ b/test/conformance/memory/urMemRelease.cpp @@ -2,12 +2,16 @@ // 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 "uur/known_failure.h" #include +#include using urMemReleaseTest = uur::urMemBufferTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urMemReleaseTest); TEST_P(urMemReleaseTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ASSERT_SUCCESS(urMemRetain(buffer)); ASSERT_SUCCESS(urMemRelease(buffer)); } @@ -18,6 +22,8 @@ TEST_P(urMemReleaseTest, InvalidNullHandleMem) { } TEST_P(urMemReleaseTest, CheckReferenceCount) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + uint32_t referenceCount = 0; ASSERT_SUCCESS(urMemGetInfo(buffer, UR_MEM_INFO_REFERENCE_COUNT, sizeof(referenceCount), &referenceCount, diff --git a/test/conformance/memory/urMemRetain.cpp b/test/conformance/memory/urMemRetain.cpp index a58896a91b..37e5350001 100644 --- a/test/conformance/memory/urMemRetain.cpp +++ b/test/conformance/memory/urMemRetain.cpp @@ -3,11 +3,14 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urMemRetainTest = uur::urMemBufferTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urMemRetainTest); TEST_P(urMemRetainTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ASSERT_SUCCESS(urMemRetain(buffer)); ASSERT_SUCCESS(urMemRelease(buffer)); } @@ -17,6 +20,8 @@ TEST_P(urMemRetainTest, InvalidNullHandleMem) { } TEST_P(urMemRetainTest, CheckReferenceCount) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + uint32_t referenceCount = 0; ASSERT_SUCCESS(urMemGetInfo(buffer, UR_MEM_INFO_REFERENCE_COUNT, sizeof(referenceCount), &referenceCount, diff --git a/test/conformance/platform/fixtures.h b/test/conformance/platform/fixtures.h index 60928d50c0..78700f4ea7 100644 --- a/test/conformance/platform/fixtures.h +++ b/test/conformance/platform/fixtures.h @@ -36,13 +36,4 @@ std::string platformTestWithParamPrinter( } // namespace platform } // namespace uur -#define UUR_PLATFORM_TEST_SUITE_P(FIXTURE, VALUES, TYPE) \ - INSTANTIATE_TEST_SUITE_P( \ - , FIXTURE, \ - testing::Combine( \ - ::testing::ValuesIn( \ - uur::PlatformEnvironment::instance->all_platforms), \ - VALUES), \ - uur::platform::platformTestWithParamPrinter) - #endif // UR_CONFORMANCE_PLATFORM_FIXTURES_H_INCLUDED diff --git a/test/conformance/platform/urPlatformGetBackendOption.cpp b/test/conformance/platform/urPlatformGetBackendOption.cpp index 30d59013df..a3ff1963a6 100644 --- a/test/conformance/platform/urPlatformGetBackendOption.cpp +++ b/test/conformance/platform/urPlatformGetBackendOption.cpp @@ -2,14 +2,15 @@ // 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 "fixtures.h" + +#include using urPlatformGetBackendOptionTest = - uur::platform::urPlatformTestWithParam; + uur::urPlatformTestWithParam; UUR_PLATFORM_TEST_SUITE_P(urPlatformGetBackendOptionTest, ::testing::Values("-O0", "-O1", "-O2", "-O3"), - std::string); + uur::platformTestWithParamPrinter); TEST_P(urPlatformGetBackendOptionTest, Success) { const char *platformOption = nullptr; diff --git a/test/conformance/program/program_adapter_cuda.match b/test/conformance/program/program_adapter_cuda.match deleted file mode 100644 index 11bf1c3e67..0000000000 --- a/test/conformance/program/program_adapter_cuda.match +++ /dev/null @@ -1,13 +0,0 @@ -urProgramBuildTest.BuildFailure/* -{{OPT}}urProgramCreateWithILTest.Success/* -{{OPT}}urProgramCreateWithILTest.SuccessWithProperties/* -{{OPT}}urProgramCreateWithILTest.BuildInvalidProgram/* -# This test flakily fails -{{OPT}}urProgramGetBuildInfoSingleTest.LogIsNullTerminated/* -{{OPT}}urProgramSetSpecializationConstantsTest.Success/* -{{OPT}}urProgramSetSpecializationConstantsTest.UseDefaultValue/* -urProgramSetSpecializationConstantsTest.InvalidValueSize/* -urProgramSetSpecializationConstantsTest.InvalidValueId/* -urProgramSetSpecializationConstantsTest.InvalidValuePtr/* -urProgramSetMultipleSpecializationConstantsTest.MultipleCalls/* -urProgramSetMultipleSpecializationConstantsTest.SingleCall/* diff --git a/test/conformance/program/program_adapter_hip.match b/test/conformance/program/program_adapter_hip.match deleted file mode 100644 index 2bf556541d..0000000000 --- a/test/conformance/program/program_adapter_hip.match +++ /dev/null @@ -1,15 +0,0 @@ -urProgramBuildTest.BuildFailure/* -# HIP hasn't implemented urProgramCreateWithNativeHandleTest -{{OPT}}urProgramCreateWithNativeHandleTest.Success/* - -# HIP hasn't implemented urProgramLink -{{OPT}}urProgramLinkTest.Success/* - -# Hip doesn't support specialization constants -urProgramSetSpecializationConstantsTest.Success/* -urProgramSetSpecializationConstantsTest.UseDefaultValue/* -urProgramSetSpecializationConstantsTest.InvalidValueSize/* -urProgramSetSpecializationConstantsTest.InvalidValueId/* -urProgramSetSpecializationConstantsTest.InvalidValuePtr/* -urProgramSetMultipleSpecializationConstantsTest.MultipleCalls/* -urProgramSetMultipleSpecializationConstantsTest.SingleCall/* diff --git a/test/conformance/program/program_adapter_level_zero.match b/test/conformance/program/program_adapter_level_zero.match deleted file mode 100644 index 8cb53734bd..0000000000 --- a/test/conformance/program/program_adapter_level_zero.match +++ /dev/null @@ -1,4 +0,0 @@ -urProgramSetSpecializationConstantsTest.InvalidValueSize/* -urProgramSetSpecializationConstantsTest.InvalidValueId/* -urProgramSetSpecializationConstantsTest.InvalidValuePtr/* -urProgramGetBuildInfoTest.Success/*UR_PROGRAM_BUILD_INFO_STATUS diff --git a/test/conformance/program/program_adapter_level_zero_v2.match b/test/conformance/program/program_adapter_level_zero_v2.match deleted file mode 100644 index 920d5f1b5b..0000000000 --- a/test/conformance/program/program_adapter_level_zero_v2.match +++ /dev/null @@ -1,5 +0,0 @@ -urProgramSetSpecializationConstantsTest.InvalidValueSize/* -urProgramSetSpecializationConstantsTest.InvalidValueId/* -urProgramSetSpecializationConstantsTest.InvalidValuePtr/* -urProgramGetBuildInfoTest.Success/*UR_PROGRAM_BUILD_INFO_STATUS -{{OPT}}urMultiDeviceCommandBufferExpTest.* diff --git a/test/conformance/program/program_adapter_native_cpu.match b/test/conformance/program/program_adapter_native_cpu.match deleted file mode 100644 index bd04ab9e8c..0000000000 --- a/test/conformance/program/program_adapter_native_cpu.match +++ /dev/null @@ -1,79 +0,0 @@ -{{OPT}}urProgramBuildTest.Success/* -{{OPT}}urProgramBuildTest.SuccessWithOptions/* -{{OPT}}urProgramBuildTest.InvalidNullHandleContext/* -{{OPT}}urProgramBuildTest.InvalidNullHandleProgram/* -{{OPT}}urProgramBuildTest.BuildFailure/* -{{OPT}}urProgramCompileTest.Success/* -{{OPT}}urProgramCompileTest.InvalidNullHandleContext/* -{{OPT}}urProgramCompileTest.InvalidNullHandleProgram/* -{{OPT}}urProgramCreateWithBinaryTest.Success/* -{{OPT}}urProgramCreateWithBinaryTest.InvalidNullHandleContext/* -{{OPT}}urProgramCreateWithBinaryTest.InvalidNullHandleDevice/* -{{OPT}}urProgramCreateWithBinaryTest.InvalidNullPointerBinary/* -{{OPT}}urProgramCreateWithBinaryTest.InvalidNullPointerProgram/* -{{OPT}}urProgramCreateWithBinaryTest.InvalidNullPointerMetadata/* -{{OPT}}urProgramCreateWithBinaryTest.InvalidSizePropertyCount/* -{{OPT}}urProgramCreateWithBinaryTest.BuildInvalidProgramBinary/* -{{OPT}}urProgramCreateWithILTest.Success/* -{{OPT}}urProgramCreateWithILTest.SuccessWithProperties/* -{{OPT}}urProgramCreateWithILTest.InvalidNullHandle/* -{{OPT}}urProgramCreateWithILTest.InvalidNullPointerSource/* -{{OPT}}urProgramCreateWithILTest.InvalidSizeLength/* -{{OPT}}urProgramCreateWithILTest.InvalidNullPointerProgram/* -{{OPT}}urProgramCreateWithILTest.BuildInvalidProgram/* -{{OPT}}urProgramCreateWithNativeHandleTest.Success/* -{{OPT}}urProgramCreateWithNativeHandleTest.InvalidNullHandleContext/* -{{OPT}}urProgramCreateWithNativeHandleTest.InvalidNullPointerProgram/* -{{OPT}}urProgramGetBuildInfoTest.Success/* -{{OPT}}urProgramGetBuildInfoTest.InvalidNullHandleProgram/* -{{OPT}}urProgramGetBuildInfoTest.InvalidNullHandleDevice/* -{{OPT}}urProgramGetBuildInfoTest.InvalidEnumeration/* -{{OPT}}urProgramGetBuildInfoSingleTest.LogIsNullTerminated/* -{{OPT}}urProgramGetFunctionPointerTest.Success/* -{{OPT}}urProgramGetFunctionPointerTest.InvalidKernelName/* -{{OPT}}urProgramGetFunctionPointerTest.InvalidNullHandleDevice/* -{{OPT}}urProgramGetFunctionPointerTest.InvalidNullHandleProgram/* -{{OPT}}urProgramGetFunctionPointerTest.InvalidNullPointerFunctionName/* -{{OPT}}urProgramGetFunctionPointerTest.InvalidNullPointerFunctionPointer/* -{{OPT}}urProgramGetGlobalVariablePointerTest.Success/* -{{OPT}}urProgramGetGlobalVariablePointerTest.InvalidNullHandleDevice/* -{{OPT}}urProgramGetGlobalVariablePointerTest.InvalidNullHandleProgram/* -{{OPT}}urProgramGetGlobalVariablePointerTest.InvalidVariableName/* -{{OPT}}urProgramGetGlobalVariablePointerTest.InvalidNullPointerVariableName/* -{{OPT}}urProgramGetGlobalVariablePointerTest.InvalidNullPointerVariablePointer/* -{{OPT}}urProgramGetGlobalVariablePointerTest.InvalidProgramExecutable/* -{{OPT}}urProgramGetInfoTest.Success/* -{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/* -{{OPT}}urProgramGetInfoTest.InvalidEnumeration/* -{{OPT}}urProgramGetInfoTest.InvalidSizeZero/* -{{OPT}}urProgramGetInfoTest.InvalidSizeSmall/* -{{OPT}}urProgramGetInfoTest.InvalidNullPointerPropValue/* -{{OPT}}urProgramGetInfoTest.InvalidNullPointerPropValueRet/* -{{OPT}}urProgramGetInfoSingleTest.NumDevicesIsNonzero/* -{{OPT}}urProgramGetInfoSingleTest.NumDevicesMatchesDeviceArray/* -{{OPT}}urProgramGetInfoSingleTest.NumDevicesMatchesContextNumDevices/* -{{OPT}}urProgramGetNativeHandleTest.Success/* -{{OPT}}urProgramGetNativeHandleTest.InvalidNullHandleProgram/* -{{OPT}}urProgramGetNativeHandleTest.InvalidNullPointerNativeProgram/* -{{OPT}}urProgramLinkTest.Success/* -{{OPT}}urProgramLinkTest.InvalidNullHandleContext/* -{{OPT}}urProgramLinkTest.InvalidNullPointerProgram/* -{{OPT}}urProgramLinkTest.InvalidNullPointerInputPrograms/* -{{OPT}}urProgramLinkTest.InvalidSizeCount/* -{{OPT}}urProgramLinkTest.SetOutputOnZeroCount/* -{{OPT}}urProgramLinkErrorTest.LinkFailure/* -{{OPT}}urProgramLinkErrorTest.SetOutputOnLinkError/* -{{OPT}}urProgramReleaseTest.Success/* -{{OPT}}urProgramReleaseTest.InvalidNullHandleProgram/* -{{OPT}}urProgramRetainTest.Success/* -{{OPT}}urProgramRetainTest.InvalidNullHandleProgram/* -{{OPT}}urProgramSetSpecializationConstantsTest.Success/* -{{OPT}}urProgramSetSpecializationConstantsTest.UseDefaultValue/* -{{OPT}}urProgramSetSpecializationConstantsTest.InvalidNullHandleProgram/* -{{OPT}}urProgramSetSpecializationConstantsTest.InvalidNullPointerSpecConstants/* -{{OPT}}urProgramSetSpecializationConstantsTest.InvalidSizeCount/* -{{OPT}}urProgramSetSpecializationConstantsTest.InvalidValueSize/* -{{OPT}}urProgramSetSpecializationConstantsTest.InvalidValueId/* -{{OPT}}urProgramSetSpecializationConstantsTest.InvalidValuePtr/* -{{OPT}}urProgramSetMultipleSpecializationConstantsTest.MultipleCalls/* -{{OPT}}urProgramSetMultipleSpecializationConstantsTest.SingleCall/* diff --git a/test/conformance/program/urMultiDeviceProgramCreateWithBinary.cpp b/test/conformance/program/urMultiDeviceProgramCreateWithBinary.cpp index 5f99747462..c7706b2987 100644 --- a/test/conformance/program/urMultiDeviceProgramCreateWithBinary.cpp +++ b/test/conformance/program/urMultiDeviceProgramCreateWithBinary.cpp @@ -4,6 +4,7 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include "uur/known_failure.h" #include #include @@ -51,9 +52,10 @@ struct urMultiDeviceProgramCreateWithBinaryTest std::vector binary_sizes; ur_program_handle_t binary_program = nullptr; }; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urMultiDeviceProgramCreateWithBinaryTest); // Create the kernel using the program created with multiple binaries and run it on all devices. -TEST_F(urMultiDeviceProgramCreateWithBinaryTest, +TEST_P(urMultiDeviceProgramCreateWithBinaryTest, CreateAndRunKernelOnAllDevices) { constexpr size_t global_offset = 0; constexpr size_t n_dimensions = 1; @@ -77,7 +79,7 @@ TEST_F(urMultiDeviceProgramCreateWithBinaryTest, } } -TEST_F(urMultiDeviceProgramCreateWithBinaryTest, CheckCompileAndLink) { +TEST_P(urMultiDeviceProgramCreateWithBinaryTest, CheckCompileAndLink) { // TODO: Current behaviour is that we allow to compile only IL programs for Level Zero and link only programs in Object state. // OpenCL allows to compile and link programs created from native binaries, so probably we should align those two. ur_platform_backend_t backend; @@ -100,7 +102,7 @@ TEST_F(urMultiDeviceProgramCreateWithBinaryTest, CheckCompileAndLink) { } } -TEST_F(urMultiDeviceProgramCreateWithBinaryTest, +TEST_P(urMultiDeviceProgramCreateWithBinaryTest, InvalidProgramBinaryForOneOfTheDevices) { std::vector pointers_with_invalid_binary; for (size_t i = 1; i < devices.size(); i++) { @@ -115,7 +117,7 @@ TEST_F(urMultiDeviceProgramCreateWithBinaryTest, } // Test the case when program is built multiple times for different devices from context. -TEST_F(urMultiDeviceProgramCreateWithBinaryTest, MultipleBuildCalls) { +TEST_P(urMultiDeviceProgramCreateWithBinaryTest, MultipleBuildCalls) { // Run test only for level zero backend which supports urProgramBuildExp. ur_platform_backend_t backend; ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND, @@ -145,7 +147,7 @@ TEST_F(urMultiDeviceProgramCreateWithBinaryTest, MultipleBuildCalls) { } // Test the case we get native binaries from program created with multiple binaries which wasn't built (i.e. in Native state). -TEST_F(urMultiDeviceProgramCreateWithBinaryTest, +TEST_P(urMultiDeviceProgramCreateWithBinaryTest, GetBinariesAndSizesFromProgramInNativeState) { size_t exp_binary_sizes_len = 0; std::vector exp_binary_sizes; @@ -176,7 +178,7 @@ TEST_F(urMultiDeviceProgramCreateWithBinaryTest, ASSERT_EQ(exp_binary_sizes, binary_sizes); } -TEST_F(urMultiDeviceProgramCreateWithBinaryTest, GetIL) { +TEST_P(urMultiDeviceProgramCreateWithBinaryTest, GetIL) { size_t il_length = 0; ASSERT_SUCCESS(urProgramGetInfo(binary_program, UR_PROGRAM_INFO_IL, 0, nullptr, &il_length)); @@ -187,7 +189,7 @@ TEST_F(urMultiDeviceProgramCreateWithBinaryTest, GetIL) { UR_RESULT_ERROR_INVALID_NULL_POINTER); } -TEST_F(urMultiDeviceProgramCreateWithBinaryTest, CheckProgramGetInfo) { +TEST_P(urMultiDeviceProgramCreateWithBinaryTest, CheckProgramGetInfo) { std::vector property_value; size_t property_size = 0; @@ -244,6 +246,8 @@ TEST_F(urMultiDeviceProgramCreateWithBinaryTest, CheckProgramGetInfo) { struct urMultiDeviceCommandBufferExpTest : urMultiDeviceProgramCreateWithBinaryTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE( urMultiDeviceProgramCreateWithBinaryTest::SetUp()); @@ -297,8 +301,9 @@ struct urMultiDeviceCommandBufferExpTest static constexpr size_t global_size = 64; static constexpr size_t local_size = 4; }; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urMultiDeviceCommandBufferExpTest); -TEST_F(urMultiDeviceCommandBufferExpTest, Enqueue) { +TEST_P(urMultiDeviceCommandBufferExpTest, Enqueue) { for (size_t i = 0; i < devices.size(); i++) { auto device = devices[i]; if (!hasCommandBufferSupport(device)) { @@ -324,7 +329,7 @@ TEST_F(urMultiDeviceCommandBufferExpTest, Enqueue) { } } -TEST_F(urMultiDeviceCommandBufferExpTest, Update) { +TEST_P(urMultiDeviceCommandBufferExpTest, Update) { for (size_t i = 0; i < devices.size(); i++) { auto device = devices[i]; if (!(hasCommandBufferSupport(device) && diff --git a/test/conformance/program/urMultiDeviceProgramCreateWithIL.cpp b/test/conformance/program/urMultiDeviceProgramCreateWithIL.cpp index 652de93540..fc7896472f 100644 --- a/test/conformance/program/urMultiDeviceProgramCreateWithIL.cpp +++ b/test/conformance/program/urMultiDeviceProgramCreateWithIL.cpp @@ -8,9 +8,10 @@ #include using urMultiDeviceProgramTest = uur::urMultiDeviceProgramTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urMultiDeviceProgramTest); // Test binary sizes and binaries obtained from urProgramGetInfo when program is built for a subset of devices in the context. -TEST_F(urMultiDeviceProgramTest, urMultiDeviceProgramGetInfo) { +TEST_P(urMultiDeviceProgramTest, urMultiDeviceProgramGetInfo) { // Run test only for level zero backend which supports urProgramBuildExp. ur_platform_backend_t backend; ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND, diff --git a/test/conformance/program/urProgramBuild.cpp b/test/conformance/program/urProgramBuild.cpp index a7e7e4a275..d5f794a32e 100644 --- a/test/conformance/program/urProgramBuild.cpp +++ b/test/conformance/program/urProgramBuild.cpp @@ -4,9 +4,10 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urProgramBuildTest = uur::urProgramTest; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramBuildTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urProgramBuildTest); TEST_P(urProgramBuildTest, Success) { ASSERT_SUCCESS(urProgramBuild(context, program, nullptr)); @@ -28,9 +29,12 @@ TEST_P(urProgramBuildTest, InvalidNullHandleProgram) { } TEST_P(urProgramBuildTest, BuildFailure) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}); + ur_program_handle_t program = nullptr; std::shared_ptr> il_binary; - uur::KernelsEnvironment::instance->LoadSource("build_failure", il_binary); + uur::KernelsEnvironment::instance->LoadSource("build_failure", platform, + il_binary); if (!il_binary) { // The build failure we are testing for happens at SYCL compile time on // AMD and Nvidia, so no binary exists to check for a build failure diff --git a/test/conformance/program/urProgramCompile.cpp b/test/conformance/program/urProgramCompile.cpp index 5fcae35f6c..8aebdd9036 100644 --- a/test/conformance/program/urProgramCompile.cpp +++ b/test/conformance/program/urProgramCompile.cpp @@ -6,7 +6,7 @@ #include using urProgramCompileTest = uur::urProgramTest; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramCompileTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urProgramCompileTest); TEST_P(urProgramCompileTest, Success) { ASSERT_SUCCESS(urProgramCompile(context, program, nullptr)); diff --git a/test/conformance/program/urProgramCreateWithBinary.cpp b/test/conformance/program/urProgramCreateWithBinary.cpp index c34c5a3223..bdd9d2a858 100644 --- a/test/conformance/program/urProgramCreateWithBinary.cpp +++ b/test/conformance/program/urProgramCreateWithBinary.cpp @@ -35,7 +35,7 @@ struct urProgramCreateWithBinaryTest : uur::urProgramTest { std::vector binary; ur_program_handle_t binary_program = nullptr; }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramCreateWithBinaryTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urProgramCreateWithBinaryTest); TEST_P(urProgramCreateWithBinaryTest, Success) { auto size = binary.size(); diff --git a/test/conformance/program/urProgramCreateWithIL.cpp b/test/conformance/program/urProgramCreateWithIL.cpp index 7c02c3c7b9..3e1c5642f6 100644 --- a/test/conformance/program/urProgramCreateWithIL.cpp +++ b/test/conformance/program/urProgramCreateWithIL.cpp @@ -4,9 +4,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urProgramCreateWithILTest : uur::urContextTest { void SetUp() override { + // We haven't got device code tests working on native cpu yet. + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + UUR_RETURN_ON_FATAL_FAILURE(urContextTest::SetUp()); // TODO: This should use a query for urProgramCreateWithIL support or // rely on UR_RESULT_ERROR_UNSUPPORTED_FEATURE being returned. @@ -17,7 +21,8 @@ struct urProgramCreateWithILTest : uur::urContextTest { if (backend == UR_PLATFORM_BACKEND_HIP) { GTEST_SKIP(); } - uur::KernelsEnvironment::instance->LoadSource("foo", il_binary); + uur::KernelsEnvironment::instance->LoadSource("foo", platform, + il_binary); } void TearDown() override { @@ -26,9 +31,11 @@ struct urProgramCreateWithILTest : uur::urContextTest { std::shared_ptr> il_binary; }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramCreateWithILTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urProgramCreateWithILTest); TEST_P(urProgramCreateWithILTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + ur_program_handle_t program = nullptr; ASSERT_SUCCESS(urProgramCreateWithIL(context, il_binary->data(), il_binary->size(), nullptr, &program)); @@ -37,6 +44,8 @@ TEST_P(urProgramCreateWithILTest, Success) { } TEST_P(urProgramCreateWithILTest, SuccessWithProperties) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + ur_program_properties_t properties{UR_STRUCTURE_TYPE_PROGRAM_PROPERTIES, nullptr, 0, nullptr}; ur_program_handle_t program = nullptr; @@ -76,6 +85,8 @@ TEST_P(urProgramCreateWithILTest, InvalidNullPointerProgram) { } TEST_P(urProgramCreateWithILTest, BuildInvalidProgram) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + ur_program_handle_t program = nullptr; char binary[] = {0, 1, 2, 3, 4}; auto result = urProgramCreateWithIL(context, &binary, 5, nullptr, &program); diff --git a/test/conformance/program/urProgramCreateWithNativeHandle.cpp b/test/conformance/program/urProgramCreateWithNativeHandle.cpp index 00493d90a8..e43d7faca0 100644 --- a/test/conformance/program/urProgramCreateWithNativeHandle.cpp +++ b/test/conformance/program/urProgramCreateWithNativeHandle.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urProgramCreateWithNativeHandleTest : uur::urProgramTest { void SetUp() override { @@ -32,7 +33,7 @@ struct urProgramCreateWithNativeHandleTest : uur::urProgramTest { ur_native_handle_t native_program_handle = 0; ur_program_handle_t native_program = nullptr; }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramCreateWithNativeHandleTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urProgramCreateWithNativeHandleTest); TEST_P(urProgramCreateWithNativeHandleTest, Success) { UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urProgramCreateWithNativeHandle( diff --git a/test/conformance/program/urProgramGetBuildInfo.cpp b/test/conformance/program/urProgramGetBuildInfo.cpp index df46467197..d065364d6d 100644 --- a/test/conformance/program/urProgramGetBuildInfo.cpp +++ b/test/conformance/program/urProgramGetBuildInfo.cpp @@ -3,6 +3,7 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include "uur/known_failure.h" #include struct urProgramGetBuildInfoTest @@ -14,12 +15,12 @@ struct urProgramGetBuildInfoTest } }; -UUR_TEST_SUITE_P(urProgramGetBuildInfoTest, - ::testing::Values(UR_PROGRAM_BUILD_INFO_STATUS, - UR_PROGRAM_BUILD_INFO_OPTIONS, - UR_PROGRAM_BUILD_INFO_LOG, - UR_PROGRAM_BUILD_INFO_BINARY_TYPE), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P( + urProgramGetBuildInfoTest, + ::testing::Values(UR_PROGRAM_BUILD_INFO_STATUS, + UR_PROGRAM_BUILD_INFO_OPTIONS, UR_PROGRAM_BUILD_INFO_LOG, + UR_PROGRAM_BUILD_INFO_BINARY_TYPE), + uur::deviceTestWithParamPrinter); struct urProgramGetBuildInfoSingleTest : uur::urProgramTest { void SetUp() override { @@ -27,10 +28,15 @@ struct urProgramGetBuildInfoSingleTest : uur::urProgramTest { ASSERT_SUCCESS(urProgramBuild(this->context, program, nullptr)); } }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramGetBuildInfoSingleTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urProgramGetBuildInfoSingleTest); TEST_P(urProgramGetBuildInfoTest, Success) { auto property_name = getParam(); + + if (property_name == UR_PROGRAM_BUILD_INFO_STATUS) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); + } + size_t property_size = 0; std::vector property_value; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( @@ -72,6 +78,9 @@ TEST_P(urProgramGetBuildInfoTest, InvalidEnumeration) { } TEST_P(urProgramGetBuildInfoSingleTest, LogIsNullTerminated) { + // This is a flaky fail. + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + size_t logSize; std::vector log; diff --git a/test/conformance/program/urProgramGetFunctionPointer.cpp b/test/conformance/program/urProgramGetFunctionPointer.cpp index 41d397d527..6cba188e4e 100644 --- a/test/conformance/program/urProgramGetFunctionPointer.cpp +++ b/test/conformance/program/urProgramGetFunctionPointer.cpp @@ -3,6 +3,7 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include "uur/known_failure.h" #include struct urProgramGetFunctionPointerTest : uur::urProgramTest { @@ -17,9 +18,10 @@ struct urProgramGetFunctionPointerTest : uur::urProgramTest { std::string function_name; }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramGetFunctionPointerTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urProgramGetFunctionPointerTest); TEST_P(urProgramGetFunctionPointerTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) UHD Graphics 770"}); void *function_pointer = nullptr; ASSERT_SUCCESS(urProgramGetFunctionPointer( device, program, function_name.data(), &function_pointer)); diff --git a/test/conformance/program/urProgramGetGlobalVariablePointer.cpp b/test/conformance/program/urProgramGetGlobalVariablePointer.cpp index aff3ad8803..018c58afd7 100644 --- a/test/conformance/program/urProgramGetGlobalVariablePointer.cpp +++ b/test/conformance/program/urProgramGetGlobalVariablePointer.cpp @@ -7,7 +7,7 @@ using urProgramGetGlobalVariablePointerTest = uur::urGlobalVariableTest; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramGetGlobalVariablePointerTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urProgramGetGlobalVariablePointerTest); TEST_P(urProgramGetGlobalVariablePointerTest, Success) { size_t global_variable_size = 0; diff --git a/test/conformance/program/urProgramGetInfo.cpp b/test/conformance/program/urProgramGetInfo.cpp index 176a278583..38bbbee649 100644 --- a/test/conformance/program/urProgramGetInfo.cpp +++ b/test/conformance/program/urProgramGetInfo.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urProgramGetInfoTest : uur::urProgramTestWithParam { void SetUp() override { @@ -14,7 +15,7 @@ struct urProgramGetInfoTest : uur::urProgramTestWithParam { } }; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urProgramGetInfoTest, ::testing::Values(UR_PROGRAM_INFO_REFERENCE_COUNT, UR_PROGRAM_INFO_CONTEXT, UR_PROGRAM_INFO_NUM_DEVICES, UR_PROGRAM_INFO_DEVICES, @@ -29,10 +30,16 @@ struct urProgramGetInfoSingleTest : uur::urProgramTest { ASSERT_SUCCESS(urProgramBuild(this->context, program, nullptr)); } }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramGetInfoSingleTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urProgramGetInfoSingleTest); TEST_P(urProgramGetInfoTest, Success) { auto property_name = getParam(); + + // It isn't possible to implement this on HIP + if (property_name == UR_PROGRAM_INFO_NUM_KERNELS) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + } + std::vector property_value; size_t property_size = 0; if (property_name == UR_PROGRAM_INFO_BINARIES) { @@ -89,13 +96,8 @@ TEST_P(urProgramGetInfoTest, Success) { auto returned_devices = reinterpret_cast(property_value.data()); size_t devices_count = property_size / sizeof(ur_device_handle_t); - ASSERT_GT(devices_count, 0); - for (uint32_t i = 0; i < devices_count; i++) { - auto &devices = uur::DevicesEnvironment::instance->devices; - auto queried_device = - std::find(devices.begin(), devices.end(), returned_devices[i]); - EXPECT_TRUE(queried_device != devices.end()); - } + ASSERT_EQ(devices_count, 1); + ASSERT_EQ(returned_devices[0], device); break; } case UR_PROGRAM_INFO_NUM_KERNELS: { diff --git a/test/conformance/program/urProgramGetNativeHandle.cpp b/test/conformance/program/urProgramGetNativeHandle.cpp index 864aa8bd62..10b44148ce 100644 --- a/test/conformance/program/urProgramGetNativeHandle.cpp +++ b/test/conformance/program/urProgramGetNativeHandle.cpp @@ -6,7 +6,7 @@ #include using urProgramGetNativeHandleTest = uur::urProgramTest; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramGetNativeHandleTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urProgramGetNativeHandleTest); TEST_P(urProgramGetNativeHandleTest, Success) { ur_platform_backend_t backend; diff --git a/test/conformance/program/urProgramLink.cpp b/test/conformance/program/urProgramLink.cpp index e14c38d883..e671c13286 100644 --- a/test/conformance/program/urProgramLink.cpp +++ b/test/conformance/program/urProgramLink.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urProgramLinkTest : uur::urProgramTest { void SetUp() override { @@ -29,12 +30,15 @@ struct urProgramLinkTest : uur::urProgramTest { ur_program_handle_t linked_program = nullptr; }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramLinkTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urProgramLinkTest); struct urProgramLinkErrorTest : uur::urQueueTest { const std::string linker_error_program_name = "linker_error"; void SetUp() override { + // We haven't got device code tests working on native cpu yet. + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp()); // TODO: This should use a query for urProgramCreateWithIL support or // rely on UR_RESULT_ERROR_UNSUPPORTED_FEATURE being returned. @@ -53,7 +57,7 @@ struct urProgramLinkErrorTest : uur::urQueueTest { std::shared_ptr> il_binary{}; UUR_RETURN_ON_FATAL_FAILURE( uur::KernelsEnvironment::instance->LoadSource( - linker_error_program_name, il_binary)); + linker_error_program_name, platform, il_binary)); ASSERT_SUCCESS(uur::KernelsEnvironment::instance->CreateProgram( platform, context, device, *il_binary, nullptr, &program)); ASSERT_SUCCESS(urProgramCompile(context, program, nullptr)); @@ -69,9 +73,12 @@ struct urProgramLinkErrorTest : uur::urQueueTest { ur_program_handle_t program = nullptr; ur_program_handle_t linked_program = nullptr; }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramLinkErrorTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urProgramLinkErrorTest); TEST_P(urProgramLinkTest, Success) { + // This entry point isn't implemented for HIP. + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + ASSERT_SUCCESS( urProgramLink(context, 1, &program, nullptr, &linked_program)); ur_program_binary_type_t binary_type = UR_PROGRAM_BINARY_TYPE_NONE; diff --git a/test/conformance/program/urProgramRelease.cpp b/test/conformance/program/urProgramRelease.cpp index 06bcc9e342..cce7569b06 100644 --- a/test/conformance/program/urProgramRelease.cpp +++ b/test/conformance/program/urProgramRelease.cpp @@ -6,7 +6,7 @@ #include using urProgramReleaseTest = uur::urProgramTest; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramReleaseTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urProgramReleaseTest); TEST_P(urProgramReleaseTest, Success) { ASSERT_SUCCESS(urProgramRetain(program)); diff --git a/test/conformance/program/urProgramRetain.cpp b/test/conformance/program/urProgramRetain.cpp index 734382554f..3130eb50f9 100644 --- a/test/conformance/program/urProgramRetain.cpp +++ b/test/conformance/program/urProgramRetain.cpp @@ -6,7 +6,7 @@ #include using urProgramRetainTest = uur::urProgramTest; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramRetainTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urProgramRetainTest); TEST_P(urProgramRetainTest, Success) { ASSERT_SUCCESS(urProgramRetain(program)); diff --git a/test/conformance/program/urProgramSetSpecializationConstants.cpp b/test/conformance/program/urProgramSetSpecializationConstants.cpp index 949c5c323e..7f477c4582 100644 --- a/test/conformance/program/urProgramSetSpecializationConstants.cpp +++ b/test/conformance/program/urProgramSetSpecializationConstants.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urProgramSetSpecializationConstantsTest : uur::urKernelExecutionTest { void SetUp() override { @@ -16,7 +17,7 @@ struct urProgramSetSpecializationConstantsTest : uur::urKernelExecutionTest { ur_specialization_constant_info_t info = {0, sizeof(spec_value), &spec_value}; }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramSetSpecializationConstantsTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urProgramSetSpecializationConstantsTest); struct urProgramSetMultipleSpecializationConstantsTest : uur::urKernelExecutionTest { @@ -26,10 +27,12 @@ struct urProgramSetMultipleSpecializationConstantsTest UUR_RETURN_ON_FATAL_FAILURE(urProgramTest::SetUp()); } }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P( +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P( urProgramSetMultipleSpecializationConstantsTest); TEST_P(urProgramSetSpecializationConstantsTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}); + ASSERT_SUCCESS(urProgramSetSpecializationConstants(program, 1, &info)); ASSERT_SUCCESS(urProgramBuild(context, program, nullptr)); auto entry_points = @@ -44,6 +47,8 @@ TEST_P(urProgramSetSpecializationConstantsTest, Success) { } TEST_P(urProgramSetSpecializationConstantsTest, UseDefaultValue) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}); + ur_platform_backend_t backend; ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND, sizeof(ur_platform_backend_t), &backend, @@ -67,6 +72,8 @@ TEST_P(urProgramSetSpecializationConstantsTest, UseDefaultValue) { } TEST_P(urProgramSetMultipleSpecializationConstantsTest, MultipleCalls) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}); + uint32_t a = 100; uint64_t b = 200; bool c = false; @@ -98,6 +105,8 @@ TEST_P(urProgramSetMultipleSpecializationConstantsTest, MultipleCalls) { } TEST_P(urProgramSetMultipleSpecializationConstantsTest, SingleCall) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}); + uint32_t a = 200; uint64_t b = 300; bool c = true; @@ -143,6 +152,9 @@ TEST_P(urProgramSetSpecializationConstantsTest, InvalidSizeCount) { } TEST_P(urProgramSetSpecializationConstantsTest, InvalidValueSize) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}, uur::LevelZero{}, + uur::LevelZeroV2{}); + ur_specialization_constant_info_t bad_info = {0, 0x1000, &spec_value}; ASSERT_EQ_RESULT( UR_RESULT_ERROR_INVALID_VALUE, @@ -150,6 +162,9 @@ TEST_P(urProgramSetSpecializationConstantsTest, InvalidValueSize) { } TEST_P(urProgramSetSpecializationConstantsTest, InvalidValueId) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}, uur::LevelZero{}, + uur::LevelZeroV2{}); + ur_specialization_constant_info_t bad_info = {999, sizeof(spec_value), &spec_value}; ASSERT_EQ_RESULT( @@ -158,6 +173,9 @@ TEST_P(urProgramSetSpecializationConstantsTest, InvalidValueId) { } TEST_P(urProgramSetSpecializationConstantsTest, InvalidValuePtr) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}, uur::LevelZero{}, + uur::LevelZeroV2{}); + ur_specialization_constant_info_t bad_info = {0, sizeof(spec_value), nullptr}; ASSERT_EQ_RESULT( diff --git a/test/conformance/queue/queue_adapter_native_cpu.match b/test/conformance/queue/queue_adapter_native_cpu.match deleted file mode 100644 index 8bac2b269e..0000000000 --- a/test/conformance/queue/queue_adapter_native_cpu.match +++ /dev/null @@ -1,15 +0,0 @@ -urQueueCreateTest.Success/* -urQueueCreateTest.CheckContext/* -urQueueCreateWithParamTest.SuccessWithProperties/* -urQueueCreateWithParamTest.MatchingDeviceHandles/* -urQueueFlushTest.Success/* -urQueueGetInfoTest.Context/* -urQueueGetInfoTest.Device/* -urQueueGetInfoTest.Flags/* -urQueueGetInfoTest.ReferenceCount/* -urQueueGetInfoTest.InvalidSizeSmall/* -urQueueGetInfoTest.EmptyQueue/* -urQueueGetInfoDeviceQueueTestWithInfoParam.DeviceDefault/* -urQueueGetInfoDeviceQueueTestWithInfoParam.Size/* -urQueueRetainTest.Success/* -urQueueReleaseTest.Success/* diff --git a/test/conformance/queue/urQueueCreate.cpp b/test/conformance/queue/urQueueCreate.cpp index 8b26784ef5..d516384ad9 100644 --- a/test/conformance/queue/urQueueCreate.cpp +++ b/test/conformance/queue/urQueueCreate.cpp @@ -5,11 +5,14 @@ #include "ur_api.h" #include "uur/raii.h" #include +#include using urQueueCreateTest = uur::urContextTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urQueueCreateTest); TEST_P(urQueueCreateTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + uur::raii::Queue queue = nullptr; ASSERT_SUCCESS(urQueueCreate(context, device, nullptr, queue.ptr())); ASSERT_NE(nullptr, queue); @@ -24,22 +27,23 @@ TEST_P(urQueueCreateTest, Success) { } using urQueueCreateWithParamTest = uur::urContextTestWithParam; -UUR_TEST_SUITE_P(urQueueCreateWithParamTest, - testing::Values(UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE, - UR_QUEUE_FLAG_PROFILING_ENABLE, - UR_QUEUE_FLAG_ON_DEVICE, - UR_QUEUE_FLAG_ON_DEVICE_DEFAULT, - UR_QUEUE_FLAG_DISCARD_EVENTS, - UR_QUEUE_FLAG_PRIORITY_LOW, - UR_QUEUE_FLAG_PRIORITY_HIGH, - UR_QUEUE_FLAG_SUBMISSION_BATCHED, - UR_QUEUE_FLAG_SUBMISSION_IMMEDIATE, - UR_QUEUE_FLAG_USE_DEFAULT_STREAM, - UR_QUEUE_FLAG_SYNC_WITH_DEFAULT_STREAM, - UR_QUEUE_FLAG_LOW_POWER_EVENTS_EXP), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P( + urQueueCreateWithParamTest, + testing::Values(UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE, + UR_QUEUE_FLAG_PROFILING_ENABLE, UR_QUEUE_FLAG_ON_DEVICE, + UR_QUEUE_FLAG_ON_DEVICE_DEFAULT, + UR_QUEUE_FLAG_DISCARD_EVENTS, UR_QUEUE_FLAG_PRIORITY_LOW, + UR_QUEUE_FLAG_PRIORITY_HIGH, + UR_QUEUE_FLAG_SUBMISSION_BATCHED, + UR_QUEUE_FLAG_SUBMISSION_IMMEDIATE, + UR_QUEUE_FLAG_USE_DEFAULT_STREAM, + UR_QUEUE_FLAG_SYNC_WITH_DEFAULT_STREAM, + UR_QUEUE_FLAG_LOW_POWER_EVENTS_EXP), + uur::deviceTestWithParamPrinter); TEST_P(urQueueCreateWithParamTest, SuccessWithProperties) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_queue_flags_t supportedFlags{}; ASSERT_SUCCESS(uur::GetDeviceQueueOnHostProperties(device, supportedFlags)); @@ -73,6 +77,8 @@ TEST_P(urQueueCreateWithParamTest, SuccessWithProperties) { /* Creates two queues with the same platform and device, and checks that the * queried device and platform of both queues match. */ TEST_P(urQueueCreateWithParamTest, MatchingDeviceHandles) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_queue_flags_t supportedFlags{}; ASSERT_SUCCESS(uur::GetDeviceQueueOnHostProperties(device, supportedFlags)); @@ -110,6 +116,7 @@ TEST_P(urQueueCreateWithParamTest, MatchingDeviceHandles) { /* Create a queue and check that it returns the right context*/ TEST_P(urQueueCreateTest, CheckContext) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); uur::raii::Queue queue = nullptr; ASSERT_SUCCESS(urQueueCreate(context, device, nullptr, queue.ptr())); @@ -124,9 +131,10 @@ TEST_P(urQueueCreateTest, CheckContext) { } using urQueueCreateTestMultipleDevices = uur::urAllDevicesTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urQueueCreateTestMultipleDevices); /* Create a queue using a context from a different device */ -TEST_F(urQueueCreateTestMultipleDevices, ContextFromWrongDevice) { +TEST_P(urQueueCreateTestMultipleDevices, ContextFromWrongDevice) { if (devices.size() < 2) { GTEST_SKIP() << "Test requires at least 2 devices in the system"; diff --git a/test/conformance/queue/urQueueFlush.cpp b/test/conformance/queue/urQueueFlush.cpp index 997fd33e28..3907d3c020 100644 --- a/test/conformance/queue/urQueueFlush.cpp +++ b/test/conformance/queue/urQueueFlush.cpp @@ -4,12 +4,15 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "uur/fixtures.h" +#include "uur/known_failure.h" #include "uur/raii.h" using urQueueFlushTest = uur::urQueueTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urQueueFlushTest); TEST_P(urQueueFlushTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + constexpr size_t buffer_size = 1024; uur::raii::Mem buffer = nullptr; ASSERT_SUCCESS(urMemBufferCreate(context, UR_MEM_FLAG_READ_WRITE, diff --git a/test/conformance/queue/urQueueGetInfo.cpp b/test/conformance/queue/urQueueGetInfo.cpp index e5ae17e9a8..b3066c427d 100644 --- a/test/conformance/queue/urQueueGetInfo.cpp +++ b/test/conformance/queue/urQueueGetInfo.cpp @@ -3,11 +3,14 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urQueueGetInfoTest = uur::urQueueTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urQueueGetInfoTest); TEST_P(urQueueGetInfoTest, Context) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; auto infoType = UR_QUEUE_INFO_CONTEXT; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( @@ -22,6 +25,8 @@ TEST_P(urQueueGetInfoTest, Context) { } TEST_P(urQueueGetInfoTest, Device) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; auto infoType = UR_QUEUE_INFO_DEVICE; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( @@ -36,6 +41,8 @@ TEST_P(urQueueGetInfoTest, Device) { } TEST_P(urQueueGetInfoTest, Flags) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; auto infoType = UR_QUEUE_INFO_FLAGS; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( @@ -50,6 +57,8 @@ TEST_P(urQueueGetInfoTest, Flags) { } TEST_P(urQueueGetInfoTest, ReferenceCount) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; auto infoType = UR_QUEUE_INFO_REFERENCE_COUNT; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( @@ -64,6 +73,8 @@ TEST_P(urQueueGetInfoTest, ReferenceCount) { } TEST_P(urQueueGetInfoTest, EmptyQueue) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; auto infoType = UR_QUEUE_INFO_EMPTY; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( @@ -95,6 +106,8 @@ TEST_P(urQueueGetInfoTest, InvalidSizeZero) { } TEST_P(urQueueGetInfoTest, InvalidSizeSmall) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_context_handle_t context = nullptr; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, urQueueGetInfo(queue, UR_QUEUE_INFO_CONTEXT, @@ -117,6 +130,7 @@ TEST_P(urQueueGetInfoTest, InvalidNullPointerPropSizeRet) { struct urQueueGetInfoDeviceQueueTestWithInfoParam : public uur::urQueueTest { void SetUp() { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); urQueueGetInfoTest::SetUp(); ur_queue_flags_t deviceQueueCapabilities = 0; ASSERT_SUCCESS( @@ -147,7 +161,6 @@ struct urQueueGetInfoDeviceQueueTestWithInfoParam : public uur::urQueueTest { UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urQueueGetInfoDeviceQueueTestWithInfoParam); TEST_P(urQueueGetInfoDeviceQueueTestWithInfoParam, DeviceDefault) { - size_t size = 0; auto infoType = UR_QUEUE_INFO_DEVICE_DEFAULT; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( @@ -162,7 +175,6 @@ TEST_P(urQueueGetInfoDeviceQueueTestWithInfoParam, DeviceDefault) { } TEST_P(urQueueGetInfoDeviceQueueTestWithInfoParam, Size) { - size_t size = 0; auto infoType = UR_QUEUE_INFO_SIZE; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( diff --git a/test/conformance/queue/urQueueRelease.cpp b/test/conformance/queue/urQueueRelease.cpp index 8efa29731a..664bd9109e 100644 --- a/test/conformance/queue/urQueueRelease.cpp +++ b/test/conformance/queue/urQueueRelease.cpp @@ -3,11 +3,14 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urQueueReleaseTest = uur::urQueueTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urQueueReleaseTest); TEST_P(urQueueReleaseTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ASSERT_SUCCESS(urQueueRetain(queue)); uint32_t prevRefCount = 0; diff --git a/test/conformance/queue/urQueueRetain.cpp b/test/conformance/queue/urQueueRetain.cpp index c145fea84e..462b476930 100644 --- a/test/conformance/queue/urQueueRetain.cpp +++ b/test/conformance/queue/urQueueRetain.cpp @@ -3,11 +3,14 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urQueueRetainTest = uur::urQueueTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urQueueRetainTest); TEST_P(urQueueRetainTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + uint32_t prevRefCount = 0; ASSERT_SUCCESS(uur::GetObjectReferenceCount(queue, prevRefCount)); diff --git a/test/conformance/sampler/sampler_adapter_level_zero.match b/test/conformance/sampler/sampler_adapter_level_zero.match deleted file mode 100644 index edce72389c..0000000000 --- a/test/conformance/sampler/sampler_adapter_level_zero.match +++ /dev/null @@ -1,8 +0,0 @@ -{{OPT}}urSamplerGetInfoTest.SuccessReferenceCount/* -{{OPT}}urSamplerGetInfoTest.SuccessContext/* -{{OPT}}urSamplerGetInfoTest.SuccessNormalizedCoords/* -{{OPT}}urSamplerGetInfoTest.SuccessAddressingMode/* -{{OPT}}urSamplerGetInfoTest.SuccessFilterMode/* -{{OPT}}urSamplerGetInfoTest.InvalidSizePropSizeSmall/* -{{OPT}}urSamplerReleaseTest.Success/* -{{OPT}}urSamplerRetainTest.Success/* diff --git a/test/conformance/sampler/sampler_adapter_level_zero_v2.match b/test/conformance/sampler/sampler_adapter_level_zero_v2.match deleted file mode 100644 index db656e2b95..0000000000 --- a/test/conformance/sampler/sampler_adapter_level_zero_v2.match +++ /dev/null @@ -1,4 +0,0 @@ -{{OPT}}urSamplerGetInfoTestWithParam.Success/* -{{OPT}}urSamplerGetInfoTest.InvalidSizePropSizeSmall/* -{{OPT}}urSamplerReleaseTest.Success/* -{{OPT}}urSamplerRetainTest.Success/* diff --git a/test/conformance/sampler/urSamplerCreate.cpp b/test/conformance/sampler/urSamplerCreate.cpp index ceb61247e1..781aac5a51 100644 --- a/test/conformance/sampler/urSamplerCreate.cpp +++ b/test/conformance/sampler/urSamplerCreate.cpp @@ -4,11 +4,14 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "uur/fixtures.h" +#include "uur/known_failure.h" #include "uur/raii.h" struct urSamplerCreateTestWithParam : public uur::urContextTestWithParam { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); + UUR_RETURN_ON_FATAL_FAILURE( uur::urContextTestWithParam::SetUp()); @@ -34,7 +37,7 @@ struct urSamplerCreateTestWithParam } }; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urSamplerCreateTestWithParam, ::testing::Combine( ::testing::Values(true, false), diff --git a/test/conformance/sampler/urSamplerGetInfo.cpp b/test/conformance/sampler/urSamplerGetInfo.cpp index 6f7bbbcb61..b86831689a 100644 --- a/test/conformance/sampler/urSamplerGetInfo.cpp +++ b/test/conformance/sampler/urSamplerGetInfo.cpp @@ -4,11 +4,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urSamplerGetInfoTest = uur::urSamplerTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urSamplerGetInfoTest); TEST_P(urSamplerGetInfoTest, SuccessReferenceCount) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); size_t size = 0; auto infoType = UR_SAMPLER_INFO_REFERENCE_COUNT; ASSERT_SUCCESS(urSamplerGetInfo(sampler, infoType, 0, nullptr, &size)); @@ -22,6 +24,7 @@ TEST_P(urSamplerGetInfoTest, SuccessReferenceCount) { } TEST_P(urSamplerGetInfoTest, SuccessContext) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); size_t size = 0; auto infoType = UR_SAMPLER_INFO_CONTEXT; ASSERT_SUCCESS(urSamplerGetInfo(sampler, infoType, 0, nullptr, &size)); @@ -35,6 +38,7 @@ TEST_P(urSamplerGetInfoTest, SuccessContext) { } TEST_P(urSamplerGetInfoTest, SuccessNormalizedCoords) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); size_t size = 0; auto infoType = UR_SAMPLER_INFO_NORMALIZED_COORDS; ASSERT_SUCCESS(urSamplerGetInfo(sampler, infoType, 0, nullptr, &size)); @@ -42,6 +46,7 @@ TEST_P(urSamplerGetInfoTest, SuccessNormalizedCoords) { } TEST_P(urSamplerGetInfoTest, SuccessAddressingMode) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); size_t size = 0; auto infoType = UR_SAMPLER_INFO_ADDRESSING_MODE; ASSERT_SUCCESS(urSamplerGetInfo(sampler, infoType, 0, nullptr, &size)); @@ -57,6 +62,7 @@ TEST_P(urSamplerGetInfoTest, SuccessAddressingMode) { } TEST_P(urSamplerGetInfoTest, SuccessFilterMode) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); size_t size = 0; auto infoType = UR_SAMPLER_INFO_FILTER_MODE; ASSERT_SUCCESS(urSamplerGetInfo(sampler, infoType, 0, nullptr, &size)); @@ -106,7 +112,9 @@ TEST_P(urSamplerGetInfoTest, InvalidSizePropSizeZero) { } TEST_P(urSamplerGetInfoTest, InvalidSizePropSizeSmall) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); ur_sampler_addressing_mode_t mode = UR_SAMPLER_ADDRESSING_MODE_NONE; + ASSERT_EQ_RESULT(urSamplerGetInfo(sampler, UR_SAMPLER_INFO_ADDRESSING_MODE, sizeof(mode) - 1, &mode, nullptr), UR_RESULT_ERROR_INVALID_SIZE); diff --git a/test/conformance/sampler/urSamplerRelease.cpp b/test/conformance/sampler/urSamplerRelease.cpp index 0cb69419d3..3843d1579e 100644 --- a/test/conformance/sampler/urSamplerRelease.cpp +++ b/test/conformance/sampler/urSamplerRelease.cpp @@ -4,11 +4,14 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urSamplerReleaseTest = uur::urSamplerTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urSamplerReleaseTest); TEST_P(urSamplerReleaseTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); + ASSERT_SUCCESS(urSamplerRetain(sampler)); uint32_t prevRefCount = 0; diff --git a/test/conformance/sampler/urSamplerRetain.cpp b/test/conformance/sampler/urSamplerRetain.cpp index da750800c8..c158453c5b 100644 --- a/test/conformance/sampler/urSamplerRetain.cpp +++ b/test/conformance/sampler/urSamplerRetain.cpp @@ -4,11 +4,14 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urSamplerRetainTest = uur::urSamplerTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urSamplerRetainTest); TEST_P(urSamplerRetainTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); + uint32_t prevRefCount = 0; ASSERT_SUCCESS(uur::GetObjectReferenceCount(sampler, prevRefCount)); diff --git a/test/conformance/source/environment.cpp b/test/conformance/source/environment.cpp index 037ab4c882..4a593c24fb 100644 --- a/test/conformance/source/environment.cpp +++ b/test/conformance/source/environment.cpp @@ -69,74 +69,13 @@ AdapterEnvironment::AdapterEnvironment() { 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}, -}; - -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 std::vector &platforms) { - for (auto platform : platforms) { - out << "\n * \"" << platform << "\""; - } - return out; -} - -std::ostream &operator<<(std::ostream &out, - const std::vector &devices) { - for (auto device : devices) { - out << "\n * \"" << device << "\""; - } - return out; -} - -uur::PlatformEnvironment::PlatformEnvironment(int argc, char **argv) - : AdapterEnvironment(), platform_options{parsePlatformOptions(argc, argv)} { +uur::PlatformEnvironment::PlatformEnvironment() : AdapterEnvironment() { instance = this; - // Check for errors from parsing platform options - if (!error.empty()) { - return; - } - - selectPlatformFromOptions(); + populatePlatforms(); } -void uur::PlatformEnvironment::selectPlatformFromOptions() { - struct platform_info { - ur_adapter_handle_t adapter; - ur_platform_handle_t platform; - std::string name; - ur_platform_backend_t backend; - }; - std::vector platforms; +void uur::PlatformEnvironment::populatePlatforms() { for (auto a : adapters) { uint32_t count = 0; ASSERT_SUCCESS(urPlatformGet(&a, 1, 0, nullptr, &count)); @@ -145,97 +84,9 @@ void uur::PlatformEnvironment::selectPlatformFromOptions() { urPlatformGet(&a, 1, count, platform_list.data(), nullptr)); for (auto p : platform_list) { - all_platforms.push_back(p); - ur_platform_backend_t backend; - ASSERT_SUCCESS(urPlatformGetInfo(p, UR_PLATFORM_INFO_BACKEND, - sizeof(ur_platform_backend_t), - &backend, nullptr)); - - size_t size; - ASSERT_SUCCESS( - urPlatformGetInfo(p, UR_PLATFORM_INFO_NAME, 0, nullptr, &size)); - std::vector platform_name{}; - platform_name.reserve(size); - ASSERT_SUCCESS(urPlatformGetInfo(p, UR_PLATFORM_INFO_NAME, size, - platform_name.data(), nullptr)); - - platforms.push_back(platform_info{ - a, p, std::string(platform_name.data()), backend}); + platforms.push_back(p); } } - - 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"; - } - FAIL() << 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 " - "following or set --platforms_count=1:\n"; - for (const auto &p : platforms_filtered) { - errstr << " --backend=" << backend_to_str(p.backend) - << " --platform=\"" << p.name << "\"\n"; - } - FAIL() << errstr.str(); - } } void uur::PlatformEnvironment::SetUp() { @@ -260,168 +111,34 @@ 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"))) { - // TODO - print help - break; - } else if (std::strncmp( - 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(std::move(backend_string))) { - return options; - } - } else if (std::strncmp(arg, "--platforms_count=", - sizeof("--platforms_count=") - 1) == 0) { - options.platforms_count = std::strtoul( - &arg[std::strlen("--platforms_count=")], nullptr, 10); - } - } - - /* 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"); - if (env_platform.has_value()) { - 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; -} - -DevicesEnvironment::DeviceOptions -DevicesEnvironment::parseDeviceOptions(int argc, char **argv) { - DeviceOptions options{}; - for (int argi = 1; argi < argc; ++argi) { - const char *arg = argv[argi]; - if (!(std::strcmp(arg, "-h") && std::strcmp(arg, "--help"))) { - // TODO - print help - break; - } else if (std::strncmp(arg, "--device=", sizeof("--device=") - 1) == - 0) { - options.device_name = std::string(&arg[std::strlen("--device=")]); - } else if (std::strncmp(arg, "--devices_count=", - sizeof("--devices_count=") - 1) == 0) { - options.devices_count = std::strtoul( - &arg[std::strlen("--devices_count=")], nullptr, 10); - } - } - return options; -} - DevicesEnvironment *DevicesEnvironment::instance = nullptr; -DevicesEnvironment::DevicesEnvironment(int argc, char **argv) - : PlatformEnvironment(argc, argv), - device_options(parseDeviceOptions(argc, argv)) { +DevicesEnvironment::DevicesEnvironment() : PlatformEnvironment() { instance = this; if (!error.empty()) { return; } - uint32_t count = 0; - if (urDeviceGet(platform, UR_DEVICE_TYPE_ALL, 0, nullptr, &count)) { - error = "urDevicesGet() failed to get number of devices."; - return; - } - if (count == 0) { - error = "Could not find any devices associated with the platform"; - return; - } - // Get the argument (devices_count) to limit test devices count. - // In case, the devices_count is "0", the variable count will not be changed. - // The CTS will run on all devices. - if (device_options.device_name.empty()) { - if (device_options.devices_count > - (std::numeric_limits::max)()) { - error = "Invalid devices_count argument"; - return; - } else if (device_options.devices_count > 0) { - count = (std::min)( - count, static_cast(device_options.devices_count)); - } - devices.resize(count); - if (urDeviceGet(platform, UR_DEVICE_TYPE_ALL, count, devices.data(), - nullptr)) { - error = "urDeviceGet() failed to get devices."; - return; - } - } else { - devices.resize(count); - if (urDeviceGet(platform, UR_DEVICE_TYPE_ALL, count, devices.data(), - nullptr)) { - error = "urDeviceGet() failed to get devices."; - return; - } - for (unsigned i = 0; i < count; i++) { - size_t size; - if (urDeviceGetInfo(devices[i], UR_DEVICE_INFO_NAME, 0, nullptr, - &size)) { - error = "urDeviceGetInfo() failed"; - return; - } - std::vector device_name(size); - if (urDeviceGetInfo(devices[i], UR_DEVICE_INFO_NAME, size, - device_name.data(), nullptr)) { - error = "urDeviceGetInfo() failed"; - return; - } - if (device_options.device_name == device_name.data()) { - device = devices[i]; - devices.clear(); - devices.resize(1); - devices[0] = device; - break; - } - } - if (!device) { - std::stringstream ss_error; - ss_error << "Device \"" << device_options.device_name - << "\" not found. Select a single device from below " - "using the " - "--device=NAME command-line options:" - << devices << std::endl - << "or set --devices_count=COUNT."; - error = ss_error.str(); - return; + for (auto &platform : platforms) { + uint32_t platform_device_count = 0; + urDeviceGet(platform, UR_DEVICE_TYPE_ALL, 0, nullptr, + &platform_device_count); + std::vector platform_devices(platform_device_count); + urDeviceGet(platform, UR_DEVICE_TYPE_ALL, platform_device_count, + platform_devices.data(), nullptr); + ur_adapter_handle_t adapter = nullptr; + urPlatformGetInfo(platform, UR_PLATFORM_INFO_ADAPTER, + sizeof(ur_adapter_handle_t), &adapter, nullptr); + // query out platform and adapter for each device, push back device tuple appropriately + for (auto device : platform_devices) { + devices.push_back(DeviceTuple({device, platform, adapter})); } } + + if (devices.empty()) { + error = "Could not find any devices to test"; + return; + } } void DevicesEnvironment::SetUp() { @@ -436,8 +153,8 @@ void DevicesEnvironment::SetUp() { void DevicesEnvironment::TearDown() { PlatformEnvironment::TearDown(); - for (auto device : devices) { - if (urDeviceRelease(device)) { + for (auto device_tuple : devices) { + if (urDeviceRelease(device_tuple.device)) { error = "urDeviceRelease() failed"; return; } @@ -448,7 +165,7 @@ KernelsEnvironment *KernelsEnvironment::instance = nullptr; KernelsEnvironment::KernelsEnvironment(int argc, char **argv, const std::string &kernels_default_dir) - : DevicesEnvironment(argc, argv), + : DevicesEnvironment(), kernel_options(parseKernelOptions(argc, argv, kernels_default_dir)) { instance = this; if (!error.empty()) { @@ -475,7 +192,7 @@ KernelsEnvironment::parseKernelOptions(int argc, char **argv, return options; } -std::string KernelsEnvironment::getTargetName() { +std::string KernelsEnvironment::getTargetName(ur_platform_handle_t platform) { std::stringstream IL; if (instance->GetDevices().size() == 0) { @@ -510,11 +227,12 @@ std::string KernelsEnvironment::getTargetName() { } std::string -KernelsEnvironment::getKernelSourcePath(const std::string &kernel_name) { +KernelsEnvironment::getKernelSourcePath(const std::string &kernel_name, + ur_platform_handle_t platform) { std::stringstream path; path << kernel_options.kernel_directory << "/" << kernel_name; - std::string target_name = getTargetName(); + std::string target_name = getTargetName(platform); if (target_name.empty()) { return {}; } @@ -525,9 +243,10 @@ KernelsEnvironment::getKernelSourcePath(const std::string &kernel_name) { } void KernelsEnvironment::LoadSource( - const std::string &kernel_name, + const std::string &kernel_name, ur_platform_handle_t platform, std::shared_ptr> &binary_out) { - std::string source_path = instance->getKernelSourcePath(kernel_name); + std::string source_path = + instance->getKernelSourcePath(kernel_name, platform); if (source_path.empty()) { FAIL() << error; diff --git a/test/conformance/source/main.cpp b/test/conformance/source/main.cpp index 1a1e3b0380..59aa38ccdd 100644 --- a/test/conformance/source/main.cpp +++ b/test/conformance/source/main.cpp @@ -10,9 +10,9 @@ int main(int argc, char **argv) { auto *environment = new uur::KernelsEnvironment(argc, argv, KERNELS_DEFAULT_DIR); #elif DEVICES_ENVIRONMENT - auto *environment = new uur::DevicesEnvironment(argc, argv); + auto *environment = new uur::DevicesEnvironment(); #elif PLATFORM_ENVIRONMENT - auto *environment = new uur::PlatformEnvironment(argc, argv); + auto *environment = new uur::PlatformEnvironment(); #else auto *environment = new uur::AdapterEnvironment(); #endif diff --git a/test/conformance/testing/include/uur/environment.h b/test/conformance/testing/include/uur/environment.h index 3d6c2cc0e4..92fd7dca37 100644 --- a/test/conformance/testing/include/uur/environment.h +++ b/test/conformance/testing/include/uur/environment.h @@ -15,7 +15,6 @@ namespace uur { struct AdapterEnvironment : ::testing::Environment { - AdapterEnvironment(); virtual ~AdapterEnvironment() override = default; @@ -25,52 +24,36 @@ struct AdapterEnvironment : ::testing::Environment { }; struct PlatformEnvironment : AdapterEnvironment { - - struct PlatformOptions { - std::string platform_name; - std::optional platform_backend; - unsigned long platforms_count = 0; - }; - - PlatformEnvironment(int argc, char **argv); + PlatformEnvironment(); virtual ~PlatformEnvironment() override = default; virtual void SetUp() override; virtual void TearDown() override; - void selectPlatformFromOptions(); - PlatformOptions parsePlatformOptions(int argc, char **argv); + void populatePlatforms(); - PlatformOptions platform_options; - // List of all discovered platforms - std::vector all_platforms; - // Adapter and platform selected for testing via platform_options - ur_adapter_handle_t adapter = nullptr; - ur_platform_handle_t platform = nullptr; + std::vector platforms; static PlatformEnvironment *instance; }; -struct DevicesEnvironment : PlatformEnvironment { - - struct DeviceOptions { - std::string device_name; - unsigned long devices_count = 0; - }; +struct DeviceTuple { + ur_device_handle_t device; + ur_platform_handle_t platform; + ur_adapter_handle_t adapter; +}; - DevicesEnvironment(int argc, char **argv); +struct DevicesEnvironment : PlatformEnvironment { + DevicesEnvironment(); virtual ~DevicesEnvironment() override = default; virtual void SetUp() override; virtual void TearDown() override; - DeviceOptions parseDeviceOptions(int argc, char **argv); - - inline const std::vector &GetDevices() const { + inline const std::vector &GetDevices() const { return devices; } - DeviceOptions device_options; - std::vector devices; + std::vector devices; ur_device_handle_t device = nullptr; static DevicesEnvironment *instance; }; @@ -88,6 +71,7 @@ struct KernelsEnvironment : DevicesEnvironment { virtual void TearDown() override; void LoadSource(const std::string &kernel_name, + ur_platform_handle_t platform, std::shared_ptr> &binary_out); ur_result_t CreateProgram(ur_platform_handle_t hPlatform, @@ -104,8 +88,9 @@ struct KernelsEnvironment : DevicesEnvironment { private: KernelOptions parseKernelOptions(int argc, char **argv, const std::string &kernels_default_dir); - std::string getKernelSourcePath(const std::string &kernel_name); - std::string getTargetName(); + std::string getKernelSourcePath(const std::string &kernel_name, + ur_platform_handle_t platform); + std::string getTargetName(ur_platform_handle_t platform); KernelOptions kernel_options; // mapping between kernels (full_path + kernel_name) and their saved source. diff --git a/test/conformance/testing/include/uur/fixtures.h b/test/conformance/testing/include/uur/fixtures.h index 6169c0e701..80bbff6d49 100644 --- a/test/conformance/testing/include/uur/fixtures.h +++ b/test/conformance/testing/include/uur/fixtures.h @@ -7,10 +7,10 @@ #define UR_CONFORMANCE_INCLUDE_FIXTURES_H_INCLUDED #include "ur_api.h" -#include "ur_ddi.h" #include #include +#include #include #include @@ -42,19 +42,6 @@ struct urAdapterTest : ::testing::Test, ur_adapter_handle_t adapter; }; -// Inherit this to get the platform/adapter that was selected via the --backend -// and --platform arguments (or defaulted to if only one platform was -// discovered) -struct urSelectedPlatformTest : ::testing::Test { - void SetUp() override { - platform = uur::PlatformEnvironment::instance->platform; - adapter = uur::PlatformEnvironment::instance->adapter; - } - - ur_platform_handle_t platform = nullptr; - ur_adapter_handle_t adapter = nullptr; -}; - // In the vein of urAdapterTest and urDeviceTest this is a parameterized // platform fixture which can be instantiated via // UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P to run tests on each discovered @@ -91,9 +78,9 @@ inline bool hasDevicePartitionSupport(ur_device_handle_t device, properties.end(); } -struct urAllDevicesTest : urSelectedPlatformTest { +struct urAllDevicesTest : urPlatformTest { void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urSelectedPlatformTest::SetUp()); + UUR_RETURN_ON_FATAL_FAILURE(urPlatformTest::SetUp()); auto devicesPair = GetDevices(platform); if (!devicesPair.first) { FAIL() << "Failed to get devices"; @@ -105,26 +92,23 @@ struct urAllDevicesTest : urSelectedPlatformTest { for (auto &device : devices) { EXPECT_SUCCESS(urDeviceRelease(device)); } - UUR_RETURN_ON_FATAL_FAILURE(urSelectedPlatformTest::TearDown()); + UUR_RETURN_ON_FATAL_FAILURE(urPlatformTest::TearDown()); } std::vector devices; }; -struct urDeviceTest : urSelectedPlatformTest, - ::testing::WithParamInterface { +struct urDeviceTest : ::testing::Test, + ::testing::WithParamInterface { void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urSelectedPlatformTest::SetUp()); - device = GetParam(); - EXPECT_SUCCESS(urDeviceRetain(device)); - } - - void TearDown() override { - EXPECT_SUCCESS(urDeviceRelease(device)); - UUR_RETURN_ON_FATAL_FAILURE(urSelectedPlatformTest::SetUp()); + device = GetParam().device; + platform = GetParam().platform; + adapter = GetParam().adapter; } - ur_device_handle_t device; + ur_device_handle_t device = nullptr; + ur_platform_handle_t platform = nullptr; + ur_adapter_handle_t adapter = nullptr; }; } // namespace uur @@ -139,8 +123,7 @@ struct urDeviceTest : urSelectedPlatformTest, #define UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(FIXTURE) \ INSTANTIATE_TEST_SUITE_P( \ , FIXTURE, \ - ::testing::ValuesIn( \ - uur::PlatformEnvironment::instance->all_platforms), \ + ::testing::ValuesIn(uur::PlatformEnvironment::instance->platforms), \ [](const ::testing::TestParamInfo &info) { \ return uur::GetPlatformNameWithID(info.param); \ }) @@ -149,31 +132,57 @@ struct urDeviceTest : urSelectedPlatformTest, INSTANTIATE_TEST_SUITE_P( \ , FIXTURE, \ ::testing::ValuesIn(uur::DevicesEnvironment::instance->devices), \ - [](const ::testing::TestParamInfo &info) { \ - return uur::GetPlatformAndDeviceName(info.param); \ - }) - -#define UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(FIXTURE) \ - INSTANTIATE_TEST_SUITE_P( \ - , FIXTURE, \ - ::testing::ValuesIn(uur::KernelsEnvironment::instance->devices), \ - [](const ::testing::TestParamInfo &info) { \ - return uur::GetPlatformAndDeviceName(info.param); \ + [](const ::testing::TestParamInfo &info) { \ + return uur::GetPlatformAndDeviceName(info.param.device); \ }) namespace uur { +template +struct urPlatformTestWithParam + : ::testing::Test, + ::testing::WithParamInterface> { + void SetUp() override { platform = std::get<0>(this->GetParam()); } + const T &getParam() const { return std::get<1>(this->GetParam()); } + ur_platform_handle_t platform; +}; + +template +struct urAllDevicesTestWithParam : urPlatformTestWithParam { + void SetUp() override { + UUR_RETURN_ON_FATAL_FAILURE(urPlatformTestWithParam::SetUp()); + auto devicesPair = GetDevices(this->platform); + if (!devicesPair.first) { + FAIL() << "Failed to get devices"; + } + devices = std::move(devicesPair.second); + } + + void TearDown() override { + for (auto &device : devices) { + EXPECT_SUCCESS(urDeviceRelease(device)); + } + UUR_RETURN_ON_FATAL_FAILURE(urPlatformTestWithParam::TearDown()); + } + + std::vector devices; +}; + template struct urDeviceTestWithParam - : urSelectedPlatformTest, - ::testing::WithParamInterface> { + : ::testing::Test, + ::testing::WithParamInterface> { void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urSelectedPlatformTest::SetUp()); - device = std::get<0>(this->GetParam()); + auto &device_tuple = std::get<0>(this->GetParam()); + device = device_tuple.device; + platform = device_tuple.platform; + adapter = device_tuple.adapter; } // TODO - I don't like the confusion with GetParam(); const T &getParam() const { return std::get<1>(this->GetParam()); } ur_device_handle_t device; + ur_platform_handle_t platform; + ur_adapter_handle_t adapter; }; struct urContextTest : urDeviceTest { @@ -184,7 +193,9 @@ struct urContextTest : urDeviceTest { } void TearDown() override { - EXPECT_SUCCESS(urContextRelease(context)); + if (context) { + EXPECT_SUCCESS(urContextRelease(context)); + } UUR_RETURN_ON_FATAL_FAILURE(urDeviceTest::TearDown()); } @@ -193,6 +204,7 @@ struct urContextTest : urDeviceTest { struct urSamplerTest : urContextTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); UUR_RETURN_ON_FATAL_FAILURE(urContextTest::SetUp()); sampler_desc = { UR_STRUCTURE_TYPE_SAMPLER_DESC, /* stype */ @@ -282,7 +294,15 @@ struct urMemImageTest : urContextTest { } // namespace uur -#define UUR_TEST_SUITE_P(FIXTURE, VALUES, PRINTER) \ +#define UUR_PLATFORM_TEST_SUITE_P(FIXTURE, VALUES, PRINTER) \ + INSTANTIATE_TEST_SUITE_P( \ + , FIXTURE, \ + testing::Combine(::testing::ValuesIn( \ + uur::PlatformEnvironment::instance->platforms), \ + VALUES), \ + PRINTER) + +#define UUR_DEVICE_TEST_SUITE_P(FIXTURE, VALUES, PRINTER) \ INSTANTIATE_TEST_SUITE_P( \ , FIXTURE, \ testing::Combine( \ @@ -299,14 +319,17 @@ template struct urContextTestWithParam : urDeviceTestWithParam { } void TearDown() override { - EXPECT_SUCCESS(urContextRelease(context)); + if (context) { + EXPECT_SUCCESS(urContextRelease(context)); + } UUR_RETURN_ON_FATAL_FAILURE(urDeviceTestWithParam::TearDown()); } - ur_context_handle_t context; + ur_context_handle_t context = nullptr; }; template struct urSamplerTestWithParam : urContextTestWithParam { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); UUR_RETURN_ON_FATAL_FAILURE(urContextTestWithParam::SetUp()); sampler_desc = { UR_STRUCTURE_TYPE_SAMPLER_DESC, /* stype */ @@ -394,6 +417,12 @@ struct urQueueTest : urContextTest { struct urHostPipeTest : urQueueTest { void SetUp() override { + // We haven't got device code tests working on native cpu yet. + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + + // The host pipe support query isn't implement on l0 + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp()); size_t size = 0; @@ -416,7 +445,8 @@ struct urHostPipeTest : urQueueTest { } UUR_RETURN_ON_FATAL_FAILURE( - uur::KernelsEnvironment::instance->LoadSource("foo", il_binary)); + uur::KernelsEnvironment::instance->LoadSource("foo", platform, + il_binary)); ASSERT_SUCCESS(uur::KernelsEnvironment::instance->CreateProgram( platform, context, device, *il_binary, nullptr, &program)); } @@ -439,10 +469,13 @@ struct urHostPipeTest : urQueueTest { }; template struct urQueueTestWithParam : urContextTestWithParam { + using urContextTestWithParam::device; + using urContextTestWithParam::context; + void SetUp() override { UUR_RETURN_ON_FATAL_FAILURE(urContextTestWithParam::SetUp()); - ASSERT_SUCCESS(urQueueCreate(this->context, this->device, - &queue_properties, &queue)); + ASSERT_SUCCESS( + urQueueCreate(context, device, &queue_properties, &queue)); ASSERT_NE(queue, nullptr); } @@ -567,10 +600,9 @@ struct urMultiQueueTestWithParam : urContextTestWithParam { }; template -struct urMultiDeviceContextTestTemplate : urSelectedPlatformTest { +struct urMultiDeviceContextTestTemplate : urAllDevicesTest { void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urSelectedPlatformTest::SetUp()); - auto &devices = DevicesEnvironment::instance->devices; + UUR_RETURN_ON_FATAL_FAILURE(urAllDevicesTest::SetUp()); if (devices.size() < MinDevices) { GTEST_SKIP(); } @@ -582,7 +614,7 @@ struct urMultiDeviceContextTestTemplate : urSelectedPlatformTest { if (context) { ASSERT_SUCCESS(urContextRelease(context)); } - UUR_RETURN_ON_FATAL_FAILURE(urSelectedPlatformTest::TearDown()); + UUR_RETURN_ON_FATAL_FAILURE(urAllDevicesTest::TearDown()); } ur_context_handle_t context = nullptr; @@ -615,8 +647,8 @@ struct urMultiDeviceMemBufferTest : urMultiDeviceContextTest { struct urMultiDeviceMemBufferQueueTest : urMultiDeviceMemBufferTest { void SetUp() override { UUR_RETURN_ON_FATAL_FAILURE(urMultiDeviceMemBufferTest::SetUp()); - queues.reserve(DevicesEnvironment::instance->devices.size()); - for (const auto &device : DevicesEnvironment::instance->devices) { + queues.reserve(devices.size()); + for (const auto &device : devices) { ur_queue_handle_t queue = nullptr; ASSERT_SUCCESS(urQueueCreate(context, device, 0, &queue)); queues.push_back(queue); @@ -737,7 +769,7 @@ struct urMemImageQueueTest : urQueueTest { struct urMultiDeviceMemImageTest : urMultiDeviceContextTest { void SetUp() override { UUR_RETURN_ON_FATAL_FAILURE(urMultiDeviceContextTest::SetUp()); - for (auto device : DevicesEnvironment::instance->devices) { + for (auto device : devices) { ur_bool_t imageSupported = false; ASSERT_SUCCESS( urDeviceGetInfo(device, UR_DEVICE_INFO_IMAGE_SUPPORTED, @@ -821,8 +853,8 @@ struct urMultiDeviceMemImageTest : urMultiDeviceContextTest { struct urMultiDeviceMemImageQueueTest : urMultiDeviceMemImageTest { void SetUp() override { UUR_RETURN_ON_FATAL_FAILURE(urMultiDeviceMemImageTest::SetUp()); - queues.reserve(DevicesEnvironment::instance->devices.size()); - for (const auto &device : DevicesEnvironment::instance->devices) { + queues.reserve(devices.size()); + for (const auto &device : devices) { ur_queue_handle_t queue = nullptr; ASSERT_SUCCESS(urQueueCreate(context, device, 0, &queue)); queues.push_back(queue); @@ -888,7 +920,9 @@ struct urUSMDeviceAllocTest : urQueueTest { } void TearDown() override { - ASSERT_SUCCESS(urUSMFree(context, ptr)); + if (ptr) { + ASSERT_SUCCESS(urUSMFree(context, ptr)); + } uur::urQueueTest::TearDown(); } @@ -944,6 +978,8 @@ template struct urUSMPoolTestWithParam : urContextTestWithParam { struct urVirtualMemGranularityTest : urContextTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(urContextTest::SetUp()); ur_bool_t virtual_memory_support = false; @@ -964,6 +1000,8 @@ struct urVirtualMemGranularityTest : urContextTest { template struct urVirtualMemGranularityTestWithParam : urContextTestWithParam { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(urContextTestWithParam::SetUp()); ur_bool_t virtual_memory_support = false; @@ -1175,14 +1213,26 @@ inline void generateMemFillPattern(std::vector &pattern) { std::generate(begin(pattern), end(pattern), gen); } +template +std::string platformTestWithParamPrinter( + const ::testing::TestParamInfo> &info) { + auto platform = std::get<0>(info.param); + auto param = std::get<1>(info.param); + + std::stringstream ss; + ss << param; + return uur::GetPlatformNameWithID(platform) + "__" + + GTestSanitizeString(ss.str()); +} + /// @brief /// @tparam T /// @param info /// @return template std::string deviceTestWithParamPrinter( - const ::testing::TestParamInfo> &info) { - auto device = std::get<0>(info.param); + const ::testing::TestParamInfo> &info) { + auto device = std::get<0>(info.param).device; auto param = std::get<1>(info.param); std::stringstream ss; @@ -1192,8 +1242,8 @@ std::string deviceTestWithParamPrinter( template <> std::string deviceTestWithParamPrinter( - const ::testing::TestParamInfo< - std::tuple> &info); + const ::testing::TestParamInfo> + &info); // Helper struct to allow bool param tests with meaningful names. struct BoolTestParam { @@ -1208,19 +1258,27 @@ struct BoolTestParam { template <> std::string deviceTestWithParamPrinter( + const ::testing::TestParamInfo> + &info); + +template <> +std::string platformTestWithParamPrinter( const ::testing::TestParamInfo< - std::tuple> &info); + std::tuple> &info); using SamplerCreateParamT = std::tuple; template <> std::string deviceTestWithParamPrinter( - const ::testing::TestParamInfo< - std::tuple> &info); + const ::testing::TestParamInfo> + &info); struct urProgramTest : urQueueTest { void SetUp() override { + // We haven't got device code tests working on native cpu yet. + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp()); ur_platform_backend_t backend; @@ -1233,7 +1291,7 @@ struct urProgramTest : urQueueTest { } UUR_RETURN_ON_FATAL_FAILURE( uur::KernelsEnvironment::instance->LoadSource(program_name, - il_binary)); + platform, il_binary)); const ur_program_properties_t properties = { UR_STRUCTURE_TYPE_PROGRAM_PROPERTIES, nullptr, @@ -1258,6 +1316,9 @@ struct urProgramTest : urQueueTest { template struct urProgramTestWithParam : urQueueTestWithParam { void SetUp() override { + // We haven't got device code tests working on native cpu yet. + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + UUR_RETURN_ON_FATAL_FAILURE(urQueueTestWithParam::SetUp()); ur_platform_backend_t backend; @@ -1271,8 +1332,8 @@ template struct urProgramTestWithParam : urQueueTestWithParam { } UUR_RETURN_ON_FATAL_FAILURE( - uur::KernelsEnvironment::instance->LoadSource(program_name, - il_binary)); + uur::KernelsEnvironment::instance->LoadSource( + program_name, this->platform, il_binary)); ASSERT_SUCCESS(uur::KernelsEnvironment::instance->CreateProgram( this->platform, this->context, this->device, *il_binary, nullptr, &program)); @@ -1299,6 +1360,9 @@ template struct urProgramTestWithParam : urQueueTestWithParam { // instead. struct urBaseKernelTest : urProgramTest { void SetUp() override { + // We haven't got device code tests working on native cpu yet. + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + UUR_RETURN_ON_FATAL_FAILURE(urProgramTest::SetUp()); auto kernel_names = uur::KernelsEnvironment::instance->GetEntryPointNames(program_name); @@ -1337,7 +1401,7 @@ struct urBaseKernelTest : urProgramTest { struct urKernelTest : urBaseKernelTest { void SetUp() override { - urBaseKernelTest::SetUp(); + UUR_RETURN_ON_FATAL_FAILURE(urBaseKernelTest::SetUp()); Build(); } }; @@ -1639,8 +1703,8 @@ struct urGlobalVariableTest : uur::urKernelExecutionTest { struct urMultiDeviceQueueTest : urMultiDeviceContextTest { void SetUp() override { UUR_RETURN_ON_FATAL_FAILURE(urMultiDeviceContextTest::SetUp()); - queues.reserve(DevicesEnvironment::instance->devices.size()); - for (const auto &device : DevicesEnvironment::instance->devices) { + queues.reserve(devices.size()); + for (const auto &device : devices) { ur_queue_handle_t queue = nullptr; ASSERT_SUCCESS(urQueueCreate(context, device, 0, &queue)); queues.push_back(queue); @@ -1669,13 +1733,12 @@ struct urMultiDeviceProgramTest : urMultiDeviceQueueTest { backend == UR_PLATFORM_BACKEND_CUDA) { GTEST_SKIP(); } - devices = uur::DevicesEnvironment::instance->devices; if (devices.size() < 2) { GTEST_SKIP(); } UUR_RETURN_ON_FATAL_FAILURE( uur::KernelsEnvironment::instance->LoadSource(program_name, - il_binary)); + platform, il_binary)); const ur_program_properties_t properties = { UR_STRUCTURE_TYPE_PROGRAM_PROPERTIES, nullptr, @@ -1698,7 +1761,6 @@ struct urMultiDeviceProgramTest : urMultiDeviceQueueTest { std::string program_name = "foo"; ur_program_handle_t program = nullptr; std::vector metadatas{}; - std::vector devices; }; } // namespace uur diff --git a/test/conformance/testing/include/uur/known_failure.h b/test/conformance/testing/include/uur/known_failure.h new file mode 100644 index 0000000000..6f2b2091f5 --- /dev/null +++ b/test/conformance/testing/include/uur/known_failure.h @@ -0,0 +1,214 @@ +// Copyright (C) 2024 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 + +#ifndef UR_CONFORMANCE_INCLUDE_KNOWN_FAILURE_H_INCLUDED +#define UR_CONFORMANCE_INCLUDE_KNOWN_FAILURE_H_INCLUDED + +#include "uur/environment.h" +#include "uur/utils.h" +#include +#include +#include +#include + +namespace uur { +struct Matcher { + Matcher(uint32_t adapterVersion, ur_adapter_backend_t backend, + std::vector deviceNames) + : adapterVersion(adapterVersion), backend(backend), names(deviceNames) { + } + + uint32_t adapterVersion; + ur_adapter_backend_t backend; + std::vector names; +}; + +struct OpenCL : Matcher { + OpenCL(std::initializer_list il) + : Matcher(1, UR_ADAPTER_BACKEND_OPENCL, {il.begin(), il.end()}) {} +}; + +struct LevelZero : Matcher { + LevelZero(std::initializer_list il) + : Matcher(1, UR_ADAPTER_BACKEND_LEVEL_ZERO, {il.begin(), il.end()}) {} +}; + +struct LevelZeroV2 : Matcher { + LevelZeroV2(std::initializer_list il) + : Matcher(2, UR_ADAPTER_BACKEND_LEVEL_ZERO, {il.begin(), il.end()}) {} +}; + +struct CUDA : Matcher { + CUDA(std::initializer_list il) + : Matcher(1, UR_ADAPTER_BACKEND_CUDA, {il.begin(), il.end()}) {} +}; + +struct HIP : Matcher { + HIP(std::initializer_list il) + : Matcher(1, UR_ADAPTER_BACKEND_HIP, {il.begin(), il.end()}) {} +}; + +struct NativeCPU : Matcher { + NativeCPU(std::initializer_list il) + : Matcher(1, UR_ADAPTER_BACKEND_NATIVE_CPU, {il.begin(), il.end()}) {} +}; + +namespace detail { +struct AdapterInfo { + uint32_t version; + ur_adapter_backend_t backend; +}; + +inline AdapterInfo getAdapterInfo(ur_adapter_handle_t adapter) { + AdapterInfo info; + urAdapterGetInfo(adapter, UR_ADAPTER_INFO_VERSION, sizeof(info.version), + &info.version, nullptr); + urAdapterGetInfo(adapter, UR_ADAPTER_INFO_BACKEND, sizeof(info.backend), + &info.backend, nullptr); + return info; +} +} // namespace detail + +inline bool isKnownFailureOn(ur_adapter_handle_t adapter, + const std::vector &matchers) { + for (const auto &matcher : matchers) { + auto adapterInfo = detail::getAdapterInfo(adapter); + if (matcher.adapterVersion == adapterInfo.version && + matcher.backend == adapterInfo.backend) { + return true; + } + } + return false; +} + +inline bool isKnownFailureOn(ur_platform_handle_t platform, + const std::vector &matchers) { + ur_adapter_handle_t adapter = nullptr; + urPlatformGetInfo(platform, UR_PLATFORM_INFO_ADAPTER, + sizeof(ur_adapter_handle_t), &adapter, nullptr); + for (const auto &matcher : matchers) { + auto adapterInfo = detail::getAdapterInfo(adapter); + if (matcher.adapterVersion != adapterInfo.version && + matcher.backend != adapterInfo.backend) { + continue; + } + if (matcher.names.empty()) { + return true; + } + std::string name; + uur::GetPlatformInfo(platform, UR_PLATFORM_INFO_NAME, + name); + for (const auto &matcherName : matcher.names) { + if (name.find(matcherName) != std::string::npos) { + return true; + } + } + } + return false; +} + +template +inline bool +isKnownFailureOn(const std::tuple ¶m, + const std::vector &matchers) { + ur_platform_handle_t platform = std::get<0>(param); + return isKnownFailureOn(platform, matchers); +} + +inline bool isKnownFailureOn(const DeviceTuple ¶m, + const std::vector &matchers) { + for (const auto &matcher : matchers) { + auto adapterInfo = detail::getAdapterInfo(param.adapter); + if (matcher.backend != adapterInfo.backend) { + continue; + } + if (matcher.adapterVersion != adapterInfo.version) { + continue; + } + if (matcher.names.empty()) { + return true; + } + std::string name; + uur::GetDeviceInfo(param.device, UR_DEVICE_INFO_NAME, + name); + for (const auto &matcherName : matcher.names) { + if (name.find(matcherName) != std::string::npos) { + return true; + } + } + } + return false; +} + +template +inline bool isKnownFailureOn(const std::tuple ¶m, + const std::vector &matchers) { + return isKnownFailureOn(std::get<0>(param), matchers); +} + +inline std::string knownFailureMessage(ur_adapter_handle_t adapter) { + std::string backend = uur::GetAdapterBackendName(adapter); + return "Known failure on: " + backend; +} + +inline std::string knownFailureMessage(ur_platform_handle_t platform) { + ur_adapter_handle_t adapter = nullptr; + urPlatformGetInfo(platform, UR_PLATFORM_INFO_ADAPTER, + sizeof(ur_adapter_handle_t), &adapter, nullptr); + std::string backend = uur::GetAdapterBackendName(adapter); + std::string platformName; + uur::GetPlatformInfo(platform, UR_PLATFORM_INFO_NAME, + platformName); + return "Known failure on: " + backend + ", " + platformName; +} + +template +inline std::string +knownFailureMessage(const std::tuple ¶m) { + ur_platform_handle_t platform = std::get<0>(param); + return knownFailureMessage(platform); +} + +inline std::string knownFailureMessage(const DeviceTuple ¶m) { + std::string backend = uur::GetAdapterBackendName(param.adapter); + std::string platformName; + uur::GetPlatformInfo(param.platform, UR_PLATFORM_INFO_NAME, + platformName); + std::string deviceName; + uur::GetDeviceInfo(param.device, UR_DEVICE_INFO_NAME, + deviceName); + return "Known failure on: " + backend + ", " + platformName + ", " + + deviceName; +} + +template +inline std::string +knownFailureMessage(const std::tuple ¶m) { + return knownFailureMessage(std::get<0>(param)); +} + +inline bool alsoRunKnownFailures() { + if (const char *envvar = std::getenv("UR_CTS_ALSO_RUN_KNOWN_FAILURES")) { + std::string_view value(envvar); + return value == "1" || value == "ON" || value == "on" || + value == "YES" || value == "yes" || value == "true" || + value == "TRUE"; + } + return false; +} +} // namespace uur + +#define UUR_KNOWN_FAILURE_ON(...) \ + if (uur::isKnownFailureOn(this->GetParam(), {__VA_ARGS__})) { \ + auto message = uur::knownFailureMessage(this->GetParam()); \ + if (uur::alsoRunKnownFailures()) { \ + std::cerr << message << "\n"; \ + } else { \ + GTEST_SKIP() << message; \ + } \ + } \ + (void)0 + +#endif // UR_CONFORMANCE_INCLUDE_KNOWN_FAILURE_H_INCLUDED diff --git a/test/conformance/testing/include/uur/utils.h b/test/conformance/testing/include/uur/utils.h index 76b0cfe31d..667b54286c 100644 --- a/test/conformance/testing/include/uur/utils.h +++ b/test/conformance/testing/include/uur/utils.h @@ -28,10 +28,6 @@ inline std::string GTestSanitizeString(const std::string &str) { return str_cpy; } -inline ur_platform_handle_t GetPlatform() { - return PlatformEnvironment::instance->platform; -} - template ur_result_t GetInfo(ObjectTy object, InfoTy info, Callable cb, T &out_value) { // first get the size of the info @@ -43,12 +39,13 @@ ur_result_t GetInfo(ObjectTy object, InfoTy info, Callable cb, T &out_value) { // special case for strings if constexpr (std::is_same_v) { - std::vector data(size); - result = cb(object, info, size, data.data(), nullptr); + std::string value(size, '\0'); + result = cb(object, info, size, value.data(), nullptr); if (result != UR_RESULT_SUCCESS) { return result; } - out_value = std::string(data.data(), data.size()); + out_value = + value.substr(0, std::min(value.find_last_of('\0'), value.size())); return UR_RESULT_SUCCESS; } else { if (size != sizeof(T)) { @@ -192,7 +189,7 @@ inline std::string GetPlatformName(ur_platform_handle_t hPlatform) { inline std::string GetPlatformNameWithID(ur_platform_handle_t hPlatform) { auto platform_name = GetPlatformName(hPlatform); - auto &platforms = uur::PlatformEnvironment::instance->all_platforms; + auto &platforms = uur::PlatformEnvironment::instance->platforms; size_t platform_id = std::find(platforms.begin(), platforms.end(), hPlatform) - platforms.begin(); @@ -210,15 +207,22 @@ inline std::string GetDeviceName(ur_device_handle_t device) { size_t device_id = 0; if (uur::DevicesEnvironment::instance) { auto &devices = uur::DevicesEnvironment::instance->devices; + auto TupleContainsDevice = [device](DeviceTuple &tuple) -> bool { + return device == tuple.device; + }; device_id = - std::find(devices.begin(), devices.end(), device) - devices.begin(); + std::find_if(devices.begin(), devices.end(), TupleContainsDevice) - + devices.begin(); } return GTestSanitizeString(device_name + "_ID" + std::to_string(device_id) + "ID_" + device_uuid); } inline std::string GetPlatformAndDeviceName(ur_device_handle_t device) { - return GetPlatformName(GetPlatform()) + "__" + GetDeviceName(device); + ur_platform_handle_t platform = nullptr; + urDeviceGetInfo(device, UR_DEVICE_INFO_PLATFORM, + sizeof(ur_platform_handle_t), &platform, nullptr); + return GetPlatformName(platform) + "__" + GetDeviceName(device); } ur_result_t GetDeviceType(ur_device_handle_t device, diff --git a/test/conformance/testing/source/fixtures.cpp b/test/conformance/testing/source/fixtures.cpp index bdb80c60be..ff29e1a2d9 100644 --- a/test/conformance/testing/source/fixtures.cpp +++ b/test/conformance/testing/source/fixtures.cpp @@ -8,9 +8,9 @@ namespace uur { template <> std::string deviceTestWithParamPrinter( - const ::testing::TestParamInfo< - std::tuple> &info) { - auto device = std::get<0>(info.param); + const ::testing::TestParamInfo> + &info) { + auto device = std::get<0>(info.param).device; auto param = std::get<1>(info.param); std::stringstream ss; @@ -18,11 +18,23 @@ std::string deviceTestWithParamPrinter( return uur::GetPlatformAndDeviceName(device) + "__" + ss.str(); } +template <> +std::string platformTestWithParamPrinter( + const ::testing::TestParamInfo< + std::tuple> &info) { + auto platform = std::get<0>(info.param); + auto param = std::get<1>(info.param); + + std::stringstream ss; + ss << param.name << (param.value ? "Enabled" : "Disabled"); + return uur::GetPlatformNameWithID(platform) + "__" + ss.str(); +} + template <> std::string deviceTestWithParamPrinter( const ::testing::TestParamInfo< - std::tuple> &info) { - auto device = std::get<0>(info.param); + std::tuple> &info) { + auto device = std::get<0>(info.param).device; auto param = std::get<1>(info.param); const auto normalized = std::get<0>(param); @@ -42,9 +54,9 @@ std::string deviceTestWithParamPrinter( template <> std::string deviceTestWithParamPrinter( - const ::testing::TestParamInfo< - std::tuple> &info) { - auto device = std::get<0>(info.param); + const ::testing::TestParamInfo> + &info) { + auto device = std::get<0>(info.param).device; auto param = std::get<1>(info.param); auto ChannelOrder = param.channelOrder; auto ChannelType = param.channelType; diff --git a/test/conformance/usm/helpers.h b/test/conformance/usm/helpers.h index 26958208e3..ba9a37ac76 100644 --- a/test/conformance/usm/helpers.h +++ b/test/conformance/usm/helpers.h @@ -16,7 +16,7 @@ template inline std::string printUSMAllocTestString( const testing::TestParamInfo &info) { // ParamType will be std::tuple - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); const auto &usmDeviceAllocParams = std::get<1>(info.param); diff --git a/test/conformance/usm/urUSMDeviceAlloc.cpp b/test/conformance/usm/urUSMDeviceAlloc.cpp index bfc48c2aa6..dc01e85e3f 100644 --- a/test/conformance/usm/urUSMDeviceAlloc.cpp +++ b/test/conformance/usm/urUSMDeviceAlloc.cpp @@ -5,6 +5,7 @@ #include "helpers.h" #include "uur/utils.h" #include +#include struct urUSMDeviceAllocTest : uur::urQueueTestWithParam { @@ -44,7 +45,7 @@ struct urUSMDeviceAllocTest // The 0 value parameters are not relevant for urUSMDeviceAllocTest tests, they // are used below in urUSMDeviceAllocAlignmentTest for allocation size and // alignment values -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urUSMDeviceAllocTest, testing::Combine( testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UsePool")), @@ -52,6 +53,8 @@ UUR_TEST_SUITE_P( uur::printUSMAllocTestString); TEST_P(urUSMDeviceAllocTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + void *ptr = nullptr; size_t allocation_size = sizeof(int); ASSERT_SUCCESS(urUSMDeviceAlloc(context, device, nullptr, pool, @@ -115,6 +118,9 @@ TEST_P(urUSMDeviceAllocTest, InvalidNullPtrResult) { } TEST_P(urUSMDeviceAllocTest, InvalidUSMSize) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}, uur::LevelZero{}, + uur::NativeCPU{}); + void *ptr = nullptr; ASSERT_EQ_RESULT( UR_RESULT_ERROR_INVALID_USM_SIZE, @@ -133,7 +139,7 @@ TEST_P(urUSMDeviceAllocTest, InvalidValueAlignPowerOfTwo) { using urUSMDeviceAllocAlignmentTest = urUSMDeviceAllocTest; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urUSMDeviceAllocAlignmentTest, testing::Combine( testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UsePool")), diff --git a/test/conformance/usm/urUSMFree.cpp b/test/conformance/usm/urUSMFree.cpp index 5ca4df3c9d..5873988b35 100644 --- a/test/conformance/usm/urUSMFree.cpp +++ b/test/conformance/usm/urUSMFree.cpp @@ -4,11 +4,14 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urUSMFreeTest = uur::urQueueTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urUSMFreeTest); TEST_P(urUSMFreeTest, SuccessDeviceAlloc) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_device_usm_access_capability_flags_t deviceUSMSupport = 0; ASSERT_SUCCESS(uur::GetDeviceUSMDeviceSupport(device, deviceUSMSupport)); if (!deviceUSMSupport) { @@ -33,6 +36,8 @@ TEST_P(urUSMFreeTest, SuccessDeviceAlloc) { ASSERT_SUCCESS(urEventRelease(event)); } TEST_P(urUSMFreeTest, SuccessHostAlloc) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_device_usm_access_capability_flags_t hostUSMSupport = 0; ASSERT_SUCCESS(uur::GetDeviceUSMDeviceSupport(device, hostUSMSupport)); if (!hostUSMSupport) { @@ -57,6 +62,8 @@ TEST_P(urUSMFreeTest, SuccessHostAlloc) { } TEST_P(urUSMFreeTest, SuccessSharedAlloc) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_device_usm_access_capability_flags_t shared_usm_cross = 0; ur_device_usm_access_capability_flags_t shared_usm_single = 0; @@ -110,7 +117,7 @@ struct urUSMFreeDuringExecutionTest : uur::urKernelExecutionTest { uint32_t data = 42; size_t wg_offset = 0; }; -UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urUSMFreeDuringExecutionTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urUSMFreeDuringExecutionTest); TEST_P(urUSMFreeDuringExecutionTest, SuccessHost) { ur_device_usm_access_capability_flags_t host_usm_flags = 0; diff --git a/test/conformance/usm/urUSMGetMemAllocInfo.cpp b/test/conformance/usm/urUSMGetMemAllocInfo.cpp index 38719379a9..3e45443672 100644 --- a/test/conformance/usm/urUSMGetMemAllocInfo.cpp +++ b/test/conformance/usm/urUSMGetMemAllocInfo.cpp @@ -4,23 +4,28 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urUSMGetMemAllocInfoTest : uur::urUSMDeviceAllocTestWithParam { void SetUp() override { + // The setup for the parent fixture does a urQueueFlush, which isn't + // supported by native cpu. + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + use_pool = getParam() == UR_USM_ALLOC_INFO_POOL; UUR_RETURN_ON_FATAL_FAILURE( uur::urUSMDeviceAllocTestWithParam::SetUp()); } }; -UUR_TEST_SUITE_P(urUSMGetMemAllocInfoTest, - ::testing::Values(UR_USM_ALLOC_INFO_TYPE, - UR_USM_ALLOC_INFO_BASE_PTR, - UR_USM_ALLOC_INFO_SIZE, - UR_USM_ALLOC_INFO_DEVICE, - UR_USM_ALLOC_INFO_POOL), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urUSMGetMemAllocInfoTest, + ::testing::Values(UR_USM_ALLOC_INFO_TYPE, + UR_USM_ALLOC_INFO_BASE_PTR, + UR_USM_ALLOC_INFO_SIZE, + UR_USM_ALLOC_INFO_DEVICE, + UR_USM_ALLOC_INFO_POOL), + uur::deviceTestWithParamPrinter); static std::unordered_map usm_info_size_map = { {UR_USM_ALLOC_INFO_TYPE, sizeof(ur_usm_type_t)}, @@ -33,6 +38,15 @@ static std::unordered_map usm_info_size_map = { TEST_P(urUSMGetMemAllocInfoTest, Success) { size_t size = 0; auto alloc_info = getParam(); + + if (alloc_info == UR_USM_ALLOC_INFO_POOL) { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{}, uur::LevelZeroV2{}); + } + + if (alloc_info == UR_USM_ALLOC_INFO_BASE_PTR) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + } + ASSERT_SUCCESS_OR_OPTIONAL_QUERY( urUSMGetMemAllocInfo(context, ptr, alloc_info, 0, nullptr, &size), alloc_info); @@ -80,10 +94,19 @@ TEST_P(urUSMGetMemAllocInfoTest, Success) { } } -using urUSMGetMemAllocInfoNegativeTest = uur::urUSMDeviceAllocTest; +struct urUSMGetMemAllocInfoNegativeTest : uur::urUSMDeviceAllocTest { + void SetUp() override { + // The setup for the parent fixture does a urQueueFlush, which isn't + // supported by native cpu. + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + UUR_RETURN_ON_FATAL_FAILURE(uur::urUSMDeviceAllocTest::SetUp()); + } +}; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urUSMGetMemAllocInfoNegativeTest); TEST_P(urUSMGetMemAllocInfoNegativeTest, InvalidNullHandleContext) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_usm_type_t USMType; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, urUSMGetMemAllocInfo(nullptr, ptr, UR_USM_ALLOC_INFO_TYPE, @@ -92,6 +115,8 @@ TEST_P(urUSMGetMemAllocInfoNegativeTest, InvalidNullHandleContext) { } TEST_P(urUSMGetMemAllocInfoNegativeTest, InvalidNullPointerMem) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_usm_type_t USMType; ASSERT_EQ_RESULT( UR_RESULT_ERROR_INVALID_NULL_POINTER, @@ -100,6 +125,8 @@ TEST_P(urUSMGetMemAllocInfoNegativeTest, InvalidNullPointerMem) { } TEST_P(urUSMGetMemAllocInfoNegativeTest, InvalidEnumeration) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_usm_type_t USMType; ASSERT_EQ_RESULT( UR_RESULT_ERROR_INVALID_ENUMERATION, @@ -108,6 +135,8 @@ TEST_P(urUSMGetMemAllocInfoNegativeTest, InvalidEnumeration) { } TEST_P(urUSMGetMemAllocInfoNegativeTest, InvalidValuePropSize) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_usm_type_t USMType; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, urUSMGetMemAllocInfo(context, ptr, UR_USM_ALLOC_INFO_TYPE, diff --git a/test/conformance/usm/urUSMHostAlloc.cpp b/test/conformance/usm/urUSMHostAlloc.cpp index f59af21897..deab7dfed1 100644 --- a/test/conformance/usm/urUSMHostAlloc.cpp +++ b/test/conformance/usm/urUSMHostAlloc.cpp @@ -6,6 +6,7 @@ #include "helpers.h" #include #include +#include struct urUSMHostAllocTest : uur::urQueueTestWithParam { @@ -44,7 +45,7 @@ struct urUSMHostAllocTest // The 0 value parameters are not relevant for urUSMHostAllocTest tests, they // are used below in urUSMHostAllocAlignmentTest for allocation size and // alignment values -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urUSMHostAllocTest, testing::Combine( testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UsePool")), @@ -52,6 +53,8 @@ UUR_TEST_SUITE_P( uur::printUSMAllocTestString); TEST_P(urUSMHostAllocTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_device_usm_access_capability_flags_t hostUSMSupport = 0; ASSERT_SUCCESS(uur::GetDeviceUSMHostSupport(device, hostUSMSupport)); if (!hostUSMSupport) { @@ -126,6 +129,8 @@ TEST_P(urUSMHostAllocTest, InvalidNullPtrMem) { } TEST_P(urUSMHostAllocTest, InvalidUSMSize) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}, uur::NativeCPU{}); + void *ptr = nullptr; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_USM_SIZE, urUSMHostAlloc(context, nullptr, pool, -1, &ptr)); @@ -142,7 +147,7 @@ TEST_P(urUSMHostAllocTest, InvalidValueAlignPowerOfTwo) { using urUSMHostAllocAlignmentTest = urUSMHostAllocTest; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urUSMHostAllocAlignmentTest, testing::Combine( testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UsePool")), diff --git a/test/conformance/usm/urUSMPoolCreate.cpp b/test/conformance/usm/urUSMPoolCreate.cpp index ac40503eb0..afafa0ff80 100644 --- a/test/conformance/usm/urUSMPoolCreate.cpp +++ b/test/conformance/usm/urUSMPoolCreate.cpp @@ -5,6 +5,7 @@ #include "uur/utils.h" #include +#include struct urUSMPoolCreateTest : uur::urContextTest { void SetUp() { @@ -27,6 +28,8 @@ TEST_P(urUSMPoolCreateTest, Success) { } TEST_P(urUSMPoolCreateTest, SuccessWithFlag) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + ur_usm_pool_desc_t pool_desc{UR_STRUCTURE_TYPE_USM_POOL_DESC, nullptr, UR_USM_POOL_FLAG_ZERO_INITIALIZE_BLOCK}; ur_usm_pool_handle_t pool = nullptr; diff --git a/test/conformance/usm/urUSMPoolGetInfo.cpp b/test/conformance/usm/urUSMPoolGetInfo.cpp index e43bc3a77b..5cf1daa8f2 100644 --- a/test/conformance/usm/urUSMPoolGetInfo.cpp +++ b/test/conformance/usm/urUSMPoolGetInfo.cpp @@ -14,10 +14,10 @@ std::unordered_map pool_info_size_map = { using urUSMPoolGetInfoTestWithInfoParam = uur::urUSMPoolTestWithParam; -UUR_TEST_SUITE_P(urUSMPoolGetInfoTestWithInfoParam, - ::testing::Values(UR_USM_POOL_INFO_CONTEXT, - UR_USM_POOL_INFO_REFERENCE_COUNT), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urUSMPoolGetInfoTestWithInfoParam, + ::testing::Values(UR_USM_POOL_INFO_CONTEXT, + UR_USM_POOL_INFO_REFERENCE_COUNT), + uur::deviceTestWithParamPrinter); TEST_P(urUSMPoolGetInfoTestWithInfoParam, Success) { ur_usm_pool_info_t info_type = getParam(); diff --git a/test/conformance/usm/urUSMSharedAlloc.cpp b/test/conformance/usm/urUSMSharedAlloc.cpp index 021fa6368e..2038eae2c7 100644 --- a/test/conformance/usm/urUSMSharedAlloc.cpp +++ b/test/conformance/usm/urUSMSharedAlloc.cpp @@ -5,6 +5,7 @@ #include "helpers.h" #include +#include struct urUSMSharedAllocTest : uur::urQueueTestWithParam { @@ -50,7 +51,7 @@ struct urUSMSharedAllocTest // The 0 value parameters are not relevant for urUSMSharedAllocTest tests, they // are used below in urUSMSharedAllocAlignmentTest for allocation size and // alignment values -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urUSMSharedAllocTest, testing::Combine( testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UsePool")), @@ -140,6 +141,8 @@ TEST_P(urUSMSharedAllocTest, InvalidNullPtrMem) { } TEST_P(urUSMSharedAllocTest, InvalidUSMSize) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}, uur::NativeCPU{}); + ASSERT_EQ_RESULT( UR_RESULT_ERROR_INVALID_USM_SIZE, urUSMSharedAlloc(context, device, nullptr, pool, -1, &ptr)); @@ -156,7 +159,7 @@ TEST_P(urUSMSharedAllocTest, InvalidValueAlignPowerOfTwo) { using urUSMSharedAllocAlignmentTest = urUSMSharedAllocTest; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urUSMSharedAllocAlignmentTest, testing::Combine( testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UsePool")), diff --git a/test/conformance/usm/usm_adapter_cuda.match b/test/conformance/usm/usm_adapter_cuda.match deleted file mode 100644 index 5460c48661..0000000000 --- a/test/conformance/usm/usm_adapter_cuda.match +++ /dev/null @@ -1,4 +0,0 @@ -{{OPT}}urUSMDeviceAllocTest.InvalidUSMSize/* -{{OPT}}urUSMHostAllocTest.InvalidUSMSize/* -{{OPT}}urUSMPoolCreateTest.SuccessWithFlag/* -{{OPT}}urUSMSharedAllocTest.InvalidUSMSize/* diff --git a/test/conformance/usm/usm_adapter_hip.match b/test/conformance/usm/usm_adapter_hip.match deleted file mode 100644 index d1ae0952f4..0000000000 --- a/test/conformance/usm/usm_adapter_hip.match +++ /dev/null @@ -1,84 +0,0 @@ -urUSMDeviceAllocTest.Success/*__UsePoolEnabled -urUSMDeviceAllocTest.SuccessWithDescriptors/*__UsePoolEnabled -urUSMDeviceAllocTest.InvalidNullHandleContext/*__UsePoolEnabled -urUSMDeviceAllocTest.InvalidNullHandleDevice/*__UsePoolEnabled -urUSMDeviceAllocTest.InvalidNullPtrResult/*__UsePoolEnabled -urUSMDeviceAllocTest.InvalidUSMSize/*__UsePoolEnabled -urUSMDeviceAllocTest.InvalidUSMSize/*__UsePoolDisabled -urUSMDeviceAllocTest.InvalidValueAlignPowerOfTwo/*__UsePoolEnabled -urUSMDeviceAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_4_8 -urUSMDeviceAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_4_512 -urUSMDeviceAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_4_2048 -urUSMDeviceAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_8_8 -urUSMDeviceAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_8_512 -urUSMDeviceAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_8_2048 -urUSMDeviceAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_16_8 -urUSMDeviceAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_16_512 -urUSMDeviceAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_16_2048 -urUSMDeviceAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_32_8 -urUSMDeviceAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_32_512 -urUSMDeviceAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_32_2048 -urUSMDeviceAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_64_8 -urUSMDeviceAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_64_512 -urUSMDeviceAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_64_2048 -urUSMGetMemAllocInfoTest.Success/*__UR_USM_ALLOC_INFO_POOL -urUSMHostAllocTest.Success/*__UsePoolEnabled -urUSMHostAllocTest.SuccessWithDescriptors/*__UsePoolEnabled -urUSMHostAllocTest.InvalidNullHandleContext/*__UsePoolEnabled -urUSMHostAllocTest.InvalidNullPtrMem/*__UsePoolEnabled -urUSMHostAllocTest.InvalidUSMSize/*__UsePoolEnabled -urUSMHostAllocTest.InvalidUSMSize/*__UsePoolDisabled -urUSMHostAllocTest.InvalidValueAlignPowerOfTwo/*__UsePoolEnabled -urUSMHostAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_4_8 -urUSMHostAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_4_512 -urUSMHostAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_4_2048 -urUSMHostAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_8_8 -urUSMHostAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_8_512 -urUSMHostAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_8_2048 -urUSMHostAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_16_8 -urUSMHostAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_16_512 -urUSMHostAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_16_2048 -urUSMHostAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_32_8 -urUSMHostAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_32_512 -urUSMHostAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_32_2048 -urUSMHostAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_64_8 -urUSMHostAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_64_512 -urUSMHostAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_64_2048 -urUSMPoolCreateTest.Success/* -urUSMPoolCreateTest.SuccessWithFlag/* -urUSMPoolGetInfoTestWithInfoParam.Success/*__UR_USM_POOL_INFO_CONTEXT -urUSMPoolGetInfoTestWithInfoParam.Success/*__UR_USM_POOL_INFO_REFERENCE_COUNT -urUSMPoolGetInfoTest.InvalidNullHandlePool/* -urUSMPoolGetInfoTest.InvalidEnumerationProperty/* -urUSMPoolGetInfoTest.InvalidSizeZero/* -urUSMPoolGetInfoTest.InvalidSizeTooSmall/* -urUSMPoolGetInfoTest.InvalidNullPointerPropValue/* -urUSMPoolGetInfoTest.InvalidNullPointerPropSizeRet/* -urUSMPoolDestroyTest.Success/* -urUSMPoolDestroyTest.InvalidNullHandleContext/* -urUSMPoolRetainTest.Success/* -urUSMPoolRetainTest.InvalidNullHandlePool/* -urUSMSharedAllocTest.Success/*__UsePoolEnabled -urUSMSharedAllocTest.SuccessWithDescriptors/*__UsePoolEnabled -urUSMSharedAllocTest.SuccessWithMultipleAdvices/*__UsePoolEnabled -urUSMSharedAllocTest.InvalidNullHandleContext/*__UsePoolEnabled -urUSMSharedAllocTest.InvalidNullHandleDevice/*__UsePoolEnabled -urUSMSharedAllocTest.InvalidNullPtrMem/*__UsePoolEnabled -urUSMSharedAllocTest.InvalidUSMSize/*__UsePoolEnabled -urUSMSharedAllocTest.InvalidUSMSize/*__UsePoolDisabled -urUSMSharedAllocTest.InvalidValueAlignPowerOfTwo/*__UsePoolEnabled -urUSMSharedAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_4_8 -urUSMSharedAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_4_512 -urUSMSharedAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_4_2048 -urUSMSharedAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_8_8 -urUSMSharedAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_8_512 -urUSMSharedAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_8_2048 -urUSMSharedAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_16_8 -urUSMSharedAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_16_512 -urUSMSharedAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_16_2048 -urUSMSharedAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_32_8 -urUSMSharedAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_32_512 -urUSMSharedAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_32_2048 -urUSMSharedAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_64_8 -urUSMSharedAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_64_512 -urUSMSharedAllocAlignmentTest.SuccessAlignedAllocations/*__UsePoolEnabled_64_2048 diff --git a/test/conformance/usm/usm_adapter_level_zero.match b/test/conformance/usm/usm_adapter_level_zero.match deleted file mode 100644 index 201c351120..0000000000 --- a/test/conformance/usm/usm_adapter_level_zero.match +++ /dev/null @@ -1 +0,0 @@ -{{OPT}}urUSMDeviceAllocTest.InvalidUSMSize/* diff --git a/test/conformance/usm/usm_adapter_level_zero_v2.match b/test/conformance/usm/usm_adapter_level_zero_v2.match deleted file mode 100644 index ad8e1888d4..0000000000 --- a/test/conformance/usm/usm_adapter_level_zero_v2.match +++ /dev/null @@ -1 +0,0 @@ -urUSMGetMemAllocInfoTest.Success/*___UR_USM_ALLOC_INFO_POOL diff --git a/test/conformance/usm/usm_adapter_native_cpu.match b/test/conformance/usm/usm_adapter_native_cpu.match deleted file mode 100644 index ada1fe040e..0000000000 --- a/test/conformance/usm/usm_adapter_native_cpu.match +++ /dev/null @@ -1,17 +0,0 @@ -urUSMDeviceAllocTest.Success/*__UsePoolDisabled -urUSMDeviceAllocTest.InvalidUSMSize/*__UsePoolDisabled -urUSMFreeTest.SuccessDeviceAlloc/* -urUSMFreeTest.SuccessHostAlloc/* -urUSMFreeTest.SuccessSharedAlloc/* -urUSMFreeDuringExecutionTest.* -urUSMGetMemAllocInfoTest.Success/*__UR_USM_ALLOC_INFO_TYPE -urUSMGetMemAllocInfoTest.Success/*__UR_USM_ALLOC_INFO_BASE_PTR -urUSMGetMemAllocInfoTest.Success/*__UR_USM_ALLOC_INFO_SIZE -urUSMGetMemAllocInfoTest.Success/*__UR_USM_ALLOC_INFO_DEVICE -urUSMGetMemAllocInfoNegativeTest.InvalidNullHandleContext/* -urUSMGetMemAllocInfoNegativeTest.InvalidNullPointerMem/* -urUSMGetMemAllocInfoNegativeTest.InvalidEnumeration/* -urUSMGetMemAllocInfoNegativeTest.InvalidValuePropSize/* -urUSMHostAllocTest.Success/*__UsePoolDisabled -urUSMHostAllocTest.InvalidUSMSize/*__UsePoolDisabled -urUSMSharedAllocTest.InvalidUSMSize/*__UsePoolDisabled diff --git a/test/conformance/virtual_memory/urPhysicalMemCreate.cpp b/test/conformance/virtual_memory/urPhysicalMemCreate.cpp index e7867a8a72..e4a49c44ec 100644 --- a/test/conformance/virtual_memory/urPhysicalMemCreate.cpp +++ b/test/conformance/virtual_memory/urPhysicalMemCreate.cpp @@ -3,7 +3,8 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "uur/fixtures.h" +#include +#include struct urPhysicalMemCreateTest : uur::urVirtualMemGranularityTestWithParam { @@ -26,17 +27,21 @@ struct urPhysicalMemCreateTest }; using urPhysicalMemCreateWithSizeParamTest = urPhysicalMemCreateTest; -UUR_TEST_SUITE_P(urPhysicalMemCreateWithSizeParamTest, - ::testing::Values(1, 2, 3, 7, 12, 44), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urPhysicalMemCreateWithSizeParamTest, + ::testing::Values(1, 2, 3, 7, 12, 44), + uur::deviceTestWithParamPrinter); TEST_P(urPhysicalMemCreateWithSizeParamTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ASSERT_SUCCESS( urPhysicalMemCreate(context, device, size, nullptr, &physical_mem)); ASSERT_NE(physical_mem, nullptr); } TEST_P(urPhysicalMemCreateWithSizeParamTest, InvalidSize) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + if (granularity == 1) { GTEST_SKIP() << "A granularity of 1 means that any size will be accepted."; @@ -49,9 +54,10 @@ TEST_P(urPhysicalMemCreateWithSizeParamTest, InvalidSize) { using urPhysicalMemCreateWithFlagsParamTest = uur::urPhysicalMemTestWithParam; -UUR_TEST_SUITE_P(urPhysicalMemCreateWithFlagsParamTest, - ::testing::Values(UR_PHYSICAL_MEM_FLAG_TBD), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P( + urPhysicalMemCreateWithFlagsParamTest, + ::testing::Values(UR_PHYSICAL_MEM_FLAG_TBD), + uur::deviceTestWithParamPrinter); TEST_P(urPhysicalMemCreateWithFlagsParamTest, Success) { ur_physical_mem_properties_t properties; @@ -65,8 +71,8 @@ TEST_P(urPhysicalMemCreateWithFlagsParamTest, Success) { } using urPhysicalMemCreateTest = urPhysicalMemCreateTest; -UUR_TEST_SUITE_P(urPhysicalMemCreateTest, ::testing::Values(1), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urPhysicalMemCreateTest, ::testing::Values(1), + uur::deviceTestWithParamPrinter); TEST_P(urPhysicalMemCreateTest, InvalidNullHandleContext) { ASSERT_EQ_RESULT( diff --git a/test/conformance/virtual_memory/urPhysicalMemGetInfo.cpp b/test/conformance/virtual_memory/urPhysicalMemGetInfo.cpp index d6a075a0de..c499a0299d 100644 --- a/test/conformance/virtual_memory/urPhysicalMemGetInfo.cpp +++ b/test/conformance/virtual_memory/urPhysicalMemGetInfo.cpp @@ -3,11 +3,14 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urPhysicalMemGetInfoTest = uur::urPhysicalMemTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urPhysicalMemGetInfoTest); TEST_P(urPhysicalMemGetInfoTest, Context) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + size_t info_size = 0; ASSERT_SUCCESS(urPhysicalMemGetInfo( @@ -23,6 +26,8 @@ TEST_P(urPhysicalMemGetInfoTest, Context) { } TEST_P(urPhysicalMemGetInfoTest, Device) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + size_t info_size = 0; ASSERT_SUCCESS(urPhysicalMemGetInfo( @@ -38,6 +43,8 @@ TEST_P(urPhysicalMemGetInfoTest, Device) { } TEST_P(urPhysicalMemGetInfoTest, Size) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + size_t info_size = 0; ASSERT_SUCCESS(urPhysicalMemGetInfo(physical_mem, UR_PHYSICAL_MEM_INFO_SIZE, @@ -52,6 +59,7 @@ TEST_P(urPhysicalMemGetInfoTest, Size) { } TEST_P(urPhysicalMemGetInfoTest, Properties) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); size_t info_size = 0; ASSERT_SUCCESS(urPhysicalMemGetInfo( diff --git a/test/conformance/virtual_memory/urVirtualMemGetInfo.cpp b/test/conformance/virtual_memory/urVirtualMemGetInfo.cpp index 041a749b5b..f3e8a91d32 100644 --- a/test/conformance/virtual_memory/urVirtualMemGetInfo.cpp +++ b/test/conformance/virtual_memory/urVirtualMemGetInfo.cpp @@ -6,9 +6,9 @@ using urVirtualMemGetInfoTestWithParam = uur::urVirtualMemMappedTestWithParam; -UUR_TEST_SUITE_P(urVirtualMemGetInfoTestWithParam, - ::testing::Values(UR_VIRTUAL_MEM_INFO_ACCESS_MODE), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urVirtualMemGetInfoTestWithParam, + ::testing::Values(UR_VIRTUAL_MEM_INFO_ACCESS_MODE), + uur::deviceTestWithParamPrinter); TEST_P(urVirtualMemGetInfoTestWithParam, Success) { size_t info_size = 0; diff --git a/test/conformance/virtual_memory/urVirtualMemGranularityGetInfo.cpp b/test/conformance/virtual_memory/urVirtualMemGranularityGetInfo.cpp index 2fac7a1093..2f8e47d8d1 100644 --- a/test/conformance/virtual_memory/urVirtualMemGranularityGetInfo.cpp +++ b/test/conformance/virtual_memory/urVirtualMemGranularityGetInfo.cpp @@ -7,6 +7,8 @@ struct urVirtualMemGranularityGetInfoTest : uur::urContextTestWithParam { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE( urContextTestWithParam::SetUp()); ur_bool_t virtual_memory_support = false; @@ -19,7 +21,7 @@ struct urVirtualMemGranularityGetInfoTest } }; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urVirtualMemGranularityGetInfoTest, ::testing::Values(UR_VIRTUAL_MEM_GRANULARITY_INFO_MINIMUM, UR_VIRTUAL_MEM_GRANULARITY_INFO_RECOMMENDED), diff --git a/test/conformance/virtual_memory/urVirtualMemMap.cpp b/test/conformance/virtual_memory/urVirtualMemMap.cpp index f6ed600e0a..0133c40c87 100644 --- a/test/conformance/virtual_memory/urVirtualMemMap.cpp +++ b/test/conformance/virtual_memory/urVirtualMemMap.cpp @@ -6,11 +6,12 @@ using urVirtualMemMapWithFlagsTest = uur::urVirtualMemTestWithParam; -UUR_TEST_SUITE_P(urVirtualMemMapWithFlagsTest, - ::testing::Values(UR_VIRTUAL_MEM_ACCESS_FLAG_NONE, - UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE, - UR_VIRTUAL_MEM_ACCESS_FLAG_READ_ONLY), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P( + urVirtualMemMapWithFlagsTest, + ::testing::Values(UR_VIRTUAL_MEM_ACCESS_FLAG_NONE, + UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE, + UR_VIRTUAL_MEM_ACCESS_FLAG_READ_ONLY), + uur::deviceTestWithParamPrinter); TEST_P(urVirtualMemMapWithFlagsTest, Success) { ASSERT_SUCCESS(urVirtualMemMap(context, virtual_ptr, size, physical_mem, 0, diff --git a/test/conformance/virtual_memory/urVirtualMemReserve.cpp b/test/conformance/virtual_memory/urVirtualMemReserve.cpp index 7d870dfb05..7aa67dc9df 100644 --- a/test/conformance/virtual_memory/urVirtualMemReserve.cpp +++ b/test/conformance/virtual_memory/urVirtualMemReserve.cpp @@ -6,10 +6,10 @@ using urVirtualMemReserveTestWithParam = uur::urVirtualMemGranularityTestWithParam; -UUR_TEST_SUITE_P(urVirtualMemReserveTestWithParam, - ::testing::Values(2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, - 2048, 5000, 100000), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urVirtualMemReserveTestWithParam, + ::testing::Values(2, 4, 8, 16, 32, 64, 128, 256, 512, + 1024, 2048, 5000, 100000), + uur::deviceTestWithParamPrinter); TEST_P(urVirtualMemReserveTestWithParam, SuccessNoStartPointer) { // round up to nearest granularity diff --git a/test/conformance/virtual_memory/urVirtualMemSetAccess.cpp b/test/conformance/virtual_memory/urVirtualMemSetAccess.cpp index 2010bbd9fc..0585a90b40 100644 --- a/test/conformance/virtual_memory/urVirtualMemSetAccess.cpp +++ b/test/conformance/virtual_memory/urVirtualMemSetAccess.cpp @@ -6,11 +6,12 @@ using urVirtualMemSetAccessWithFlagsTest = uur::urVirtualMemMappedTestWithParam; -UUR_TEST_SUITE_P(urVirtualMemSetAccessWithFlagsTest, - ::testing::Values(UR_VIRTUAL_MEM_ACCESS_FLAG_NONE, - UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE, - UR_VIRTUAL_MEM_ACCESS_FLAG_READ_ONLY), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P( + urVirtualMemSetAccessWithFlagsTest, + ::testing::Values(UR_VIRTUAL_MEM_ACCESS_FLAG_NONE, + UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE, + UR_VIRTUAL_MEM_ACCESS_FLAG_READ_ONLY), + uur::deviceTestWithParamPrinter); TEST_P(urVirtualMemSetAccessWithFlagsTest, Success) { ASSERT_SUCCESS( diff --git a/test/conformance/virtual_memory/virtual_memory_adapter_level_zero.match b/test/conformance/virtual_memory/virtual_memory_adapter_level_zero.match deleted file mode 100644 index 633aa41f90..0000000000 --- a/test/conformance/virtual_memory/virtual_memory_adapter_level_zero.match +++ /dev/null @@ -1,6 +0,0 @@ -{{OPT}}urPhysicalMemCreateWithSizeParamTest.Success/* -urPhysicalMemCreateWithSizeParamTest.InvalidSize/* -urPhysicalMemGetInfoTest.Context/* -urPhysicalMemGetInfoTest.Device/* -urPhysicalMemGetInfoTest.Size/* -urPhysicalMemGetInfoTest.Properties/* diff --git a/test/conformance/virtual_memory/virtual_memory_adapter_level_zero_v2.match b/test/conformance/virtual_memory/virtual_memory_adapter_level_zero_v2.match deleted file mode 100644 index 633aa41f90..0000000000 --- a/test/conformance/virtual_memory/virtual_memory_adapter_level_zero_v2.match +++ /dev/null @@ -1,6 +0,0 @@ -{{OPT}}urPhysicalMemCreateWithSizeParamTest.Success/* -urPhysicalMemCreateWithSizeParamTest.InvalidSize/* -urPhysicalMemGetInfoTest.Context/* -urPhysicalMemGetInfoTest.Device/* -urPhysicalMemGetInfoTest.Size/* -urPhysicalMemGetInfoTest.Properties/* diff --git a/test/usm/usmPoolManager.cpp b/test/usm/usmPoolManager.cpp index bdcf402ac2..ad1ca6e093 100644 --- a/test/usm/usmPoolManager.cpp +++ b/test/usm/usmPoolManager.cpp @@ -7,9 +7,9 @@ #include -struct urUsmPoolDescriptorTest - : public uur::urMultiDeviceContextTest, - ::testing::WithParamInterface {}; +using urUsmPoolDescriptorTest = uur::urMultiDeviceContextTest; + +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urUsmPoolDescriptorTest); auto createMockPoolHandle() { static uintptr_t uniqueAddress = 0x1; @@ -20,10 +20,9 @@ auto createMockPoolHandle() { TEST_P(urUsmPoolDescriptorTest, poolIsPerContextTypeAndDevice) { auto &devices = uur::DevicesEnvironment::instance->devices; - auto poolHandle = this->GetParam(); auto [ret, pool_descriptors] = - usm::pool_descriptor::create(poolHandle, this->context); + usm::pool_descriptor::create(nullptr, this->context); ASSERT_EQ(ret, UR_RESULT_SUCCESS); size_t hostPools = 0; @@ -31,7 +30,7 @@ TEST_P(urUsmPoolDescriptorTest, poolIsPerContextTypeAndDevice) { size_t sharedPools = 0; for (auto &desc : pool_descriptors) { - ASSERT_EQ(desc.poolHandle, poolHandle); + ASSERT_EQ(desc.poolHandle, nullptr); ASSERT_EQ(desc.hContext, this->context); if (desc.type == UR_USM_TYPE_DEVICE) { @@ -52,9 +51,6 @@ TEST_P(urUsmPoolDescriptorTest, poolIsPerContextTypeAndDevice) { ASSERT_EQ(sharedPools, devices.size() * 2); } -INSTANTIATE_TEST_SUITE_P(urUsmPoolDescriptorTest, urUsmPoolDescriptorTest, - ::testing::Values(nullptr)); - // TODO: add test with sub-devices struct urUsmPoolManagerTest : public uur::urContextTest {