diff --git a/.github/workflows/ur-build-hw.yml b/.github/workflows/ur-build-hw.yml index a50b8cb2d0945..b00427bcae9de 100644 --- a/.github/workflows/ur-build-hw.yml +++ b/.github/workflows/ur-build-hw.yml @@ -190,7 +190,7 @@ jobs: env: ZE_ENABLE_LOADER_DEBUG_TRACE: 1 LIT_OPTS: "--timeout 120" - run: cmake --build build -j $(nproc) -- check-unified-runtime-conformance + run: cmake --build build -j 120 -- check-unified-runtime-conformance - name: Get information about platform if: ${{ always() }} diff --git a/unified-runtime/test/adapters/level_zero/enqueue_alloc.cpp b/unified-runtime/test/adapters/level_zero/enqueue_alloc.cpp index fa7c3ac55c3e8..9dc2e9e4bc0c3 100644 --- a/unified-runtime/test/adapters/level_zero/enqueue_alloc.cpp +++ b/unified-runtime/test/adapters/level_zero/enqueue_alloc.cpp @@ -160,7 +160,7 @@ struct urL0EnqueueAllocMultiQueueMultiDeviceTest std::vector queues; }; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urL0EnqueueAllocTest, ::testing::ValuesIn({ EnqueueAllocTestParam{urEnqueueUSMHostAllocExp, @@ -170,13 +170,11 @@ UUR_DEVICE_TEST_SUITE_WITH_PARAM( EnqueueAllocTestParam{urEnqueueUSMDeviceAllocExp, uur::GetDeviceUSMDeviceSupport}, }), - uur::deviceTestWithParamPrinter); + uur::deviceTestWithParamPrinterMulti); TEST_P(urL0EnqueueAllocTest, Success) { - const auto enqueueUSMAllocFunc = - std::get<1>(this->GetParam()).enqueueUSMAllocFunc; - const auto checkUSMSupportFunc = - std::get<1>(this->GetParam()).checkUSMSupportFunc; + const auto enqueueUSMAllocFunc = getParam().enqueueUSMAllocFunc; + const auto checkUSMSupportFunc = getParam().checkUSMSupportFunc; ur_device_usm_access_capability_flags_t USMSupport = 0; ASSERT_SUCCESS(checkUSMSupportFunc(device, USMSupport)); @@ -200,10 +198,8 @@ TEST_P(urL0EnqueueAllocTest, Success) { } TEST_P(urL0EnqueueAllocTest, SuccessReuse) { - const auto enqueueUSMAllocFunc = - std::get<1>(this->GetParam()).enqueueUSMAllocFunc; - const auto checkUSMSupportFunc = - std::get<1>(this->GetParam()).checkUSMSupportFunc; + const auto enqueueUSMAllocFunc = getParam().enqueueUSMAllocFunc; + const auto checkUSMSupportFunc = getParam().checkUSMSupportFunc; ur_device_usm_access_capability_flags_t USMSupport = 0; ASSERT_SUCCESS(checkUSMSupportFunc(device, USMSupport)); @@ -238,10 +234,8 @@ TEST_P(urL0EnqueueAllocTest, SuccessReuse) { } TEST_P(urL0EnqueueAllocTest, SuccessFromPool) { - const auto enqueueUSMAllocFunc = - std::get<1>(this->GetParam()).enqueueUSMAllocFunc; - const auto checkUSMSupportFunc = - std::get<1>(this->GetParam()).checkUSMSupportFunc; + const auto enqueueUSMAllocFunc = getParam().enqueueUSMAllocFunc; + const auto checkUSMSupportFunc = getParam().checkUSMSupportFunc; ur_device_usm_access_capability_flags_t USMSupport = 0; ASSERT_SUCCESS(checkUSMSupportFunc(device, USMSupport)); @@ -269,10 +263,8 @@ TEST_P(urL0EnqueueAllocTest, SuccessFromPool) { } TEST_P(urL0EnqueueAllocTest, SuccessWithKernel) { - const auto enqueueUSMAllocFunc = - std::get<1>(this->GetParam()).enqueueUSMAllocFunc; - const auto checkUSMSupportFunc = - std::get<1>(this->GetParam()).checkUSMSupportFunc; + const auto enqueueUSMAllocFunc = getParam().enqueueUSMAllocFunc; + const auto checkUSMSupportFunc = getParam().checkUSMSupportFunc; ur_device_usm_access_capability_flags_t USMSupport = 0; ASSERT_SUCCESS(checkUSMSupportFunc(device, USMSupport)); @@ -294,10 +286,8 @@ TEST_P(urL0EnqueueAllocTest, SuccessWithKernel) { } TEST_P(urL0EnqueueAllocTest, SuccessWithKernelRepeat) { - const auto enqueueUSMAllocFunc = - std::get<1>(this->GetParam()).enqueueUSMAllocFunc; - const auto checkUSMSupportFunc = - std::get<1>(this->GetParam()).checkUSMSupportFunc; + const auto enqueueUSMAllocFunc = getParam().enqueueUSMAllocFunc; + const auto checkUSMSupportFunc = getParam().checkUSMSupportFunc; ur_device_usm_access_capability_flags_t USMSupport = 0; ASSERT_SUCCESS(checkUSMSupportFunc(device, USMSupport)); diff --git a/unified-runtime/test/adapters/level_zero/urEnqueueMemBufferMapHostPtr.cpp b/unified-runtime/test/adapters/level_zero/urEnqueueMemBufferMapHostPtr.cpp index 77cd7965ea434..a3ca7d3cc7a19 100644 --- a/unified-runtime/test/adapters/level_zero/urEnqueueMemBufferMapHostPtr.cpp +++ b/unified-runtime/test/adapters/level_zero/urEnqueueMemBufferMapHostPtr.cpp @@ -15,7 +15,7 @@ using urEnqueueMemBufferMapTestWithParamL0 = uur::urMemBufferQueueTestWithParam; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urEnqueueMemBufferMapTestWithParamL0, ::testing::ValuesIn(uur::mem_buffer_test_parameters), uur::printMemBufferTestString); diff --git a/unified-runtime/test/adapters/level_zero/urEventCreateWithNativeHandle.cpp b/unified-runtime/test/adapters/level_zero/urEventCreateWithNativeHandle.cpp index 06b0f961a1baa..ba320846aacca 100644 --- a/unified-runtime/test/adapters/level_zero/urEventCreateWithNativeHandle.cpp +++ b/unified-runtime/test/adapters/level_zero/urEventCreateWithNativeHandle.cpp @@ -17,8 +17,8 @@ #include "ze_helpers.hpp" using namespace std::chrono_literals; -using urLevelZeroEventNativeHandleTest = uur::urQueueTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urLevelZeroEventNativeHandleTest); +using urLevelZeroEventNativeHandleTest = uur::urMultiQueueTypeTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urLevelZeroEventNativeHandleTest); #define TEST_MEMCPY_SIZE 4096 diff --git a/unified-runtime/test/adapters/level_zero/urKernelCreateWithNativeHandle.cpp b/unified-runtime/test/adapters/level_zero/urKernelCreateWithNativeHandle.cpp index 43421597ad370..887ee0349db08 100644 --- a/unified-runtime/test/adapters/level_zero/urKernelCreateWithNativeHandle.cpp +++ b/unified-runtime/test/adapters/level_zero/urKernelCreateWithNativeHandle.cpp @@ -12,8 +12,9 @@ #include "ze_api.h" #include -using urLevelZeroKernelNativeHandleTest = uur::urQueueTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urLevelZeroKernelNativeHandleTest); +using urLevelZeroKernelNativeHandleTest = uur::urMultiQueueTypeTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE( + urLevelZeroKernelNativeHandleTest); TEST_P(urLevelZeroKernelNativeHandleTest, OwnedHandleRelease) { ze_context_handle_t native_context; diff --git a/unified-runtime/test/adapters/level_zero/urMemBufferCreateWithNativeHandleShared.cpp b/unified-runtime/test/adapters/level_zero/urMemBufferCreateWithNativeHandleShared.cpp index 0cbc16785a4d5..5137d7986c1f4 100644 --- a/unified-runtime/test/adapters/level_zero/urMemBufferCreateWithNativeHandleShared.cpp +++ b/unified-runtime/test/adapters/level_zero/urMemBufferCreateWithNativeHandleShared.cpp @@ -13,8 +13,9 @@ #include "ze_api.h" #include -using urMemBufferCreateWithNativeHandleTest = uur::urQueueTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urMemBufferCreateWithNativeHandleTest); +using urMemBufferCreateWithNativeHandleTest = uur::urMultiQueueTypeTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE( + urMemBufferCreateWithNativeHandleTest); TEST_P(urMemBufferCreateWithNativeHandleTest, SharedBufferIsUsedDirectly) { UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); diff --git a/unified-runtime/test/adapters/level_zero/urProgramLink.cpp b/unified-runtime/test/adapters/level_zero/urProgramLink.cpp index 287c2fd5cbbcb..e016ab9645465 100644 --- a/unified-runtime/test/adapters/level_zero/urProgramLink.cpp +++ b/unified-runtime/test/adapters/level_zero/urProgramLink.cpp @@ -11,7 +11,7 @@ #include using urLevelZeroProgramLinkTest = uur::urProgramTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urLevelZeroProgramLinkTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urLevelZeroProgramLinkTest); TEST_P(urLevelZeroProgramLinkTest, InvalidLinkOptionsPrintedInLog) { ur_program_handle_t linked_program = nullptr; diff --git a/unified-runtime/test/adapters/level_zero/v2/deferred_kernel.cpp b/unified-runtime/test/adapters/level_zero/v2/deferred_kernel.cpp index 38966d31827b3..868b543cac2ce 100644 --- a/unified-runtime/test/adapters/level_zero/v2/deferred_kernel.cpp +++ b/unified-runtime/test/adapters/level_zero/v2/deferred_kernel.cpp @@ -29,7 +29,7 @@ struct urEnqueueKernelLaunchTest : uur::urKernelExecutionTest { size_t global_offset = 0; size_t n_dimensions = 1; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueKernelLaunchTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urEnqueueKernelLaunchTest); TEST_P(urEnqueueKernelLaunchTest, DeferredKernelRelease) { ur_mem_handle_t buffer = nullptr; diff --git a/unified-runtime/test/conformance/enqueue/helpers.h b/unified-runtime/test/conformance/enqueue/helpers.h index fd8c428a52589..ee59e8900ef30 100644 --- a/unified-runtime/test/conformance/enqueue/helpers.h +++ b/unified-runtime/test/conformance/enqueue/helpers.h @@ -7,7 +7,9 @@ #ifndef UUR_ENQUEUE_RECT_HELPERS_H_INCLUDED #define UUR_ENQUEUE_RECT_HELPERS_H_INCLUDED +#include "ur_api.h" #include +#include #include namespace uur { @@ -31,8 +33,33 @@ printRectTestString(const testing::TestParamInfo &info) { // ParamType will be std::tuple 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; + + std::stringstream ss; + auto param_tuple = std::get<1>(info.param); + auto test_name = std::get<0>(param_tuple).name; + auto queue_mode = std::get<1>(param_tuple); + + ss << platform_device_name << "__" << test_name << "__" << queue_mode; + + return ss.str(); +} + +template +inline std::string printRectTestStringMultiQueue( + const testing::TestParamInfo &info) { + // ParamType will be std::tuple + const auto device_handle = std::get<0>(info.param).device; + const auto platform_device_name = GetPlatformAndDeviceName(device_handle); + auto paramTuple = std::get<1>(info.param); + auto param = std::get<0>(paramTuple); + + auto queueMode = std::get<1>(paramTuple); + + std::stringstream test_name; + test_name << platform_device_name; + test_name << param.name << "__" << queueMode; + + return test_name.str(); } // Performs host side equivalent of urEnqueueMemBufferReadRect, @@ -74,13 +101,18 @@ print2DTestString(const testing::TestParamInfo &info) { const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); std::stringstream test_name; - const auto src_kind = std::get<1>(std::get<1>(info.param)); - const auto dst_kind = std::get<2>(std::get<1>(info.param)); - test_name << platform_device_name << "__pitch__" - << std::get<0>(std::get<1>(info.param)).pitch << "__width__" - << std::get<0>(std::get<1>(info.param)).width << "__height__" - << std::get<0>(std::get<1>(info.param)).height << "__src__" - << src_kind << "__dst__" << dst_kind; + + auto paramTuple = std::get<1>(info.param); + auto param = std::get<0>(paramTuple); + auto queueMode = std::get<1>(paramTuple); + const auto src_kind = std::get<1>(param); + const auto dst_kind = std::get<2>(param); + TestParameters2D testParams = std::get<0>(param); + test_name << platform_device_name << "__pitch__" << testParams.pitch + << "__width__" << testParams.width << "__height__" + << testParams.height << "__src__" << src_kind << "__dst__" + << dst_kind << "__" << queueMode; + return test_name.str(); } @@ -122,10 +154,16 @@ inline std::string printMemBufferTestString( const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = GetPlatformAndDeviceName(device_handle); + auto paramTuple = std::get<1>(info.param); + auto param = std::get<0>(paramTuple); + auto queueMode = std::get<1>(paramTuple); + std::stringstream ss; - ss << std::get<1>(info.param).count; + ss << param.count; ss << "_"; - ss << std::get<1>(info.param).mem_flag; + ss << param.mem_flag; + ss << "__"; + ss << queueMode; return platform_device_name + "__" + ss.str(); } @@ -138,22 +176,31 @@ inline std::string printMemBufferMapWriteTestString( const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = GetPlatformAndDeviceName(device_handle); + auto paramTuple = std::get<1>(info.param); + auto param = std::get<0>(paramTuple); + auto queueMode = std::get<1>(paramTuple); + std::stringstream ss; - ss << std::get<1>(info.param).map_flag; + ss << param.map_flag << "__" << queueMode; return platform_device_name + "__" + ss.str(); } template -inline std::string -printFillTestString(const testing::TestParamInfo &info) { +inline std::string printFillTestStringMultiQueueType( + const testing::TestParamInfo &info) { const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); + auto paramTuple = std::get<1>(info.param); + auto param = std::get<0>(paramTuple); + + auto queueMode = std::get<1>(paramTuple); + std::stringstream test_name; - test_name << platform_device_name << "__size__" - << std::get<1>(info.param).size << "__patternSize__" - << std::get<1>(info.param).pattern_size; + test_name << platform_device_name << "__size__" << param.size + << "__patternSize__" << param.pattern_size << "__" << queueMode; + return test_name.str(); } diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueDeviceGlobalVariableRead.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueDeviceGlobalVariableRead.cpp index e28b3750f7331..7beb831eb9a55 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueDeviceGlobalVariableRead.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueDeviceGlobalVariableRead.cpp @@ -8,10 +8,10 @@ using urEnqueueDeviceGetGlobalVariableReadWithParamTest = uur::urGlobalVariableWithParamTest; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urEnqueueDeviceGetGlobalVariableReadWithParamTest, testing::ValuesIn(uur::BoolTestParam::makeBoolParam("Blocking")), - uur::deviceTestWithParamPrinter); + uur::deviceTestWithParamPrinterMulti); TEST_P(urEnqueueDeviceGetGlobalVariableReadWithParamTest, Success) { bool is_blocking = getParam().value; @@ -44,7 +44,8 @@ TEST_P(urEnqueueDeviceGetGlobalVariableReadWithParamTest, Success) { } using urEnqueueDeviceGetGlobalVariableReadTest = uur::urGlobalVariableTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueDeviceGetGlobalVariableReadTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE( + urEnqueueDeviceGetGlobalVariableReadTest); TEST_P(urEnqueueDeviceGetGlobalVariableReadTest, InvalidNullHandleQueue) { ASSERT_EQ_RESULT(urEnqueueDeviceGlobalVariableRead( diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueDeviceGlobalVariableWrite.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueDeviceGlobalVariableWrite.cpp index 924696a5a2760..e07601739d808 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueDeviceGlobalVariableWrite.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueDeviceGlobalVariableWrite.cpp @@ -8,10 +8,10 @@ using urEnqueueDeviceGetGlobalVariableWriteWithParamTest = uur::urGlobalVariableWithParamTest; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urEnqueueDeviceGetGlobalVariableWriteWithParamTest, testing::ValuesIn(uur::BoolTestParam::makeBoolParam("Blocking")), - uur::deviceTestWithParamPrinter); + uur::deviceTestWithParamPrinterMulti); TEST_P(urEnqueueDeviceGetGlobalVariableWriteWithParamTest, Success) { bool is_blocking = getParam().value; @@ -46,7 +46,8 @@ TEST_P(urEnqueueDeviceGetGlobalVariableWriteWithParamTest, Success) { } using urEnqueueDeviceGetGlobalVariableWriteTest = uur::urGlobalVariableTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueDeviceGetGlobalVariableWriteTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE( + urEnqueueDeviceGetGlobalVariableWriteTest); TEST_P(urEnqueueDeviceGetGlobalVariableWriteTest, InvalidNullHandleQueue) { ASSERT_EQ_RESULT(urEnqueueDeviceGlobalVariableWrite( diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueEventsWaitWithBarrier.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueEventsWaitWithBarrier.cpp index d8e83649c361b..d5a5899e8de52 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueEventsWaitWithBarrier.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueEventsWaitWithBarrier.cpp @@ -100,7 +100,8 @@ struct urEnqueueEventsWaitWithBarrierOrderingTest : uur::urProgramTest { ur_mem_handle_t buffer = nullptr; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueEventsWaitWithBarrierOrderingTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE( + urEnqueueEventsWaitWithBarrierOrderingTest); TEST_P(urEnqueueEventsWaitWithBarrierTest, Success) { UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::NativeCPU{}); diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueKernelLaunch.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueKernelLaunch.cpp index 70f75d51023bb..12dd484bed0a7 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueKernelLaunch.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueKernelLaunch.cpp @@ -19,7 +19,8 @@ struct urEnqueueKernelLaunchNoArgs3DTest : uur::urKernelExecutionTest { size_t global_offset[3] = {0, 0, 0}; size_t n_dimensions = 3; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueKernelLaunchNoArgs3DTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE( + urEnqueueKernelLaunchNoArgs3DTest); struct urEnqueueKernelLaunchTest : uur::urKernelExecutionTest { void SetUp() override { @@ -32,7 +33,7 @@ struct urEnqueueKernelLaunchTest : uur::urKernelExecutionTest { size_t global_offset = 0; size_t n_dimensions = 1; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueKernelLaunchTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urEnqueueKernelLaunchTest); struct urEnqueueKernelLaunchKernelWgSizeTest : uur::urKernelExecutionTest { void SetUp() override { @@ -48,7 +49,8 @@ struct urEnqueueKernelLaunchKernelWgSizeTest : uur::urKernelExecutionTest { std::array wg_size{2, 4, 8}; size_t n_dimensions = 3; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueKernelLaunchKernelWgSizeTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE( + urEnqueueKernelLaunchKernelWgSizeTest); // Note: Due to an issue with HIP, the subgroup test is not generated struct urEnqueueKernelLaunchKernelSubGroupTest : uur::urKernelExecutionTest { @@ -65,7 +67,8 @@ struct urEnqueueKernelLaunchKernelSubGroupTest : uur::urKernelExecutionTest { std::array global_offset{0, 0, 0}; size_t n_dimensions = 3; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueKernelLaunchKernelSubGroupTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE( + urEnqueueKernelLaunchKernelSubGroupTest); struct urEnqueueKernelLaunchKernelStandardTest : uur::urKernelExecutionTest { void SetUp() override { @@ -77,7 +80,8 @@ struct urEnqueueKernelLaunchKernelStandardTest : uur::urKernelExecutionTest { size_t global_size = 1; size_t offset = 0; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueKernelLaunchKernelStandardTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE( + urEnqueueKernelLaunchKernelStandardTest); TEST_P(urEnqueueKernelLaunchNoArgs3DTest, Success) { ASSERT_SUCCESS(urEnqueueKernelLaunch(queue, kernel, n_dimensions, @@ -298,15 +302,21 @@ inline std::string printKernelLaunchTestString( const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); + + auto paramTuple = std::get<1>(info.param); + auto param = std::get<0>(paramTuple); + auto queueMode = std::get<1>(paramTuple); + std::stringstream test_name; - test_name << platform_device_name << "__" << std::get<1>(info.param).Dims - << "D_" << std::get<1>(info.param).X; - if (std::get<1>(info.param).Dims > 1) { - test_name << "_" << std::get<1>(info.param).Y; + test_name << platform_device_name << "__" << param.Dims << "D_" << param.X; + if (param.Dims > 1) { + test_name << "_" << param.Y; } - if (std::get<1>(info.param).Dims > 2) { - test_name << "_" << std::get<1>(info.param).Z; + if (param.Dims > 2) { + test_name << "_" << param.Z; } + test_name << "__" << queueMode; + test_name << ""; return test_name.str(); } @@ -314,11 +324,11 @@ inline std::string printKernelLaunchTestString( struct urEnqueueKernelLaunchTestWithParam : uur::urKernelExecutionTestWithParam { void SetUp() override { - global_range[0] = std::get<1>(GetParam()).X; - global_range[1] = std::get<1>(GetParam()).Y; - global_range[2] = std::get<1>(GetParam()).Z; + global_range[0] = getParam().X; + global_range[1] = getParam().Y; + global_range[2] = getParam().Z; buffer_size = sizeof(val) * global_range[0]; - n_dimensions = std::get<1>(GetParam()).Dims; + n_dimensions = getParam().Dims; if (n_dimensions == 1) { program_name = "fill"; } else if (n_dimensions == 2) { @@ -362,7 +372,7 @@ static std::vector test_cases{// 1D {1027, 1, 19, 3}, {1, 53, 19, 3}, {256, 79, 8, 3}}; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urEnqueueKernelLaunchTestWithParam, testing::ValuesIn(test_cases), printKernelLaunchTestString); @@ -409,7 +419,7 @@ struct urEnqueueKernelLaunchWithUSM : uur::urKernelExecutionTest { size_t alloc_size = 0; void *usmPtr = nullptr; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueKernelLaunchWithUSM); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urEnqueueKernelLaunchWithUSM); TEST_P(urEnqueueKernelLaunchWithUSM, Success) { size_t work_dim = 1; @@ -533,7 +543,8 @@ struct urEnqueueKernelLaunchWithVirtualMemory : uur::urKernelExecutionTest { ur_physical_mem_handle_t physical_mem = nullptr; void *virtual_ptr = nullptr; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueKernelLaunchWithVirtualMemory); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE( + urEnqueueKernelLaunchWithVirtualMemory); TEST_P(urEnqueueKernelLaunchWithVirtualMemory, Success) { size_t work_dim = 1; @@ -699,10 +710,10 @@ struct urEnqueueKernelLaunchUSMLinkedList ur_queue_handle_t queue = nullptr; }; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urEnqueueKernelLaunchUSMLinkedList, testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UsePool")), - uur::deviceTestWithParamPrinter); + uur::deviceTestWithParamPrinterMulti); TEST_P(urEnqueueKernelLaunchUSMLinkedList, Success) { ur_device_usm_access_capability_flags_t shared_usm_flags = 0; diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferCopy.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferCopy.cpp index d6127d52fc4ac..5085586f645ad 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferCopy.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferCopy.cpp @@ -5,12 +5,15 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "helpers.h" +#include "uur/utils.h" #include #include -struct urEnqueueMemBufferCopyTestWithParam : uur::urQueueTestWithParam { +struct urEnqueueMemBufferCopyTestWithParam + : uur::urMultiQueueTypeTestWithParam { + void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urQueueTestWithParam::SetUp()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTestWithParam::SetUp()); ASSERT_SUCCESS(urMemBufferCreate(context, UR_MEM_FLAG_WRITE_ONLY, size, nullptr, &src_buffer)); ASSERT_SUCCESS(urMemBufferCreate(context, UR_MEM_FLAG_READ_ONLY, size, @@ -27,10 +30,10 @@ struct urEnqueueMemBufferCopyTestWithParam : uur::urQueueTestWithParam { if (src_buffer) { EXPECT_SUCCESS(urMemRelease(dst_buffer)); } - urQueueTestWithParam::TearDown(); + urMultiQueueTypeTestWithParam::TearDown(); } - const size_t count = std::get<1>(this->GetParam()); + const size_t count = this->getParam(); const size_t size = sizeof(uint32_t) * count; ur_mem_handle_t src_buffer = nullptr; ur_mem_handle_t dst_buffer = nullptr; @@ -39,9 +42,9 @@ struct urEnqueueMemBufferCopyTestWithParam : uur::urQueueTestWithParam { static std::vector test_parameters{1024, 2500, 4096, 6000}; -UUR_DEVICE_TEST_SUITE_WITH_PARAM(urEnqueueMemBufferCopyTestWithParam, - ::testing::ValuesIn(test_parameters), - uur::deviceTestWithParamPrinter); +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( + urEnqueueMemBufferCopyTestWithParam, ::testing::ValuesIn(test_parameters), + uur::deviceTestWithParamPrinterMulti); TEST_P(urEnqueueMemBufferCopyTestWithParam, Success) { UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferCopyRect.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferCopyRect.cpp index 6cde8bf1eae85..d2d1d519a73f7 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferCopyRect.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferCopyRect.cpp @@ -4,6 +4,7 @@ // // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "helpers.h" +#include "uur/fixtures.h" #include "uur/known_failure.h" #include @@ -70,12 +71,13 @@ static std::vector generateParameterizations() { } struct urEnqueueMemBufferCopyRectTestWithParam - : public uur::urQueueTestWithParam {}; + : public uur::urMultiQueueTypeTestWithParam {}; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urEnqueueMemBufferCopyRectTestWithParam, testing::ValuesIn(generateParameterizations()), - uur::printRectTestString); + uur::printRectTestStringMultiQueue< + urEnqueueMemBufferCopyRectTestWithParam>); TEST_P(urEnqueueMemBufferCopyRectTestWithParam, Success) { const auto name = getParam().name; @@ -143,9 +145,9 @@ TEST_P(urEnqueueMemBufferCopyRectTestWithParam, Success) { ASSERT_SUCCESS(urMemRelease(dst_buffer)); } -struct urEnqueueMemBufferCopyRectTest : uur::urQueueTest { +struct urEnqueueMemBufferCopyRectTest : uur::urMultiQueueTypeTest { void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp()); + UUR_RETURN_ON_FATAL_FAILURE(uur::urMultiQueueTypeTest::SetUp()); ASSERT_SUCCESS(urMemBufferCreate(context, UR_MEM_FLAG_WRITE_ONLY, size, nullptr, &src_buffer)); ASSERT_SUCCESS(urMemBufferCreate(context, UR_MEM_FLAG_READ_ONLY, size, @@ -162,7 +164,7 @@ struct urEnqueueMemBufferCopyRectTest : uur::urQueueTest { if (src_buffer) { EXPECT_SUCCESS(urMemRelease(dst_buffer)); } - urQueueTest::TearDown(); + uur::urMultiQueueTypeTest::TearDown(); } const size_t count = 1024; @@ -178,7 +180,7 @@ struct urEnqueueMemBufferCopyRectTest : uur::urQueueTest { const size_t dst_row_pitch = size; size_t dst_slice_pitch = size; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueMemBufferCopyRectTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urEnqueueMemBufferCopyRectTest); TEST_P(urEnqueueMemBufferCopyRectTest, InvalidNullHandleQueue) { ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferFill.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferFill.cpp index f9c2fc175bc17..72eae2aed8e6a 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferFill.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferFill.cpp @@ -12,14 +12,14 @@ struct testParametersFill { }; struct urEnqueueMemBufferFillTest - : uur::urQueueTestWithParam { + : uur::urMultiQueueTypeTestWithParam { void SetUp() override { // https://github.com/intel/llvm/issues/19604 UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); UUR_RETURN_ON_FATAL_FAILURE( - urQueueTestWithParam::SetUp()); - size = std::get<1>(GetParam()).size; - pattern_size = std::get<1>(GetParam()).pattern_size; + uur::urMultiQueueTypeTestWithParam::SetUp()); + size = getParam().size; + pattern_size = getParam().pattern_size; pattern = std::vector(pattern_size); uur::generateMemFillPattern(pattern); auto ret = urMemBufferCreate(this->context, UR_MEM_FLAG_READ_WRITE, size, @@ -36,7 +36,7 @@ struct urEnqueueMemBufferFillTest EXPECT_SUCCESS(urMemRelease(buffer)); } UUR_RETURN_ON_FATAL_FAILURE( - urQueueTestWithParam::TearDown()); + uur::urMultiQueueTypeTestWithParam::TearDown()); } void verifyData(std::vector &output, size_t verify_size) { @@ -71,9 +71,9 @@ static std::vector test_cases{ {256, 16}, {256, 32}}; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urEnqueueMemBufferFillTest, testing::ValuesIn(test_cases), - uur::printFillTestString); + uur::printFillTestStringMultiQueueType); TEST_P(urEnqueueMemBufferFillTest, Success) { UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); @@ -149,7 +149,8 @@ TEST_P(urEnqueueMemBufferFillTest, SuccessOffset) { using urEnqueueMemBufferFillNegativeTest = uur::urMemBufferQueueTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueMemBufferFillNegativeTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE( + urEnqueueMemBufferFillNegativeTest); TEST_P(urEnqueueMemBufferFillNegativeTest, InvalidNullHandleQueue) { const uint32_t pattern = 0xdeadbeef; diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferMap.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferMap.cpp index c2a1079d4b70e..e4391554062bf 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferMap.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferMap.cpp @@ -10,7 +10,7 @@ using urEnqueueMemBufferMapTestWithParam = uur::urMemBufferQueueTestWithParam; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urEnqueueMemBufferMapTestWithParam, ::testing::ValuesIn(uur::mem_buffer_test_parameters), uur::printMemBufferTestString); @@ -41,7 +41,7 @@ using urEnqueueMemBufferMapTestWithWriteFlagParam = uur::urMemBufferQueueTestWithParam< uur::mem_buffer_map_write_test_parameters_t>; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urEnqueueMemBufferMapTestWithWriteFlagParam, ::testing::ValuesIn(map_write_test_parameters), uur::printMemBufferMapWriteTestString< diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferRead.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferRead.cpp index e24f879ab8028..b14077e7da2c4 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferRead.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferRead.cpp @@ -10,7 +10,7 @@ using urEnqueueMemBufferReadTestWithParam = uur::urMemBufferQueueTestWithParam; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urEnqueueMemBufferReadTestWithParam, ::testing::ValuesIn(uur::mem_buffer_test_parameters), uur::printMemBufferTestString); diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferReadRect.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferReadRect.cpp index 8cbc7f7c3d6f3..10efeae9cc110 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferReadRect.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferReadRect.cpp @@ -4,6 +4,7 @@ // // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "helpers.h" +#include "uur/fixtures.h" #include #include @@ -71,12 +72,13 @@ static std::vector generateParameterizations() { } struct urEnqueueMemBufferReadRectTestWithParam - : public uur::urQueueTestWithParam {}; + : public uur::urMultiQueueTypeTestWithParam {}; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urEnqueueMemBufferReadRectTestWithParam, testing::ValuesIn(generateParameterizations()), - uur::printRectTestString); + uur::printRectTestStringMultiQueue< + urEnqueueMemBufferReadRectTestWithParam>); TEST_P(urEnqueueMemBufferReadRectTestWithParam, Success) { UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); @@ -132,7 +134,7 @@ struct urEnqueueMemBufferReadRectTest : public uur::urMemBufferQueueTest { size_t host_slice_pitch = size; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueMemBufferReadRectTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urEnqueueMemBufferReadRectTest); TEST_P(urEnqueueMemBufferReadRectTest, InvalidNullHandleQueue) { std::vector dst(count); diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferWrite.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferWrite.cpp index e5991a6ffb405..2265bb592d729 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferWrite.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferWrite.cpp @@ -10,7 +10,7 @@ using urEnqueueMemBufferWriteTestWithParam = uur::urMemBufferQueueTestWithParam; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urEnqueueMemBufferWriteTestWithParam, ::testing::ValuesIn(uur::mem_buffer_test_parameters), uur::printMemBufferTestString); diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferWriteRect.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferWriteRect.cpp index 7ba8dc67facd4..0268dbb0a0019 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferWriteRect.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueMemBufferWriteRect.cpp @@ -4,6 +4,7 @@ // // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "helpers.h" +#include "uur/fixtures.h" #include #include @@ -70,12 +71,13 @@ static std::vector generateParameterizations() { } struct urEnqueueMemBufferWriteRectTestWithParam - : public uur::urQueueTestWithParam {}; + : public uur::urMultiQueueTypeTestWithParam {}; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urEnqueueMemBufferWriteRectTestWithParam, testing::ValuesIn(generateParameterizations()), - uur::printRectTestString); + uur::printRectTestStringMultiQueue< + urEnqueueMemBufferWriteRectTestWithParam>); TEST_P(urEnqueueMemBufferWriteRectTestWithParam, Success) { UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); @@ -139,7 +141,7 @@ struct urEnqueueMemBufferWriteRectTest : public uur::urMemBufferQueueTest { size_t host_slice_pitch = size; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueMemBufferWriteRectTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urEnqueueMemBufferWriteRectTest); TEST_P(urEnqueueMemBufferWriteRectTest, InvalidNullHandleQueue) { std::vector src(count); diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueMemImageCopy.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueMemImageCopy.cpp index 55609cfcbff24..51ecd01a69200 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueMemImageCopy.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueMemImageCopy.cpp @@ -3,11 +3,12 @@ // Exceptions. See LICENSE.TXT // // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include #include #include struct urEnqueueMemImageCopyTest - : public uur::urQueueTestWithParam { + : public uur::urMultiQueueTypeTestWithParam { // Helper type so element offset calculations work the same as pixel offsets struct rgba_pixel { uint32_t data[4]; @@ -15,7 +16,7 @@ struct urEnqueueMemImageCopyTest void SetUp() override { UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); - UUR_RETURN_ON_FATAL_FAILURE(urQueueTestWithParam::SetUp()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTestWithParam::SetUp()); ur_bool_t imageSupported; ASSERT_SUCCESS(urDeviceGetInfo(this->device, UR_DEVICE_INFO_IMAGE_SUPPORT, @@ -80,7 +81,7 @@ struct urEnqueueMemImageCopyTest if (dstImage) { EXPECT_SUCCESS(urMemRelease(dstImage)); } - UUR_RETURN_ON_FATAL_FAILURE(urQueueTestWithParam::TearDown()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTestWithParam::TearDown()); } const size_t width = 32; @@ -115,14 +116,20 @@ inline std::string printImageCopyTestString( 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); + + auto paramTuple = std::get<1>(info.param); + const auto image_type = std::get<0>(paramTuple); //std::get<1>(info.param); + const auto queue_mode = std::get<1>(paramTuple); auto test_name = (image_type == UR_MEM_TYPE_IMAGE1D) ? "1D" : (image_type == UR_MEM_TYPE_IMAGE2D) ? "2D" : "3D"; - return platform_device_name + "__" + test_name; + std::stringstream ss; + ss << platform_device_name << "__" << test_name << "__" << queue_mode; + + return ss.str(); } -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urEnqueueMemImageCopyTest, testing::ValuesIn({UR_MEM_TYPE_IMAGE1D, UR_MEM_TYPE_IMAGE2D, UR_MEM_TYPE_IMAGE3D}), diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueMemImageRead.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueMemImageRead.cpp index 5fb8d0f13619d..aaf260860f217 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueMemImageRead.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueMemImageRead.cpp @@ -11,7 +11,7 @@ struct urEnqueueMemImageReadTest : uur::urMemImageQueueTest { UUR_RETURN_ON_FATAL_FAILURE(uur::urMemImageQueueTest::SetUp()); } }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueMemImageReadTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urEnqueueMemImageReadTest); // Note that for each test, we multiply the size in pixels by 4 to account for // each channel in the RGBA image diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueMemImageWrite.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueMemImageWrite.cpp index 3efe2cb71f8e6..9b8bbb3917a5b 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueMemImageWrite.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueMemImageWrite.cpp @@ -11,7 +11,7 @@ struct urEnqueueMemImageWriteTest : uur::urMemImageQueueTest { UUR_RETURN_ON_FATAL_FAILURE(uur::urMemImageQueueTest::SetUp()); } }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueMemImageWriteTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urEnqueueMemImageWriteTest); TEST_P(urEnqueueMemImageWriteTest, Success1D) { std::vector input(width * 4, 42); diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueMemUnmap.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueMemUnmap.cpp index 1b8a5adf61d86..086c81cbde2a4 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueMemUnmap.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueMemUnmap.cpp @@ -24,7 +24,7 @@ struct urEnqueueMemUnmapTestWithParam uint32_t *map = nullptr; }; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urEnqueueMemUnmapTestWithParam, ::testing::ValuesIn(uur::mem_buffer_test_parameters), uur::printMemBufferTestString); diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueReadHostPipe.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueReadHostPipe.cpp index a08a83613e10e..ee0ecbfd81407 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueReadHostPipe.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueReadHostPipe.cpp @@ -7,7 +7,7 @@ using urEnqueueReadHostPipeTest = uur::urHostPipeTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueReadHostPipeTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urEnqueueReadHostPipeTest); TEST_P(urEnqueueReadHostPipeTest, InvalidNullHandleQueue) { uint32_t numEventsInWaitList = 0; diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueUSMFill.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueUSMFill.cpp index ba18c8a5bf1b3..cc175a3143268 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueUSMFill.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueUSMFill.cpp @@ -18,22 +18,25 @@ printFillTestString(const testing::TestParamInfo &info) { const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); + + auto paramTuple = std::get<1>(info.param); + auto param = std::get<0>(paramTuple); + auto queueMode = std::get<1>(paramTuple); std::stringstream test_name; - test_name << platform_device_name << "__size__" - << std::get<1>(info.param).size << "__patternSize__" - << std::get<1>(info.param).pattern_size; + test_name << platform_device_name << "__size__" << param.size + << "__patternSize__" << param.pattern_size << "__" << queueMode; return test_name.str(); } struct urEnqueueUSMFillTestWithParam - : uur::urQueueTestWithParam { + : uur::urMultiQueueTypeTestWithParam { void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urQueueTestWithParam::SetUp()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTestWithParam::SetUp()); - size = std::get<1>(GetParam()).size; + size = getParam().size; host_mem = std::vector(size); - pattern_size = std::get<1>(GetParam()).pattern_size; + pattern_size = getParam().pattern_size; pattern = std::vector(pattern_size); uur::generateMemFillPattern(pattern); @@ -52,7 +55,7 @@ struct urEnqueueUSMFillTestWithParam EXPECT_SUCCESS(urUSMFree(context, ptr)); } - UUR_RETURN_ON_FATAL_FAILURE(urQueueTestWithParam::TearDown()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTestWithParam::TearDown()); } void verifyData() { @@ -94,7 +97,7 @@ static std::vector test_cases{ {256, 16}, {256, 32}}; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urEnqueueUSMFillTestWithParam, testing::ValuesIn(test_cases), printFillTestString); diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueUSMFill2D.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueUSMFill2D.cpp index c6cdf18401100..1c25f430a2583 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueUSMFill2D.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueUSMFill2D.cpp @@ -22,19 +22,21 @@ inline std::string printFill2DTestString( const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); + auto paramTuple = std::get<1>(info.param); + auto param = std::get<0>(paramTuple); + auto queueMode = std::get<1>(paramTuple); + std::stringstream test_name; - test_name << platform_device_name << "__pitch__" - << std::get<1>(info.param).pitch << "__width__" - << std::get<1>(info.param).width << "__height__" - << std::get<1>(info.param).height << "__patternSize__" - << std::get<1>(info.param).pattern_size; + test_name << platform_device_name << "__pitch__" << param.pitch << "__width__" + << param.width << "__height__" << param.height << "__patternSize__" + << param.pattern_size << "__" << queueMode; return test_name.str(); } struct urEnqueueUSMFill2DTestWithParam - : uur::urQueueTestWithParam { + : uur::urMultiQueueTypeTestWithParam { void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urQueueTestWithParam::SetUp()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTestWithParam::SetUp()); bool memfill2d_support = false; ASSERT_SUCCESS(urContextGetInfo(context, UR_CONTEXT_INFO_USM_FILL2D_SUPPORT, @@ -44,10 +46,10 @@ struct urEnqueueUSMFill2DTestWithParam GTEST_SKIP() << "2D USM mem fill is not supported"; } - pitch = std::get<1>(GetParam()).pitch; - width = std::get<1>(GetParam()).width; - height = std::get<1>(GetParam()).height; - pattern_size = std::get<1>(GetParam()).pattern_size; + pitch = getParam().pitch; + width = getParam().width; + height = getParam().height; + pattern_size = getParam().pattern_size; pattern = std::vector(pattern_size); uur::generateMemFillPattern(pattern); allocation_size = pitch * height; @@ -68,7 +70,7 @@ struct urEnqueueUSMFill2DTestWithParam EXPECT_SUCCESS(urUSMFree(context, ptr)); } - UUR_RETURN_ON_FATAL_FAILURE(urQueueTestWithParam::TearDown()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTestWithParam::TearDown()); } void verifyData() { @@ -128,7 +130,7 @@ static std::vector test_cases{ /* Height != power_of_2 && width == power_of_2 && pattern_size == 128 */ {1024, 256, 35, 128}}; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urEnqueueUSMFill2DTestWithParam, testing::ValuesIn(test_cases), printFill2DTestString); diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueUSMMemcpy2D.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueUSMMemcpy2D.cpp index e6ed201e45cbe..cf13e01f83caf 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueUSMMemcpy2D.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueUSMMemcpy2D.cpp @@ -13,12 +13,12 @@ using TestParametersMemcpy2D = std::tuple; struct urEnqueueUSMMemcpy2DTestWithParam - : uur::urQueueTestWithParam { + : uur::urMultiQueueTypeTestWithParam { void SetUp() override { UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); UUR_RETURN_ON_FATAL_FAILURE( - uur::urQueueTestWithParam::SetUp()); + uur::urMultiQueueTypeTestWithParam::SetUp()); const auto [in2DParams, inSrcKind, inDstKind] = getParam(); std::tie(src_pitch, dst_pitch, width, height, src_kind, dst_kind) = @@ -67,7 +67,7 @@ struct urEnqueueUSMMemcpy2DTestWithParam if (pDst) { ASSERT_SUCCESS(urUSMFree(context, pDst)); } - uur::urQueueTestWithParam::TearDown(); + uur::urMultiQueueTypeTestWithParam::TearDown(); } void verifyMemcpySucceeded() { @@ -114,7 +114,7 @@ static std::vector test_sizes{ /* Height == 1 && Pitch == width + 1 */ {234, 233, 1}}; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urEnqueueUSMMemcpy2DTestWithParam, ::testing::Combine(::testing::ValuesIn(test_sizes), ::testing::Values(ur_usm_type_t::UR_USM_TYPE_DEVICE, @@ -149,7 +149,7 @@ TEST_P(urEnqueueUSMMemcpy2DTestWithParam, SuccessNonBlocking) { } using urEnqueueUSMMemcpy2DNegativeTest = urEnqueueUSMMemcpy2DTestWithParam; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urEnqueueUSMMemcpy2DNegativeTest, ::testing::Values(TestParametersMemcpy2D{ {1, 1, 1}, diff --git a/unified-runtime/test/conformance/enqueue/urEnqueueWriteHostPipe.cpp b/unified-runtime/test/conformance/enqueue/urEnqueueWriteHostPipe.cpp index b10053409bac1..0039707f53dea 100644 --- a/unified-runtime/test/conformance/enqueue/urEnqueueWriteHostPipe.cpp +++ b/unified-runtime/test/conformance/enqueue/urEnqueueWriteHostPipe.cpp @@ -7,7 +7,7 @@ using urEnqueueWriteHostPipeTest = uur::urHostPipeTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueWriteHostPipeTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urEnqueueWriteHostPipeTest); TEST_P(urEnqueueWriteHostPipeTest, InvalidNullHandleQueue) { uint32_t numEventsInWaitList = 0; diff --git a/unified-runtime/test/conformance/event/urEventWait.cpp b/unified-runtime/test/conformance/event/urEventWait.cpp index 61ce2f1680451..749afecdf529a 100644 --- a/unified-runtime/test/conformance/event/urEventWait.cpp +++ b/unified-runtime/test/conformance/event/urEventWait.cpp @@ -84,9 +84,9 @@ TEST_P(urEventWaitTest, Success) { ASSERT_SUCCESS(urEventRelease(event2)); } -using urEventWaitNegativeTest = uur::urQueueTest; +using urEventWaitNegativeTest = uur::urMultiQueueTypeTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEventWaitNegativeTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urEventWaitNegativeTest); TEST_P(urEventWaitNegativeTest, ZeroSize) { ur_event_handle_t event = nullptr; diff --git a/unified-runtime/test/conformance/exp_command_buffer/commands.cpp b/unified-runtime/test/conformance/exp_command_buffer/commands.cpp index 4e0ced3502943..a8a6ad4691dfd 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/commands.cpp +++ b/unified-runtime/test/conformance/exp_command_buffer/commands.cpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "fixtures.h" +#include "uur/fixtures.h" #include struct urCommandBufferCommandsTest @@ -216,7 +217,9 @@ struct urCommandBufferAppendKernelLaunchExpTest std::array shared_ptrs = {nullptr, nullptr, nullptr}; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urCommandBufferAppendKernelLaunchExpTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE( + urCommandBufferAppendKernelLaunchExpTest); + TEST_P(urCommandBufferAppendKernelLaunchExpTest, Basic) { ASSERT_SUCCESS(urCommandBufferAppendKernelLaunchExp( cmd_buf_handle, kernel, n_dimensions, &global_offset, &global_size, diff --git a/unified-runtime/test/conformance/exp_command_buffer/copy.cpp b/unified-runtime/test/conformance/exp_command_buffer/copy.cpp index e04fddcee5183..a684edcc981e5 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/copy.cpp +++ b/unified-runtime/test/conformance/exp_command_buffer/copy.cpp @@ -21,10 +21,10 @@ struct urCommandBufferMemcpyCommandsTest uur::command_buffer::urCommandBufferExpTestWithParam< testParametersMemcpy>::SetUp()); - size = std::get<1>(GetParam()).size; - offset_src = std::get<1>(GetParam()).offset_src; - offset_dst = std::get<1>(GetParam()).offset_dst; - copy_size = std::get<1>(GetParam()).copy_size; + size = getParam().size; + offset_src = getParam().offset_src; + offset_dst = getParam().offset_dst; + copy_size = getParam().copy_size; assert(size >= offset_src + copy_size); assert(size >= offset_dst + copy_size); // Allocate USM pointers @@ -103,15 +103,20 @@ static std::string printMemcpyTestString( const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); std::stringstream test_name; - test_name << platform_device_name << "__size__" - << std::get<1>(info.param).size << "__offset_src__" - << std::get<1>(info.param).offset_src << "__offset_src__" - << std::get<1>(info.param).offset_dst << "__copy_size__" - << std::get<1>(info.param).copy_size; + + auto paramTuple = std::get<1>(info.param); + auto param = std::get<0>(paramTuple); + auto queueMode = std::get<1>(paramTuple); + + test_name << platform_device_name << "__size__" << param.size + << "__offset_src__" << param.offset_src << "__offset_src__" + << param.offset_dst << "__copy_size__" << param.copy_size << "__" + << queueMode; + return test_name.str(); } -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urCommandBufferMemcpyCommandsTest, testing::ValuesIn(test_cases), printMemcpyTestString); diff --git a/unified-runtime/test/conformance/exp_command_buffer/enqueue.cpp b/unified-runtime/test/conformance/exp_command_buffer/enqueue.cpp index afc49540c452d..ce3a8b193ebb3 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/enqueue.cpp +++ b/unified-runtime/test/conformance/exp_command_buffer/enqueue.cpp @@ -25,7 +25,7 @@ struct urEnqueueCommandBufferExpTest urCommandBufferExpExecutionTestWithParam::SetUp()); // Create an in-order or out-of-order queue, depending on the passed parameter - ur_queue_flags_t queue_type = std::get<1>(GetParam()); + ur_queue_flags_t queue_type = getParam(); ur_queue_properties_t queue_properties = { UR_STRUCTURE_TYPE_QUEUE_PROPERTIES, nullptr, queue_type}; ASSERT_SUCCESS(urQueueCreate(context, device, &queue_properties, @@ -112,9 +112,12 @@ struct urEnqueueCommandBufferExpTest std::string deviceTestWithQueueTypePrinter( const ::testing::TestParamInfo< - std::tuple> &info) { + std::tuple>> + &info) { auto device = std::get<0>(info.param).device; - auto queue_type = std::get<1>(info.param); + + auto paramTuple = std::get<1>(info.param); + auto queue_type = std::get<0>(paramTuple); std::stringstream ss; @@ -131,11 +134,13 @@ std::string deviceTestWithQueueTypePrinter( ss << "UnspecifiedQueueType" << queue_type; } + ss << "__basic_queue_mode__" << std::get<1>(paramTuple); + return uur::GetPlatformAndDeviceName(device) + "__" + uur::GTestSanitizeString(ss.str()); } -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urEnqueueCommandBufferExpTest, testing::Values(0, UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE), deviceTestWithQueueTypePrinter); diff --git a/unified-runtime/test/conformance/exp_command_buffer/fill.cpp b/unified-runtime/test/conformance/exp_command_buffer/fill.cpp index a07030f8b330a..6b18721f5bcfe 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/fill.cpp +++ b/unified-runtime/test/conformance/exp_command_buffer/fill.cpp @@ -23,8 +23,8 @@ struct urCommandBufferFillCommandsTest uur::command_buffer::urCommandBufferExpTestWithParam< testParametersFill>::SetUp()); - size = std::get<1>(GetParam()).size; - pattern_size = std::get<1>(GetParam()).pattern_size; + size = getParam().size; + pattern_size = getParam().pattern_size; pattern = std::vector(pattern_size); uur::generateMemFillPattern(pattern); @@ -99,13 +99,17 @@ printFillTestString(const testing::TestParamInfo &info) { const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); std::stringstream test_name; - test_name << platform_device_name << "__size__" - << std::get<1>(info.param).size << "__patternSize__" - << std::get<1>(info.param).pattern_size; + + auto paramTuple = std::get<1>(info.param); + auto param = std::get<0>(paramTuple); + auto queueMode = std::get<1>(paramTuple); + test_name << platform_device_name << "__size__" << param.size + << "__patternSize__" << param.pattern_size << "__" << queueMode; + return test_name.str(); } -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urCommandBufferFillCommandsTest, testing::ValuesIn(test_cases), printFillTestString); diff --git a/unified-runtime/test/conformance/exp_command_buffer/fixtures.h b/unified-runtime/test/conformance/exp_command_buffer/fixtures.h index 88ed393fed3de..d92ddf729e908 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/fixtures.h +++ b/unified-runtime/test/conformance/exp_command_buffer/fixtures.h @@ -68,9 +68,9 @@ struct urCommandBufferExpTest : uur::urContextTest { }; template -struct urCommandBufferExpTestWithParam : urQueueTestWithParam { +struct urCommandBufferExpTestWithParam : urMultiQueueTypeTestWithParam { void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(uur::urQueueTestWithParam::SetUp()); + UUR_RETURN_ON_FATAL_FAILURE(uur::urMultiQueueTypeTestWithParam::SetUp()); UUR_RETURN_ON_FATAL_FAILURE(checkCommandBufferSupport(this->device)); @@ -85,7 +85,8 @@ struct urCommandBufferExpTestWithParam : urQueueTestWithParam { if (cmd_buf_handle) { EXPECT_SUCCESS(urCommandBufferReleaseExp(cmd_buf_handle)); } - UUR_RETURN_ON_FATAL_FAILURE(uur::urQueueTestWithParam::TearDown()); + UUR_RETURN_ON_FATAL_FAILURE( + uur::urMultiQueueTypeTestWithParam::TearDown()); } ur_exp_command_buffer_handle_t cmd_buf_handle = nullptr; diff --git a/unified-runtime/test/conformance/exp_command_buffer/in-order.cpp b/unified-runtime/test/conformance/exp_command_buffer/in-order.cpp index 45357340ed6df..faaa0b608dac1 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/in-order.cpp +++ b/unified-runtime/test/conformance/exp_command_buffer/in-order.cpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "fixtures.h" +#include "uur/fixtures.h" #include // Virtual base class for tests verifying that if the `isInOrder` field is @@ -146,7 +147,7 @@ struct urInOrderUSMCommandBufferExpTest : urInOrderCommandBufferExpTest { std::array device_ptrs = {nullptr, nullptr, nullptr}; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urInOrderUSMCommandBufferExpTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urInOrderUSMCommandBufferExpTest); // Tests USM Fill, Copy, and Kernel commands to a command-buffer TEST_P(urInOrderUSMCommandBufferExpTest, WithoutHints) { diff --git a/unified-runtime/test/conformance/exp_command_buffer/kernel_event_sync.cpp b/unified-runtime/test/conformance/exp_command_buffer/kernel_event_sync.cpp index 89ce5141ee4cf..ac71ccfb13538 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/kernel_event_sync.cpp +++ b/unified-runtime/test/conformance/exp_command_buffer/kernel_event_sync.cpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "fixtures.h" +#include "uur/fixtures.h" #include // Tests kernel commands using ur events for command level synchronization work @@ -80,7 +81,7 @@ struct KernelCommandEventSyncTest static constexpr size_t A = 2; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(KernelCommandEventSyncTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(KernelCommandEventSyncTest); // Tests using a regular enqueue event as a dependency of a command-buffer // command, and having the signal event of that command-buffer command being diff --git a/unified-runtime/test/conformance/exp_command_buffer/read.cpp b/unified-runtime/test/conformance/exp_command_buffer/read.cpp index de9e8f88d23b9..832553f2df524 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/read.cpp +++ b/unified-runtime/test/conformance/exp_command_buffer/read.cpp @@ -23,9 +23,9 @@ struct urCommandBufferReadCommandsTest uur::command_buffer::urCommandBufferExpTestWithParam< testParametersRead>::SetUp()); - size = std::get<1>(GetParam()).size; - offset = std::get<1>(GetParam()).offset; - read_size = std::get<1>(GetParam()).read_size; + size = getParam().size; + offset = getParam().offset; + read_size = getParam().read_size; assert(size >= offset + read_size); // Allocate USM pointers ASSERT_SUCCESS( @@ -83,14 +83,18 @@ printReadTestString(const testing::TestParamInfo &info) { const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); std::stringstream test_name; - test_name << platform_device_name << "__size__" - << std::get<1>(info.param).size << "__offset__" - << std::get<1>(info.param).offset << "__read_size__" - << std::get<1>(info.param).read_size; + + auto paramTuple = std::get<1>(info.param); + auto param = std::get<0>(paramTuple); + auto queueMode = std::get<1>(paramTuple); + + test_name << platform_device_name << "__size__" << param.size << "__offset__" + << param.offset << "__read_size__" << param.read_size << "__" + << queueMode; return test_name.str(); } -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urCommandBufferReadCommandsTest, testing::ValuesIn(test_cases), printReadTestString); diff --git a/unified-runtime/test/conformance/exp_command_buffer/rect_read.cpp b/unified-runtime/test/conformance/exp_command_buffer/rect_read.cpp index 842d0ee4cad0a..b5b329289c821 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/rect_read.cpp +++ b/unified-runtime/test/conformance/exp_command_buffer/rect_read.cpp @@ -114,7 +114,7 @@ struct urCommandBufferAppendMemBufferReadRectTestWithParam ur_mem_handle_t buffer = nullptr; }; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urCommandBufferAppendMemBufferReadRectTestWithParam, testing::ValuesIn(generateParameterizations()), uur::printRectTestString< diff --git a/unified-runtime/test/conformance/exp_command_buffer/rect_write.cpp b/unified-runtime/test/conformance/exp_command_buffer/rect_write.cpp index 377d9a55280dd..35aa662543bd1 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/rect_write.cpp +++ b/unified-runtime/test/conformance/exp_command_buffer/rect_write.cpp @@ -114,7 +114,7 @@ struct urCommandBufferAppendMemBufferWriteRectTestWithParam ur_mem_handle_t buffer = nullptr; }; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urCommandBufferAppendMemBufferWriteRectTestWithParam, testing::ValuesIn(generateParameterizations()), uur::printRectTestString< diff --git a/unified-runtime/test/conformance/exp_command_buffer/regression/usm_copy.cpp b/unified-runtime/test/conformance/exp_command_buffer/regression/usm_copy.cpp index 8b985f1e35d7d..5ae939159261d 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/regression/usm_copy.cpp +++ b/unified-runtime/test/conformance/exp_command_buffer/regression/usm_copy.cpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "../fixtures.h" +#include "uur/fixtures.h" // UR reproducer for SYCL-Graph E2E test "RecordReplay/usm_copy_in_order.cpp" // Note that the kernel code is different, in that this test uses the @@ -76,7 +77,9 @@ struct urCommandBufferUSMCopyInOrderTest std::array device_ptrs = {nullptr, nullptr, nullptr, nullptr}; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urCommandBufferUSMCopyInOrderTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE( + urCommandBufferUSMCopyInOrderTest); + TEST_P(urCommandBufferUSMCopyInOrderTest, Success) { // https://github.com/intel/llvm/issues/19604 UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); diff --git a/unified-runtime/test/conformance/exp_command_buffer/update/buffer_fill_kernel_update.cpp b/unified-runtime/test/conformance/exp_command_buffer/update/buffer_fill_kernel_update.cpp index 5ca00b8465bfa..e560153b8adae 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/update/buffer_fill_kernel_update.cpp +++ b/unified-runtime/test/conformance/exp_command_buffer/update/buffer_fill_kernel_update.cpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "../fixtures.h" +#include "uur/fixtures.h" // Test that updating a command-buffer with a single kernel command // taking USM arguments works correctly. @@ -76,7 +77,7 @@ struct BufferFillCommandTest ur_exp_command_buffer_command_handle_t command_handle = nullptr; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(BufferFillCommandTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(BufferFillCommandTest); // Update kernel arguments to fill with a new scalar value to a new output // buffer. diff --git a/unified-runtime/test/conformance/exp_command_buffer/update/buffer_saxpy_kernel_update.cpp b/unified-runtime/test/conformance/exp_command_buffer/update/buffer_saxpy_kernel_update.cpp index 0dea12ed4efb9..dfaa124a299c6 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/update/buffer_saxpy_kernel_update.cpp +++ b/unified-runtime/test/conformance/exp_command_buffer/update/buffer_saxpy_kernel_update.cpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "../fixtures.h" +#include "uur/fixtures.h" #include // Test that updating a command-buffer with a single kernel command @@ -129,7 +130,7 @@ struct BufferSaxpyKernelTest ur_exp_command_buffer_command_handle_t command_handle = nullptr; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(BufferSaxpyKernelTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(BufferSaxpyKernelTest); TEST_P(BufferSaxpyKernelTest, UpdateParameters) { // Run command-buffer prior to update an verify output diff --git a/unified-runtime/test/conformance/exp_command_buffer/update/enqueue_update.cpp b/unified-runtime/test/conformance/exp_command_buffer/update/enqueue_update.cpp index a10fae3317976..40737b76d0923 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/update/enqueue_update.cpp +++ b/unified-runtime/test/conformance/exp_command_buffer/update/enqueue_update.cpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "../fixtures.h" +#include "uur/fixtures.h" #include #include @@ -159,7 +160,8 @@ struct urUpdatableEnqueueCommandBufferExpTest std::array shared_ptrs = {nullptr, nullptr}; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urUpdatableEnqueueCommandBufferExpTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE( + urUpdatableEnqueueCommandBufferExpTest); // Tests that the same command-buffer submitted across different in-order // queues has an implicit dependency on first submission diff --git a/unified-runtime/test/conformance/exp_command_buffer/update/invalid_update.cpp b/unified-runtime/test/conformance/exp_command_buffer/update/invalid_update.cpp index dcaab8201f52b..3288a03c665bc 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/update/invalid_update.cpp +++ b/unified-runtime/test/conformance/exp_command_buffer/update/invalid_update.cpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "../fixtures.h" +#include "uur/fixtures.h" #include #include #include @@ -69,7 +70,7 @@ struct InvalidUpdateTest bool finalized = false; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(InvalidUpdateTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(InvalidUpdateTest); // Test error code is returned if command-buffer not finalized TEST_P(InvalidUpdateTest, NotFinalizedCommandBuffer) { @@ -392,7 +393,8 @@ struct InvalidUpdateCommandBufferExpExecutionTest : uur::urKernelExecutionTest { 0; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(InvalidUpdateCommandBufferExpExecutionTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE( + InvalidUpdateCommandBufferExpExecutionTest); // Test error reported if device doesn't support updating kernel args TEST_P(InvalidUpdateCommandBufferExpExecutionTest, KernelArg) { diff --git a/unified-runtime/test/conformance/exp_command_buffer/update/kernel_event_sync.cpp b/unified-runtime/test/conformance/exp_command_buffer/update/kernel_event_sync.cpp index 1aa4614ea3254..a2fa2f9b1d0d6 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/update/kernel_event_sync.cpp +++ b/unified-runtime/test/conformance/exp_command_buffer/update/kernel_event_sync.cpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "../fixtures.h" +#include "uur/fixtures.h" #include struct KernelCommandEventSyncUpdateTest @@ -64,7 +65,7 @@ struct KernelCommandEventSyncUpdateTest static constexpr size_t A = 2; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(KernelCommandEventSyncUpdateTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(KernelCommandEventSyncUpdateTest); // Tests updating the signal and wait event dependencies of the saxpy // command in a command-buffer. diff --git a/unified-runtime/test/conformance/exp_command_buffer/update/local_memory_update.cpp b/unified-runtime/test/conformance/exp_command_buffer/update/local_memory_update.cpp index 8c7d4774d13e9..292769f4500d9 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/update/local_memory_update.cpp +++ b/unified-runtime/test/conformance/exp_command_buffer/update/local_memory_update.cpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "../fixtures.h" +#include "uur/fixtures.h" #include #include @@ -134,7 +135,7 @@ struct LocalMemoryUpdateTest : LocalMemoryUpdateTestBase { ur_exp_command_buffer_command_handle_t command_handle = nullptr; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(LocalMemoryUpdateTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(LocalMemoryUpdateTest); // Test updating A,X,Y parameters to new values and local memory parameters // to original values. @@ -888,7 +889,7 @@ struct LocalMemoryMultiUpdateTest : LocalMemoryUpdateTestBase { std::array command_handles{}; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(LocalMemoryMultiUpdateTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(LocalMemoryMultiUpdateTest); // Test updating A,X,Y parameters to new values and local memory parameters // to original values. @@ -1191,7 +1192,7 @@ struct LocalMemoryUpdateTestOutOfOrder : LocalMemoryUpdateTestBaseOutOfOrder { ur_exp_command_buffer_command_handle_t command_handle = nullptr; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(LocalMemoryUpdateTestOutOfOrder); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(LocalMemoryUpdateTestOutOfOrder); // Test updating A,X,Y parameters to new values and local memory to larger // values when the kernel arguments were added out of order. diff --git a/unified-runtime/test/conformance/exp_command_buffer/update/ndrange_update.cpp b/unified-runtime/test/conformance/exp_command_buffer/update/ndrange_update.cpp index 689cf0e0daaac..f03471f99c926 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/update/ndrange_update.cpp +++ b/unified-runtime/test/conformance/exp_command_buffer/update/ndrange_update.cpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "../fixtures.h" +#include "uur/fixtures.h" #include #include @@ -101,7 +102,7 @@ struct NDRangeUpdateTest ur_exp_command_buffer_command_handle_t command_handle = nullptr; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(NDRangeUpdateTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(NDRangeUpdateTest); // Add a 3 dimension kernel command to the command-buffer and update the // local size and global offset diff --git a/unified-runtime/test/conformance/exp_command_buffer/update/usm_fill_kernel_update.cpp b/unified-runtime/test/conformance/exp_command_buffer/update/usm_fill_kernel_update.cpp index 66b2b3f652372..826f548d27e97 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/update/usm_fill_kernel_update.cpp +++ b/unified-runtime/test/conformance/exp_command_buffer/update/usm_fill_kernel_update.cpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "../fixtures.h" +#include "uur/fixtures.h" #include #include @@ -75,7 +76,7 @@ struct USMFillCommandTest ur_exp_command_buffer_command_handle_t command_handle = nullptr; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(USMFillCommandTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(USMFillCommandTest); // Test using a different global size to fill and larger USM output buffer TEST_P(USMFillCommandTest, UpdateParameters) { @@ -317,7 +318,7 @@ struct USMMultipleFillCommandTest command_handles; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(USMMultipleFillCommandTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(USMMultipleFillCommandTest); // Test updating all the kernels commands in the command-buffer TEST_P(USMMultipleFillCommandTest, UpdateAllKernels) { diff --git a/unified-runtime/test/conformance/exp_command_buffer/update/usm_saxpy_kernel_update.cpp b/unified-runtime/test/conformance/exp_command_buffer/update/usm_saxpy_kernel_update.cpp index 2495497d1c3b7..5005fff18ad66 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/update/usm_saxpy_kernel_update.cpp +++ b/unified-runtime/test/conformance/exp_command_buffer/update/usm_saxpy_kernel_update.cpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "../fixtures.h" +#include "uur/fixtures.h" #include #include @@ -90,7 +91,7 @@ struct USMSaxpyKernelTest : USMSaxpyKernelTestBase { ur_exp_command_buffer_command_handle_t command_handle = nullptr; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(USMSaxpyKernelTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(USMSaxpyKernelTest); TEST_P(USMSaxpyKernelTest, UpdateParameters) { // Run command-buffer prior to update an verify output @@ -188,7 +189,7 @@ struct USMMultiSaxpyKernelTest : USMSaxpyKernelTestBase { std::array command_handles{}; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(USMMultiSaxpyKernelTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(USMMultiSaxpyKernelTest); TEST_P(USMMultiSaxpyKernelTest, UpdateParameters) { // Run command-buffer prior to update an verify output diff --git a/unified-runtime/test/conformance/exp_command_buffer/write.cpp b/unified-runtime/test/conformance/exp_command_buffer/write.cpp index 29b011325db88..de35720029e4b 100644 --- a/unified-runtime/test/conformance/exp_command_buffer/write.cpp +++ b/unified-runtime/test/conformance/exp_command_buffer/write.cpp @@ -24,9 +24,9 @@ struct urCommandBufferWriteCommandsTest uur::command_buffer::urCommandBufferExpTestWithParam< testParametersWrite>::SetUp()); - size = std::get<1>(GetParam()).size; - offset = std::get<1>(GetParam()).offset; - write_size = std::get<1>(GetParam()).write_size; + size = getParam().size; + offset = getParam().offset; + write_size = getParam().write_size; assert(size >= offset + write_size); // Allocate USM pointers ASSERT_SUCCESS( @@ -91,14 +91,18 @@ static std::string printWriteTestString( const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); std::stringstream test_name; - test_name << platform_device_name << "__size__" - << std::get<1>(info.param).size << "__offset__" - << std::get<1>(info.param).offset << "__write_size__" - << std::get<1>(info.param).write_size; + + auto paramTuple = std::get<1>(info.param); + auto param = std::get<0>(paramTuple); + auto queueMode = std::get<1>(paramTuple); + + test_name << platform_device_name << "__size__" << param.size << "__offset__" + << param.offset << "__write_size__" << param.write_size << "__" + << queueMode; return test_name.str(); } -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urCommandBufferWriteCommandsTest, testing::ValuesIn(test_cases), printWriteTestString); diff --git a/unified-runtime/test/conformance/exp_enqueue_kernel_launch_with_args/urEnqueueKernelLaunchWithArgsExp.cpp b/unified-runtime/test/conformance/exp_enqueue_kernel_launch_with_args/urEnqueueKernelLaunchWithArgsExp.cpp index 2c30557ef11ec..35d4ec6e8ae91 100644 --- a/unified-runtime/test/conformance/exp_enqueue_kernel_launch_with_args/urEnqueueKernelLaunchWithArgsExp.cpp +++ b/unified-runtime/test/conformance/exp_enqueue_kernel_launch_with_args/urEnqueueKernelLaunchWithArgsExp.cpp @@ -144,7 +144,8 @@ struct urEnqueueKernelLaunchWithArgsTest : uur::urKernelExecutionTest { ur_backend_t backend{}; std::vector args; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueKernelLaunchWithArgsTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE( + urEnqueueKernelLaunchWithArgsTest); TEST_P(urEnqueueKernelLaunchWithArgsTest, Success) { ASSERT_SUCCESS(urEnqueueKernelLaunchWithArgsExp( @@ -284,7 +285,8 @@ struct urEnqueueKernelLaunchWithArgsMemObjTest : uur::urKernelExecutionTest { } accessor; std::vector args; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEnqueueKernelLaunchWithArgsMemObjTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE( + urEnqueueKernelLaunchWithArgsMemObjTest); TEST_P(urEnqueueKernelLaunchWithArgsMemObjTest, Success) { ASSERT_SUCCESS(urEnqueueKernelLaunchWithArgsExp( diff --git a/unified-runtime/test/conformance/integration/QueueBuffer.cpp b/unified-runtime/test/conformance/integration/QueueBuffer.cpp index 5902931a1d2ef..6a23b1bb3f79d 100644 --- a/unified-runtime/test/conformance/integration/QueueBuffer.cpp +++ b/unified-runtime/test/conformance/integration/QueueBuffer.cpp @@ -9,20 +9,20 @@ #include #include -struct QueueBufferTestWithParam : uur::IntegrationQueueTestWithParam { +struct QueueBufferTest : uur::IntegrationQueueTest { 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()); + UUR_RETURN_ON_FATAL_FAILURE(uur::IntegrationQueueTest::SetUp()); } - void TearDown() override { uur::IntegrationQueueTestWithParam::TearDown(); } + void TearDown() override { uur::IntegrationQueueTest::TearDown(); } void verifyResults(ur_mem_handle_t Buffer, uint32_t ExpectedValue) { uint32_t HostMem[ArraySize] = {}; - ASSERT_SUCCESS(urEnqueueMemBufferRead(Queue, Buffer, true, 0, + ASSERT_SUCCESS(urEnqueueMemBufferRead(queue, Buffer, true, 0, sizeof(uint32_t) * ArraySize, HostMem, 0, nullptr, nullptr)); @@ -35,11 +35,11 @@ struct QueueBufferTestWithParam : uur::IntegrationQueueTestWithParam { ur_mem_handle_t Buffer2 = nullptr; }; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( - QueueBufferTestWithParam, +UUR_DEVICE_TEST_SUITE_WITH_QUEUE_TYPES_PRINTER( + QueueBufferTest, testing::Values(0, /* In-Order */ UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE), - uur::IntegrationQueueTestWithParam::paramPrinter); + uur::IntegrationQueueTest::paramPrinter); /* Submits multiple kernels that interact with each other by accessing and * writing to the same buffers. @@ -47,7 +47,7 @@ UUR_DEVICE_TEST_SUITE_WITH_PARAM( * between calls to urEnqueueKernelLaunch. * Checks that when using an OUT_OF_ORDER queue, synchronizing using only * event barriers is enough. */ -TEST_P(QueueBufferTestWithParam, QueueBufferTest) { +TEST_P(QueueBufferTest, QueueBufferTest) { std::vector EventsFill; ur_event_handle_t Event; @@ -60,12 +60,12 @@ TEST_P(QueueBufferTestWithParam, QueueBufferTest) { AddBuffer1DArg(ArraySize * sizeof(uint32_t), &Buffer2, &Buffer2Index)); ASSERT_SUCCESS( - urEnqueueMemBufferFill(Queue, Buffer1, &InitialValue, sizeof(uint32_t), 0, + urEnqueueMemBufferFill(queue, Buffer1, &InitialValue, sizeof(uint32_t), 0, ArraySize * sizeof(uint32_t), 0, nullptr, &Event)); EventsFill.push_back(Event); ASSERT_SUCCESS( - urEnqueueMemBufferFill(Queue, Buffer2, &InitialValue, sizeof(uint32_t), 0, + urEnqueueMemBufferFill(queue, Buffer2, &InitialValue, sizeof(uint32_t), 0, ArraySize * sizeof(uint32_t), 0, nullptr, &Event)); EventsFill.push_back(Event); @@ -85,7 +85,7 @@ TEST_P(QueueBufferTestWithParam, QueueBufferTest) { ASSERT_SUCCESS( urKernelSetArgMemObj(kernel, Buffer1Index, nullptr, Buffer1)); - ASSERT_SUCCESS(urEnqueueKernelLaunch(Queue, kernel, NDimensions, + ASSERT_SUCCESS(urEnqueueKernelLaunch(queue, kernel, NDimensions, &GlobalOffset, &ArraySize, nullptr, nullptr, 0, nullptr, &Event)); ASSERT_NO_FATAL_FAILURE(submitBarrierIfNeeded(Event)); @@ -98,7 +98,7 @@ TEST_P(QueueBufferTestWithParam, QueueBufferTest) { ASSERT_SUCCESS( urKernelSetArgMemObj(kernel, Buffer2Index, nullptr, Buffer1)); - ASSERT_SUCCESS(urEnqueueKernelLaunch(Queue, kernel, NDimensions, + ASSERT_SUCCESS(urEnqueueKernelLaunch(queue, kernel, NDimensions, &GlobalOffset, &ArraySize, nullptr, nullptr, 0, nullptr, &Event)); ASSERT_NO_FATAL_FAILURE(submitBarrierIfNeeded(Event)); @@ -106,7 +106,7 @@ TEST_P(QueueBufferTestWithParam, QueueBufferTest) { CurValueMem1 = CurValueMem2 * 2; } - ASSERT_SUCCESS(urQueueFinish(Queue)); + ASSERT_SUCCESS(urQueueFinish(queue)); ASSERT_NO_FATAL_FAILURE(verifyResults(Buffer1, CurValueMem1)); ASSERT_NO_FATAL_FAILURE(verifyResults(Buffer2, CurValueMem2)); diff --git a/unified-runtime/test/conformance/integration/QueueEmptyStatus.cpp b/unified-runtime/test/conformance/integration/QueueEmptyStatus.cpp index 5dc03516842f3..40f17e2b221ec 100644 --- a/unified-runtime/test/conformance/integration/QueueEmptyStatus.cpp +++ b/unified-runtime/test/conformance/integration/QueueEmptyStatus.cpp @@ -9,14 +9,14 @@ #include #include -struct QueueEmptyStatusTestWithParam : uur::IntegrationQueueTestWithParam { +struct QueueEmptyStatusTest : uur::IntegrationQueueTest { void SetUp() override { UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}, uur::NativeCPU{}); program_name = "multiply"; - UUR_RETURN_ON_FATAL_FAILURE(uur::IntegrationQueueTestWithParam::SetUp()); + UUR_RETURN_ON_FATAL_FAILURE(uur::IntegrationQueueTest::SetUp()); ur_device_usm_access_capability_flags_t shared_usm_flags = 0; ASSERT_SUCCESS( @@ -42,12 +42,12 @@ struct QueueEmptyStatusTestWithParam : uur::IntegrationQueueTestWithParam { if (SharedMem) { ASSERT_SUCCESS(urUSMFree(context, SharedMem)); } - uur::IntegrationQueueTestWithParam::TearDown(); + uur::IntegrationQueueTest::TearDown(); } void submitWorkToQueue() { ur_event_handle_t Event; - ASSERT_SUCCESS(urEnqueueUSMFill(Queue, SharedMem, sizeof(uint32_t), + ASSERT_SUCCESS(urEnqueueUSMFill(queue, SharedMem, sizeof(uint32_t), &InitialValue, ArraySize * sizeof(uint32_t), 0, nullptr, &Event)); ASSERT_NO_FATAL_FAILURE(submitBarrierIfNeeded(Event)); @@ -58,13 +58,13 @@ struct QueueEmptyStatusTestWithParam : uur::IntegrationQueueTestWithParam { constexpr size_t n_dimensions = 1; constexpr uint32_t num_iterations = 5; for (uint32_t i = 0; i < num_iterations; ++i) { - ASSERT_SUCCESS(urEnqueueKernelLaunch(Queue, kernel, n_dimensions, + ASSERT_SUCCESS(urEnqueueKernelLaunch(queue, kernel, n_dimensions, &global_offset, &ArraySize, nullptr, nullptr, 0, nullptr, &Event)); ASSERT_NO_FATAL_FAILURE(submitBarrierIfNeeded(Event)); } - ASSERT_SUCCESS(urQueueFlush(Queue)); + ASSERT_SUCCESS(urQueueFlush(queue)); } void waitUntilQueueEmpty() const { @@ -81,7 +81,7 @@ struct QueueEmptyStatusTestWithParam : uur::IntegrationQueueTestWithParam { std::this_thread::sleep_for(step); ur_bool_t is_queue_empty; - ASSERT_SUCCESS(urQueueGetInfo(Queue, UR_QUEUE_INFO_EMPTY, + ASSERT_SUCCESS(urQueueGetInfo(queue, UR_QUEUE_INFO_EMPTY, sizeof(ur_bool_t), &is_queue_empty, nullptr)); if (is_queue_empty) { @@ -91,25 +91,25 @@ struct QueueEmptyStatusTestWithParam : uur::IntegrationQueueTestWithParam { /* If we are here, the test failed. Let's call queue finish to avoid * issues when freeing memory */ - ASSERT_SUCCESS(urQueueFinish(Queue)); + ASSERT_SUCCESS(urQueueFinish(queue)); GTEST_FAIL(); } void *SharedMem = nullptr; }; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( - QueueEmptyStatusTestWithParam, +UUR_DEVICE_TEST_SUITE_WITH_QUEUE_TYPES_PRINTER( + QueueEmptyStatusTest, testing::Values(0, /* In-Order */ UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE), - uur::IntegrationQueueTestWithParam::paramPrinter); + uur::IntegrationQueueTest::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. * Explicit synchronization (except for barriers) is avoided in these tests to * check that the properties of In-Order and OutOfOrder queues are working as * expected */ -TEST_P(QueueEmptyStatusTestWithParam, QueueEmptyStatusTest) { +TEST_P(QueueEmptyStatusTest, QueueEmptyStatusTest) { ASSERT_NO_FATAL_FAILURE(submitWorkToQueue()); ASSERT_NO_FATAL_FAILURE(waitUntilQueueEmpty()); diff --git a/unified-runtime/test/conformance/integration/QueueUSM.cpp b/unified-runtime/test/conformance/integration/QueueUSM.cpp index 331348c3bd95a..b5755c8d79fc1 100644 --- a/unified-runtime/test/conformance/integration/QueueUSM.cpp +++ b/unified-runtime/test/conformance/integration/QueueUSM.cpp @@ -9,13 +9,13 @@ #include #include -struct QueueUSMTestWithParam : uur::IntegrationQueueTestWithParam { +struct QueueUSMTest : uur::IntegrationQueueTest { 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()); + UUR_RETURN_ON_FATAL_FAILURE(uur::IntegrationQueueTest::SetUp()); ur_device_usm_access_capability_flags_t shared_usm_flags = 0; ASSERT_SUCCESS( @@ -38,12 +38,12 @@ struct QueueUSMTestWithParam : uur::IntegrationQueueTestWithParam { if (DeviceMem2) { ASSERT_SUCCESS(urUSMFree(context, DeviceMem2)); } - uur::IntegrationQueueTestWithParam::TearDown(); + uur::IntegrationQueueTest::TearDown(); } void verifyResults(void *DeviceMem, uint32_t ExpectedValue) { uint32_t HostMem[ArraySize] = {}; - ASSERT_SUCCESS(urEnqueueUSMMemcpy(Queue, true, HostMem, DeviceMem, + ASSERT_SUCCESS(urEnqueueUSMMemcpy(queue, true, HostMem, DeviceMem, sizeof(uint32_t) * ArraySize, 0, nullptr, nullptr)); @@ -56,11 +56,11 @@ struct QueueUSMTestWithParam : uur::IntegrationQueueTestWithParam { void *DeviceMem2 = nullptr; }; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( - QueueUSMTestWithParam, +UUR_DEVICE_TEST_SUITE_WITH_QUEUE_TYPES_PRINTER( + QueueUSMTest, testing::Values(0, /* In-Order */ UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE), - uur::IntegrationQueueTestWithParam::paramPrinter); + uur::IntegrationQueueTest::paramPrinter); /* Submits multiple kernels that interact with each other by accessing and * writing to the same USM memory locations. @@ -68,16 +68,16 @@ UUR_DEVICE_TEST_SUITE_WITH_PARAM( * between calls to urEnqueueKernelLaunch. * Checks that when using an OUT_OF_ORDER queue, synchronizing using only * event barriers is enough. */ -TEST_P(QueueUSMTestWithParam, QueueUSMTest) { +TEST_P(QueueUSMTest, QueueUSMTest) { std::vector EventsFill; ur_event_handle_t Event; - ASSERT_SUCCESS(urEnqueueUSMFill(Queue, DeviceMem1, sizeof(uint32_t), + ASSERT_SUCCESS(urEnqueueUSMFill(queue, DeviceMem1, sizeof(uint32_t), &InitialValue, ArraySize * sizeof(uint32_t), 0, nullptr, &Event)); EventsFill.push_back(Event); - ASSERT_SUCCESS(urEnqueueUSMFill(Queue, DeviceMem2, sizeof(uint32_t), + ASSERT_SUCCESS(urEnqueueUSMFill(queue, DeviceMem2, sizeof(uint32_t), &InitialValue, ArraySize * sizeof(uint32_t), 0, nullptr, &Event)); EventsFill.push_back(Event); @@ -98,7 +98,7 @@ TEST_P(QueueUSMTestWithParam, QueueUSMTest) { ASSERT_SUCCESS(urKernelSetArgPointer(kernel, 0, nullptr, DeviceMem1)); ASSERT_SUCCESS(urKernelSetArgPointer(kernel, 1, nullptr, DeviceMem2)); - ASSERT_SUCCESS(urEnqueueKernelLaunch(Queue, kernel, NDimensions, + ASSERT_SUCCESS(urEnqueueKernelLaunch(queue, kernel, NDimensions, &GlobalOffset, &ArraySize, nullptr, nullptr, 0, nullptr, &Event)); ASSERT_NO_FATAL_FAILURE(submitBarrierIfNeeded(Event)); @@ -109,7 +109,7 @@ TEST_P(QueueUSMTestWithParam, QueueUSMTest) { ASSERT_SUCCESS(urKernelSetArgPointer(kernel, 0, nullptr, DeviceMem2)); ASSERT_SUCCESS(urKernelSetArgPointer(kernel, 1, nullptr, DeviceMem1)); - ASSERT_SUCCESS(urEnqueueKernelLaunch(Queue, kernel, NDimensions, + ASSERT_SUCCESS(urEnqueueKernelLaunch(queue, kernel, NDimensions, &GlobalOffset, &ArraySize, nullptr, nullptr, 0, nullptr, &Event)); ASSERT_NO_FATAL_FAILURE(submitBarrierIfNeeded(Event)); @@ -117,7 +117,7 @@ TEST_P(QueueUSMTestWithParam, QueueUSMTest) { CurValueMem1 = CurValueMem2 * 2; } - ASSERT_SUCCESS(urQueueFinish(Queue)); + ASSERT_SUCCESS(urQueueFinish(queue)); ASSERT_NO_FATAL_FAILURE(verifyResults(DeviceMem1, CurValueMem1)); ASSERT_NO_FATAL_FAILURE(verifyResults(DeviceMem2, CurValueMem2)); diff --git a/unified-runtime/test/conformance/integration/fixtures.h b/unified-runtime/test/conformance/integration/fixtures.h index 2dda212cf4db3..49095d786e8ea 100644 --- a/unified-runtime/test/conformance/integration/fixtures.h +++ b/unified-runtime/test/conformance/integration/fixtures.h @@ -11,16 +11,9 @@ namespace uur { -struct IntegrationQueueTestWithParam - : uur::urKernelExecutionTestWithParam { +struct IntegrationQueueTest : uur::urKernelExecutionTest { void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE( - uur::urKernelExecutionTestWithParam::SetUp()); - - QueueFlags = getParam(); - ur_queue_properties_t queue_properties = { - UR_STRUCTURE_TYPE_QUEUE_PROPERTIES, nullptr, QueueFlags}; - ASSERT_SUCCESS(urQueueCreate(context, device, &queue_properties, &Queue)); + UUR_RETURN_ON_FATAL_FAILURE(uur::urKernelExecutionTest::SetUp()); } void TearDown() override { @@ -28,28 +21,25 @@ struct IntegrationQueueTestWithParam ASSERT_SUCCESS(urEventRelease(Event)); } - UUR_RETURN_ON_FATAL_FAILURE( - uur::urKernelExecutionTestWithParam::TearDown()); + UUR_RETURN_ON_FATAL_FAILURE(uur::urKernelExecutionTest::TearDown()); } void submitBarrierIfNeeded(std::vector &(Events)) { - if (QueueFlags == UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE) { - ASSERT_SUCCESS(urEnqueueEventsWaitWithBarrier(Queue, Events.size(), + if (getQueueMode() == UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE) { + ASSERT_SUCCESS(urEnqueueEventsWaitWithBarrier(queue, Events.size(), Events.data(), nullptr)); AllEvents.insert(AllEvents.end(), Events.begin(), Events.end()); } } void submitBarrierIfNeeded(ur_event_handle_t Event) { - if (QueueFlags == UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE) { - ASSERT_SUCCESS(urEnqueueEventsWaitWithBarrier(Queue, 1, &Event, nullptr)); + if (getQueueMode() == UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE) { + ASSERT_SUCCESS(urEnqueueEventsWaitWithBarrier(queue, 1, &Event, nullptr)); AllEvents.push_back(Event); } } std::vector AllEvents; - ur_queue_flags_t QueueFlags{}; - ur_queue_handle_t Queue{}; static constexpr size_t ArraySize = 100; static constexpr uint32_t InitialValue = 100; @@ -57,14 +47,15 @@ struct IntegrationQueueTestWithParam const ::testing::TestParamInfo> &info) { auto device = std::get<0>(info.param).device; - auto param = std::get<1>(info.param); + auto queueMode = std::get<1>(info.param); std::stringstream ss; - if (param == 0) { + if (queueMode == 0) { ss << "IN_ORDER_QUEUE"; - } - if (param == UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE) { + } else if (queueMode == UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE) { ss << "OUT_OF_ORDER_QUEUE"; + } else { + ss << queueMode; } return uur::GetPlatformAndDeviceName(device) + "__" + ss.str(); diff --git a/unified-runtime/test/conformance/kernel/urKernelCreate.cpp b/unified-runtime/test/conformance/kernel/urKernelCreate.cpp index 1abeca86e1475..9fd27194d1ae3 100644 --- a/unified-runtime/test/conformance/kernel/urKernelCreate.cpp +++ b/unified-runtime/test/conformance/kernel/urKernelCreate.cpp @@ -26,7 +26,8 @@ struct urKernelCreateTest : uur::urProgramTest { std::string kernel_name; ur_kernel_handle_t kernel = nullptr; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelCreateTest); + +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urKernelCreateTest); TEST_P(urKernelCreateTest, Success) { ASSERT_SUCCESS(urKernelCreate(program, kernel_name.data(), &kernel)); diff --git a/unified-runtime/test/conformance/kernel/urKernelCreateWithNativeHandle.cpp b/unified-runtime/test/conformance/kernel/urKernelCreateWithNativeHandle.cpp index 7b6ea2df9da40..61f49a79108be 100644 --- a/unified-runtime/test/conformance/kernel/urKernelCreateWithNativeHandle.cpp +++ b/unified-runtime/test/conformance/kernel/urKernelCreateWithNativeHandle.cpp @@ -25,7 +25,7 @@ struct urKernelCreateWithNativeHandleTest : uur::urKernelTest { false /*isNativeHandleOwned*/ }; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelCreateWithNativeHandleTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urKernelCreateWithNativeHandleTest); TEST_P(urKernelCreateWithNativeHandleTest, Success) { UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urKernelCreateWithNativeHandle( diff --git a/unified-runtime/test/conformance/kernel/urKernelGetGroupInfo.cpp b/unified-runtime/test/conformance/kernel/urKernelGetGroupInfo.cpp index 3d842643b1b7b..6ec0dafbb9cea 100644 --- a/unified-runtime/test/conformance/kernel/urKernelGetGroupInfo.cpp +++ b/unified-runtime/test/conformance/kernel/urKernelGetGroupInfo.cpp @@ -20,7 +20,8 @@ struct urKernelGetGroupInfoFixedWorkGroupSizeTest : uur::urKernelTest { // In UR, this is on the left, so we reverse the order of these values. std::array work_group_size{2, 4, 8}; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelGetGroupInfoFixedWorkGroupSizeTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE( + urKernelGetGroupInfoFixedWorkGroupSizeTest); TEST_P(urKernelGetGroupInfoFixedWorkGroupSizeTest, SuccessCompileWorkGroupSize) { @@ -60,7 +61,8 @@ struct urKernelGetGroupInfoMaxWorkGroupSizeTest : uur::urKernelTest { std::array max_work_group_size{2, 4, 8}; size_t max_linear_work_group_size{64}; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelGetGroupInfoMaxWorkGroupSizeTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE( + urKernelGetGroupInfoMaxWorkGroupSizeTest); TEST_P(urKernelGetGroupInfoMaxWorkGroupSizeTest, SuccessCompileMaxWorkGroupSize) { @@ -102,7 +104,7 @@ TEST_P(urKernelGetGroupInfoMaxWorkGroupSizeTest, } using urKernelGetGroupInfoTest = uur::urKernelTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelGetGroupInfoTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urKernelGetGroupInfoTest); TEST_P(urKernelGetGroupInfoTest, SuccessGlobalWorkSize) { const ur_kernel_group_info_t property_name = diff --git a/unified-runtime/test/conformance/kernel/urKernelGetInfo.cpp b/unified-runtime/test/conformance/kernel/urKernelGetInfo.cpp index 0b37ea27ede34..8f21a3832634d 100644 --- a/unified-runtime/test/conformance/kernel/urKernelGetInfo.cpp +++ b/unified-runtime/test/conformance/kernel/urKernelGetInfo.cpp @@ -9,7 +9,7 @@ #include using urKernelGetInfoTest = uur::urKernelTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelGetInfoTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urKernelGetInfoTest); TEST_P(urKernelGetInfoTest, SuccessFunctionName) { const ur_kernel_info_t property_name = UR_KERNEL_INFO_FUNCTION_NAME; diff --git a/unified-runtime/test/conformance/kernel/urKernelGetNativeHandle.cpp b/unified-runtime/test/conformance/kernel/urKernelGetNativeHandle.cpp index e82ca52e02b6d..d31d234c4b8fb 100644 --- a/unified-runtime/test/conformance/kernel/urKernelGetNativeHandle.cpp +++ b/unified-runtime/test/conformance/kernel/urKernelGetNativeHandle.cpp @@ -7,7 +7,7 @@ #include using urKernelGetNativeHandleTest = uur::urKernelTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelGetNativeHandleTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urKernelGetNativeHandleTest); TEST_P(urKernelGetNativeHandleTest, Success) { ur_native_handle_t native_kernel_handle = 0; diff --git a/unified-runtime/test/conformance/kernel/urKernelGetSubGroupInfo.cpp b/unified-runtime/test/conformance/kernel/urKernelGetSubGroupInfo.cpp index 7ad68b9e3f8d6..d1a7d21b19497 100644 --- a/unified-runtime/test/conformance/kernel/urKernelGetSubGroupInfo.cpp +++ b/unified-runtime/test/conformance/kernel/urKernelGetSubGroupInfo.cpp @@ -20,7 +20,8 @@ struct urKernelGetSubGroupInfoFixedSubGroupSizeTest : uur::urKernelTest { // This value correlates to sub_group_size<8> in fixed_sg_size.cpp. uint32_t num_sub_groups{8}; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelGetSubGroupInfoFixedSubGroupSizeTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE( + urKernelGetSubGroupInfoFixedSubGroupSizeTest); TEST_P(urKernelGetSubGroupInfoFixedSubGroupSizeTest, SuccessCompileNumSubGroups) { @@ -46,7 +47,7 @@ TEST_P(urKernelGetSubGroupInfoFixedSubGroupSizeTest, struct urKernelGetSubGroupInfoTest : uur::urKernelTest { void SetUp() override { UUR_RETURN_ON_FATAL_FAILURE(urKernelTest::SetUp()); } }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelGetSubGroupInfoTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urKernelGetSubGroupInfoTest); TEST_P(urKernelGetSubGroupInfoTest, SuccessMaxSubGroupSize) { const ur_kernel_sub_group_info_t property_name = diff --git a/unified-runtime/test/conformance/kernel/urKernelRelease.cpp b/unified-runtime/test/conformance/kernel/urKernelRelease.cpp index 5ccda8843766e..7d504e6b42b5f 100644 --- a/unified-runtime/test/conformance/kernel/urKernelRelease.cpp +++ b/unified-runtime/test/conformance/kernel/urKernelRelease.cpp @@ -7,7 +7,7 @@ #include using urKernelReleaseTest = uur::urKernelTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelReleaseTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urKernelReleaseTest); TEST_P(urKernelReleaseTest, Success) { ASSERT_SUCCESS(urKernelRetain(kernel)); diff --git a/unified-runtime/test/conformance/kernel/urKernelRetain.cpp b/unified-runtime/test/conformance/kernel/urKernelRetain.cpp index 221e03864416c..a32dc722a0a32 100644 --- a/unified-runtime/test/conformance/kernel/urKernelRetain.cpp +++ b/unified-runtime/test/conformance/kernel/urKernelRetain.cpp @@ -8,7 +8,7 @@ #include using urKernelRetainTest = uur::urKernelTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelRetainTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urKernelRetainTest); TEST_P(urKernelRetainTest, Success) { ASSERT_SUCCESS(urKernelRetain(kernel)); diff --git a/unified-runtime/test/conformance/kernel/urKernelSetArgLocal.cpp b/unified-runtime/test/conformance/kernel/urKernelSetArgLocal.cpp index 49971f1e7cc62..6439d1cd7bb18 100644 --- a/unified-runtime/test/conformance/kernel/urKernelSetArgLocal.cpp +++ b/unified-runtime/test/conformance/kernel/urKernelSetArgLocal.cpp @@ -15,7 +15,7 @@ struct urKernelSetArgLocalTest : uur::urKernelTest { } size_t local_mem_size = 4 * sizeof(uint32_t); }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelSetArgLocalTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urKernelSetArgLocalTest); TEST_P(urKernelSetArgLocalTest, Success) { ASSERT_SUCCESS(urKernelSetArgLocal(kernel, 1, local_mem_size, nullptr)); @@ -147,7 +147,7 @@ struct urKernelSetArgLocalMultiTest : uur::urKernelExecutionTest { static constexpr uint64_t hip_local_offset = 0; ur_backend_t backend{}; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelSetArgLocalMultiTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urKernelSetArgLocalMultiTest); TEST_P(urKernelSetArgLocalMultiTest, Basic) { ASSERT_SUCCESS(urEnqueueKernelLaunch( diff --git a/unified-runtime/test/conformance/kernel/urKernelSetArgMemObj.cpp b/unified-runtime/test/conformance/kernel/urKernelSetArgMemObj.cpp index aa06eaadc8ba5..3055f0a3b8c21 100644 --- a/unified-runtime/test/conformance/kernel/urKernelSetArgMemObj.cpp +++ b/unified-runtime/test/conformance/kernel/urKernelSetArgMemObj.cpp @@ -25,7 +25,7 @@ struct urKernelSetArgMemObjTest : uur::urKernelTest { ur_mem_handle_t buffer = nullptr; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelSetArgMemObjTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urKernelSetArgMemObjTest); TEST_P(urKernelSetArgMemObjTest, Success) { ASSERT_SUCCESS(urKernelSetArgMemObj(kernel, 0, nullptr, buffer)); diff --git a/unified-runtime/test/conformance/kernel/urKernelSetArgPointer.cpp b/unified-runtime/test/conformance/kernel/urKernelSetArgPointer.cpp index 23e5f6c0d0709..28c1c2c92eaa2 100644 --- a/unified-runtime/test/conformance/kernel/urKernelSetArgPointer.cpp +++ b/unified-runtime/test/conformance/kernel/urKernelSetArgPointer.cpp @@ -31,7 +31,7 @@ struct urKernelSetArgPointerTest : uur::urKernelExecutionTest { size_t allocation_size = array_size * sizeof(uint32_t); uint32_t data = 42; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelSetArgPointerTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urKernelSetArgPointerTest); TEST_P(urKernelSetArgPointerTest, SuccessHost) { ur_device_usm_access_capability_flags_t host_usm_flags = 0; diff --git a/unified-runtime/test/conformance/kernel/urKernelSetArgSampler.cpp b/unified-runtime/test/conformance/kernel/urKernelSetArgSampler.cpp index 6d969d8ac9835..5b4c2b26be53a 100644 --- a/unified-runtime/test/conformance/kernel/urKernelSetArgSampler.cpp +++ b/unified-runtime/test/conformance/kernel/urKernelSetArgSampler.cpp @@ -61,7 +61,7 @@ struct urKernelSetArgSamplerTestWithParam ur_sampler_handle_t sampler = nullptr; }; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urKernelSetArgSamplerTestWithParam, ::testing::Combine( ::testing::Values(true, false), @@ -72,7 +72,7 @@ UUR_DEVICE_TEST_SUITE_WITH_PARAM( UR_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT), ::testing::Values(UR_SAMPLER_FILTER_MODE_NEAREST, UR_SAMPLER_FILTER_MODE_LINEAR)), - uur::deviceTestWithParamPrinter); + uur::deviceTestWithParamPrinterMulti); TEST_P(urKernelSetArgSamplerTestWithParam, Success) { uint32_t arg_index = 2; @@ -86,7 +86,7 @@ struct urKernelSetArgSamplerTest : uur::urBaseKernelTest { // the non-existant image_copy kernel) bool image_support = false; ASSERT_SUCCESS( - uur::GetDeviceImageSupport(GetParam().device, image_support)); + uur::GetDeviceImageSupport(getParam().device, image_support)); if (!image_support) { GTEST_SKIP() << "Device doesn't support images"; } @@ -123,7 +123,7 @@ struct urKernelSetArgSamplerTest : uur::urBaseKernelTest { ur_sampler_handle_t sampler = nullptr; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelSetArgSamplerTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urKernelSetArgSamplerTest); TEST_P(urKernelSetArgSamplerTest, SuccessWithProps) { ur_kernel_arg_sampler_properties_t props{ diff --git a/unified-runtime/test/conformance/kernel/urKernelSetArgValue.cpp b/unified-runtime/test/conformance/kernel/urKernelSetArgValue.cpp index 6a6b66520e66b..8126aa9a189bf 100644 --- a/unified-runtime/test/conformance/kernel/urKernelSetArgValue.cpp +++ b/unified-runtime/test/conformance/kernel/urKernelSetArgValue.cpp @@ -15,7 +15,7 @@ struct urKernelSetArgValueTest : uur::urKernelTest { uint32_t arg_value = 42; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelSetArgValueTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urKernelSetArgValueTest); TEST_P(urKernelSetArgValueTest, Success) { ASSERT_SUCCESS( diff --git a/unified-runtime/test/conformance/kernel/urKernelSetExecInfo.cpp b/unified-runtime/test/conformance/kernel/urKernelSetExecInfo.cpp index 1d3591f696970..6ec3a6adeb475 100644 --- a/unified-runtime/test/conformance/kernel/urKernelSetExecInfo.cpp +++ b/unified-runtime/test/conformance/kernel/urKernelSetExecInfo.cpp @@ -8,7 +8,7 @@ #include using urKernelSetExecInfoTest = uur::urKernelTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelSetExecInfoTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urKernelSetExecInfoTest); TEST_P(urKernelSetExecInfoTest, SuccessIndirectAccess) { UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); @@ -59,7 +59,7 @@ struct urKernelSetExecInfoUSMPointersTest : uur::urKernelTest { size_t allocation_size = 16; void *allocation = nullptr; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelSetExecInfoUSMPointersTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urKernelSetExecInfoUSMPointersTest); TEST_P(urKernelSetExecInfoUSMPointersTest, SuccessHost) { UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); @@ -119,12 +119,12 @@ TEST_P(urKernelSetExecInfoUSMPointersTest, SuccessShared) { using urKernelSetExecInfoCacheConfigTest = uur::urKernelTestWithParam; -UUR_DEVICE_TEST_SUITE_WITH_PARAM( +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( urKernelSetExecInfoCacheConfigTest, ::testing::Values(UR_KERNEL_CACHE_CONFIG_DEFAULT, UR_KERNEL_CACHE_CONFIG_LARGE_SLM, UR_KERNEL_CACHE_CONFIG_LARGE_DATA), - uur::deviceTestWithParamPrinter); + uur::deviceTestWithParamPrinterMulti); TEST_P(urKernelSetExecInfoCacheConfigTest, Success) { auto property_value = getParam(); diff --git a/unified-runtime/test/conformance/kernel/urKernelSetSpecializationConstants.cpp b/unified-runtime/test/conformance/kernel/urKernelSetSpecializationConstants.cpp index 07f58b48fc586..a91fef3532a21 100644 --- a/unified-runtime/test/conformance/kernel/urKernelSetSpecializationConstants.cpp +++ b/unified-runtime/test/conformance/kernel/urKernelSetSpecializationConstants.cpp @@ -24,7 +24,8 @@ struct urKernelSetSpecializationConstantsTest : uur::urBaseKernelExecutionTest { uint32_t spec_value = 42; ur_specialization_constant_info_t info = {0, sizeof(spec_value), &spec_value}; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelSetSpecializationConstantsTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE( + urKernelSetSpecializationConstantsTest); struct urKernelSetSpecializationConstantsNegativeTest : uur::urBaseKernelExecutionTest { @@ -44,7 +45,7 @@ struct urKernelSetSpecializationConstantsNegativeTest uint32_t spec_value = 42; ur_specialization_constant_info_t info = {0, sizeof(spec_value), &spec_value}; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE( +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE( urKernelSetSpecializationConstantsNegativeTest); TEST_P(urKernelSetSpecializationConstantsTest, Success) { diff --git a/unified-runtime/test/conformance/kernel/urKernelSuggestMaxCooperativeGroupCount.cpp b/unified-runtime/test/conformance/kernel/urKernelSuggestMaxCooperativeGroupCount.cpp index a7a948f6d17d3..d95f3d095becc 100644 --- a/unified-runtime/test/conformance/kernel/urKernelSuggestMaxCooperativeGroupCount.cpp +++ b/unified-runtime/test/conformance/kernel/urKernelSuggestMaxCooperativeGroupCount.cpp @@ -27,7 +27,9 @@ struct urKernelSuggestMaxCooperativeGroupCountTest const uint32_t n_dimensions = 1; const size_t local_size = 1; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urKernelSuggestMaxCooperativeGroupCountTest); + +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE( + urKernelSuggestMaxCooperativeGroupCountTest); TEST_P(urKernelSuggestMaxCooperativeGroupCountTest, Success) { ASSERT_SUCCESS(urKernelSuggestMaxCooperativeGroupCount( diff --git a/unified-runtime/test/conformance/program/urProgramBuild.cpp b/unified-runtime/test/conformance/program/urProgramBuild.cpp index 19cadf08cf522..45eab4f36d315 100644 --- a/unified-runtime/test/conformance/program/urProgramBuild.cpp +++ b/unified-runtime/test/conformance/program/urProgramBuild.cpp @@ -8,7 +8,7 @@ #include using urProgramBuildTest = uur::urProgramTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urProgramBuildTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urProgramBuildTest); TEST_P(urProgramBuildTest, Success) { ASSERT_SUCCESS(urProgramBuild(context, program, nullptr)); diff --git a/unified-runtime/test/conformance/program/urProgramCompile.cpp b/unified-runtime/test/conformance/program/urProgramCompile.cpp index c70641500f826..b0c76b0ece543 100644 --- a/unified-runtime/test/conformance/program/urProgramCompile.cpp +++ b/unified-runtime/test/conformance/program/urProgramCompile.cpp @@ -8,9 +8,10 @@ using urProgramCompileWithParamTest = uur::urProgramTestWithParam; -UUR_DEVICE_TEST_SUITE_WITH_PARAM(urProgramCompileWithParamTest, - ::testing::Values("-O0", "-O1", "-O2", "-O3"), - uur::deviceTestWithParamPrinter); +UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM( + urProgramCompileWithParamTest, + ::testing::Values("-O0", "-O1", "-O2", "-O3"), + uur::deviceTestWithParamPrinterMulti); TEST_P(urProgramCompileWithParamTest, Success) { const char *platformOption = nullptr; @@ -21,7 +22,7 @@ TEST_P(urProgramCompileWithParamTest, Success) { } using urProgramCompileTest = uur::urProgramTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urProgramCompileTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urProgramCompileTest); TEST_P(urProgramCompileTest, Success) { ASSERT_SUCCESS(urProgramCompile(context, program, nullptr)); diff --git a/unified-runtime/test/conformance/program/urProgramCreateWithBinary.cpp b/unified-runtime/test/conformance/program/urProgramCreateWithBinary.cpp index bd3a6b8870493..ae6e733876c11 100644 --- a/unified-runtime/test/conformance/program/urProgramCreateWithBinary.cpp +++ b/unified-runtime/test/conformance/program/urProgramCreateWithBinary.cpp @@ -35,7 +35,8 @@ struct urProgramCreateWithBinaryTest : uur::urProgramTest { std::vector binary; ur_program_handle_t binary_program = nullptr; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urProgramCreateWithBinaryTest); + +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urProgramCreateWithBinaryTest); TEST_P(urProgramCreateWithBinaryTest, Success) { auto size = binary.size(); diff --git a/unified-runtime/test/conformance/program/urProgramCreateWithNativeHandle.cpp b/unified-runtime/test/conformance/program/urProgramCreateWithNativeHandle.cpp index 3e0d178c8814d..a2705fec675ef 100644 --- a/unified-runtime/test/conformance/program/urProgramCreateWithNativeHandle.cpp +++ b/unified-runtime/test/conformance/program/urProgramCreateWithNativeHandle.cpp @@ -33,7 +33,8 @@ struct urProgramCreateWithNativeHandleTest : uur::urProgramTest { ur_native_handle_t native_program_handle = 0; ur_program_handle_t native_program = nullptr; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urProgramCreateWithNativeHandleTest); + +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urProgramCreateWithNativeHandleTest); TEST_P(urProgramCreateWithNativeHandleTest, Success) { UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urProgramCreateWithNativeHandle( diff --git a/unified-runtime/test/conformance/program/urProgramGetBuildInfo.cpp b/unified-runtime/test/conformance/program/urProgramGetBuildInfo.cpp index a01e4251828c0..5bd6c8e840df7 100644 --- a/unified-runtime/test/conformance/program/urProgramGetBuildInfo.cpp +++ b/unified-runtime/test/conformance/program/urProgramGetBuildInfo.cpp @@ -13,7 +13,8 @@ struct urProgramGetBuildInfoTest : uur::urProgramTest { ASSERT_SUCCESS(urProgramBuild(this->context, program, nullptr)); } }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urProgramGetBuildInfoTest); + +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urProgramGetBuildInfoTest); TEST_P(urProgramGetBuildInfoTest, SuccessStatus) { UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{}); diff --git a/unified-runtime/test/conformance/program/urProgramGetFunctionPointer.cpp b/unified-runtime/test/conformance/program/urProgramGetFunctionPointer.cpp index 83906dc9db453..3e36df30907d4 100644 --- a/unified-runtime/test/conformance/program/urProgramGetFunctionPointer.cpp +++ b/unified-runtime/test/conformance/program/urProgramGetFunctionPointer.cpp @@ -18,7 +18,8 @@ struct urProgramGetFunctionPointerTest : uur::urProgramTest { std::string function_name; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urProgramGetFunctionPointerTest); + +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urProgramGetFunctionPointerTest); TEST_P(urProgramGetFunctionPointerTest, Success) { void *function_pointer = nullptr; diff --git a/unified-runtime/test/conformance/program/urProgramGetGlobalVariablePointer.cpp b/unified-runtime/test/conformance/program/urProgramGetGlobalVariablePointer.cpp index b638d96cf3634..20f643d448927 100644 --- a/unified-runtime/test/conformance/program/urProgramGetGlobalVariablePointer.cpp +++ b/unified-runtime/test/conformance/program/urProgramGetGlobalVariablePointer.cpp @@ -8,7 +8,7 @@ using urProgramGetGlobalVariablePointerTest = uur::urGlobalVariableTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urProgramGetGlobalVariablePointerTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urProgramGetGlobalVariablePointerTest); TEST_P(urProgramGetGlobalVariablePointerTest, Success) { size_t global_variable_size = 0; diff --git a/unified-runtime/test/conformance/program/urProgramGetInfo.cpp b/unified-runtime/test/conformance/program/urProgramGetInfo.cpp index 27fda5c804f97..d01bb75eede88 100644 --- a/unified-runtime/test/conformance/program/urProgramGetInfo.cpp +++ b/unified-runtime/test/conformance/program/urProgramGetInfo.cpp @@ -15,7 +15,7 @@ struct urProgramGetInfoTest : uur::urProgramTest { } }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urProgramGetInfoTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urProgramGetInfoTest); TEST_P(urProgramGetInfoTest, SuccessReferenceCount) { size_t property_size = 0; diff --git a/unified-runtime/test/conformance/program/urProgramGetNativeHandle.cpp b/unified-runtime/test/conformance/program/urProgramGetNativeHandle.cpp index f836a83d9821e..25f8e6c1bf492 100644 --- a/unified-runtime/test/conformance/program/urProgramGetNativeHandle.cpp +++ b/unified-runtime/test/conformance/program/urProgramGetNativeHandle.cpp @@ -7,7 +7,7 @@ #include using urProgramGetNativeHandleTest = uur::urProgramTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urProgramGetNativeHandleTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urProgramGetNativeHandleTest); TEST_P(urProgramGetNativeHandleTest, Success) { ur_backend_t backend; diff --git a/unified-runtime/test/conformance/program/urProgramLink.cpp b/unified-runtime/test/conformance/program/urProgramLink.cpp index 0d6a3e666559d..bb3ffce050340 100644 --- a/unified-runtime/test/conformance/program/urProgramLink.cpp +++ b/unified-runtime/test/conformance/program/urProgramLink.cpp @@ -30,7 +30,7 @@ struct urProgramLinkTest : uur::urProgramTest { ur_program_handle_t linked_program = nullptr; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urProgramLinkTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urProgramLinkTest); TEST_P(urProgramLinkTest, Success) { // This entry point isn't implemented for HIP. @@ -77,11 +77,11 @@ TEST_P(urProgramLinkTest, SetOutputOnZeroCount) { reinterpret_cast(&invalid_pointer)); } -struct urProgramLinkErrorTest : uur::urQueueTest { +struct urProgramLinkErrorTest : uur::urMultiQueueTypeTest { const std::string linker_error_program_name = "linker_error"; void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTest::SetUp()); // TODO: This should use a query for urProgramCreateWithIL support or // rely on UR_RESULT_ERROR_UNSUPPORTED_FEATURE being returned. ur_backend_t backend; @@ -112,13 +112,13 @@ struct urProgramLinkErrorTest : uur::urQueueTest { if (linked_program) { EXPECT_SUCCESS(urProgramRelease(linked_program)); } - UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::TearDown()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTest::TearDown()); } ur_program_handle_t program = nullptr; ur_program_handle_t linked_program = nullptr; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urProgramLinkErrorTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urProgramLinkErrorTest); TEST_P(urProgramLinkErrorTest, LinkFailure) { ASSERT_EQ_RESULT( diff --git a/unified-runtime/test/conformance/program/urProgramRelease.cpp b/unified-runtime/test/conformance/program/urProgramRelease.cpp index e58b17883ea60..32fdbe04420ca 100644 --- a/unified-runtime/test/conformance/program/urProgramRelease.cpp +++ b/unified-runtime/test/conformance/program/urProgramRelease.cpp @@ -7,7 +7,7 @@ #include using urProgramReleaseTest = uur::urProgramTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urProgramReleaseTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urProgramReleaseTest); TEST_P(urProgramReleaseTest, Success) { ASSERT_SUCCESS(urProgramRetain(program)); diff --git a/unified-runtime/test/conformance/program/urProgramRetain.cpp b/unified-runtime/test/conformance/program/urProgramRetain.cpp index 623dddf23bed3..4c82077160109 100644 --- a/unified-runtime/test/conformance/program/urProgramRetain.cpp +++ b/unified-runtime/test/conformance/program/urProgramRetain.cpp @@ -7,7 +7,7 @@ #include using urProgramRetainTest = uur::urProgramTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urProgramRetainTest); +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urProgramRetainTest); TEST_P(urProgramRetainTest, Success) { uint32_t prevRefCount = 0; diff --git a/unified-runtime/test/conformance/program/urProgramSetSpecializationConstants.cpp b/unified-runtime/test/conformance/program/urProgramSetSpecializationConstants.cpp index b3d25a66fb02c..824f1cb08f7ff 100644 --- a/unified-runtime/test/conformance/program/urProgramSetSpecializationConstants.cpp +++ b/unified-runtime/test/conformance/program/urProgramSetSpecializationConstants.cpp @@ -26,7 +26,8 @@ struct urProgramSetSpecializationConstantsTest : uur::urKernelExecutionTest { uint32_t default_spec_value = 1000; // Must match the one in the SYCL source ur_specialization_constant_info_t info = {0, sizeof(spec_value), &spec_value}; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urProgramSetSpecializationConstantsTest); +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE( + urProgramSetSpecializationConstantsTest); struct urProgramSetSpecializationConstantsNegativeTest : uur::urKernelExecutionTest { @@ -48,7 +49,7 @@ struct urProgramSetSpecializationConstantsNegativeTest uint32_t default_spec_value = 1000; // Must match the one in the SYCL source ur_specialization_constant_info_t info = {0, sizeof(spec_value), &spec_value}; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE( +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE( urProgramSetSpecializationConstantsNegativeTest); struct urProgramSetMultipleSpecializationConstantsTest @@ -68,7 +69,7 @@ struct urProgramSetMultipleSpecializationConstantsTest } } }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE( +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE( urProgramSetMultipleSpecializationConstantsTest); TEST_P(urProgramSetSpecializationConstantsTest, Success) { diff --git a/unified-runtime/test/conformance/queue/urQueueCreateWithNativeHandle.cpp b/unified-runtime/test/conformance/queue/urQueueCreateWithNativeHandle.cpp index d86f99e0bc3d0..6fcb75541d27d 100644 --- a/unified-runtime/test/conformance/queue/urQueueCreateWithNativeHandle.cpp +++ b/unified-runtime/test/conformance/queue/urQueueCreateWithNativeHandle.cpp @@ -5,8 +5,9 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -using urQueueCreateWithNativeHandleTest = uur::urQueueTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urQueueCreateWithNativeHandleTest); +using urQueueCreateWithNativeHandleTest = uur::urMultiQueueTypeTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE( + urQueueCreateWithNativeHandleTest); TEST_P(urQueueCreateWithNativeHandleTest, Success) { ur_native_handle_t native_handle = 0; diff --git a/unified-runtime/test/conformance/queue/urQueueFinish.cpp b/unified-runtime/test/conformance/queue/urQueueFinish.cpp index e77fefb81d362..6e10814d1a063 100644 --- a/unified-runtime/test/conformance/queue/urQueueFinish.cpp +++ b/unified-runtime/test/conformance/queue/urQueueFinish.cpp @@ -7,8 +7,8 @@ #include "uur/fixtures.h" #include "uur/raii.h" -using urQueueFinishTest = uur::urQueueTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urQueueFinishTest); +using urQueueFinishTest = uur::urMultiQueueTypeTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urQueueFinishTest); TEST_P(urQueueFinishTest, Success) { constexpr size_t buffer_size = 1024; diff --git a/unified-runtime/test/conformance/queue/urQueueFlush.cpp b/unified-runtime/test/conformance/queue/urQueueFlush.cpp index d3cafd472fdbb..83a8d66b73d26 100644 --- a/unified-runtime/test/conformance/queue/urQueueFlush.cpp +++ b/unified-runtime/test/conformance/queue/urQueueFlush.cpp @@ -8,8 +8,8 @@ #include "uur/known_failure.h" #include "uur/raii.h" -using urQueueFlushTest = uur::urQueueTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urQueueFlushTest); +using urQueueFlushTest = uur::urMultiQueueTypeTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urQueueFlushTest); TEST_P(urQueueFlushTest, Success) { UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); diff --git a/unified-runtime/test/conformance/queue/urQueueGetNativeHandle.cpp b/unified-runtime/test/conformance/queue/urQueueGetNativeHandle.cpp index c0652df1fc04f..522d7f0d99e16 100644 --- a/unified-runtime/test/conformance/queue/urQueueGetNativeHandle.cpp +++ b/unified-runtime/test/conformance/queue/urQueueGetNativeHandle.cpp @@ -5,8 +5,8 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -using urQueueGetNativeHandleTest = uur::urQueueTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urQueueGetNativeHandleTest); +using urQueueGetNativeHandleTest = uur::urMultiQueueTypeTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urQueueGetNativeHandleTest); TEST_P(urQueueGetNativeHandleTest, Success) { ur_native_handle_t native_handle = 0; diff --git a/unified-runtime/test/conformance/queue/urQueueRelease.cpp b/unified-runtime/test/conformance/queue/urQueueRelease.cpp index 867dd9e63c336..ffdee9a46c489 100644 --- a/unified-runtime/test/conformance/queue/urQueueRelease.cpp +++ b/unified-runtime/test/conformance/queue/urQueueRelease.cpp @@ -6,8 +6,8 @@ #include #include -using urQueueReleaseTest = uur::urQueueTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urQueueReleaseTest); +using urQueueReleaseTest = uur::urMultiQueueTypeTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urQueueReleaseTest); TEST_P(urQueueReleaseTest, Success) { UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); diff --git a/unified-runtime/test/conformance/queue/urQueueRetain.cpp b/unified-runtime/test/conformance/queue/urQueueRetain.cpp index b75a08a2c791e..e934aac6c4e04 100644 --- a/unified-runtime/test/conformance/queue/urQueueRetain.cpp +++ b/unified-runtime/test/conformance/queue/urQueueRetain.cpp @@ -6,8 +6,8 @@ #include #include -using urQueueRetainTest = uur::urQueueTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urQueueRetainTest); +using urQueueRetainTest = uur::urMultiQueueTypeTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(urQueueRetainTest); TEST_P(urQueueRetainTest, Success) { UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); diff --git a/unified-runtime/test/conformance/testing/include/uur/fixtures.h b/unified-runtime/test/conformance/testing/include/uur/fixtures.h index 087a039934b2a..5dae5805793e9 100644 --- a/unified-runtime/test/conformance/testing/include/uur/fixtures.h +++ b/unified-runtime/test/conformance/testing/include/uur/fixtures.h @@ -9,6 +9,7 @@ #include "ur_api.h" +#include "gtest/gtest.h" #include #include #include @@ -115,22 +116,30 @@ struct urAllDevicesTest : urPlatformTest { std::vector devices; }; -struct urDeviceTest : ::testing::Test, - ::testing::WithParamInterface { +struct urDeviceTest + : ::testing::Test, + ::testing::WithParamInterface> { void SetUp() override { - device = GetParam().device; - platform = GetParam().platform; - adapter = GetParam().adapter; + auto paramDeviceTuple = std::get<0>(GetParam()); + + device = paramDeviceTuple.device; + platform = paramDeviceTuple.platform; + adapter = paramDeviceTuple.adapter; UUR_RETURN_ON_FATAL_FAILURE(checkBlacklisted(platform)); } + const DeviceTuple &getParam() { return std::get<0>(GetParam()); } + ur_device_handle_t device = nullptr; ur_platform_handle_t platform = nullptr; ur_adapter_handle_t adapter = nullptr; }; } // namespace uur +inline ur_queue_flag_t queueModes[2] = {UR_QUEUE_FLAG_SUBMISSION_BATCHED, + UR_QUEUE_FLAG_SUBMISSION_IMMEDIATE}; + #define UUR_INSTANTIATE_ADAPTER_TEST_SUITE(FIXTURE) \ INSTANTIATE_TEST_SUITE_P( \ , FIXTURE, \ @@ -150,11 +159,22 @@ struct urDeviceTest : ::testing::Test, #define UUR_INSTANTIATE_DEVICE_TEST_SUITE(FIXTURE) \ INSTANTIATE_TEST_SUITE_P( \ , FIXTURE, \ - ::testing::ValuesIn(uur::DevicesEnvironment::instance->devices), \ - [](const ::testing::TestParamInfo &info) { \ - return uur::GetPlatformAndDeviceName(info.param.device); \ + testing::Combine( \ + ::testing::ValuesIn(uur::DevicesEnvironment::instance->devices), \ + ::testing::Values(0)), \ + [](const ::testing::TestParamInfo< \ + std::tuple> &info) { \ + return uur::GetPlatformAndDeviceName(std::get<0>(info.param).device); \ }) +#define UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(FIXTURE) \ + INSTANTIATE_TEST_SUITE_P( \ + , FIXTURE, \ + testing::Combine( \ + ::testing::ValuesIn(uur::DevicesEnvironment::instance->devices), \ + ::testing::ValuesIn(queueModes)), \ + uur::devicePrinter) + namespace uur { template @@ -337,6 +357,33 @@ struct urMemImageTest : urContextTest { VALUES), \ PRINTER) +// UR_QUEUE_FLAG_SUBMISSION_IMMEDIATE in params +#define UUR_MULTI_QUEUE_TYPE_TEST_SUITE_WITH_PARAM(FIXTURE, VALUES, PRINTER) \ + UUR_DEVICE_TEST_SUITE_WITH_PARAM( \ + FIXTURE, testing::Combine(VALUES, ::testing::ValuesIn(queueModes)), \ + PRINTER) + +#define UUR_DEVICE_TEST_SUITE_WITH_QUEUE_TYPES(FIXTURE, MODES) \ + INSTANTIATE_TEST_SUITE_P( \ + , FIXTURE, \ + testing::Combine( \ + ::testing::ValuesIn(uur::DevicesEnvironment::instance->devices), \ + MODES), \ + uur::devicePrinter) + +#define UUR_DEVICE_TEST_SUITE_WITH_QUEUE_TYPES_PRINTER(FIXTURE, MODES, \ + PRINTER) \ + INSTANTIATE_TEST_SUITE_P( \ + , FIXTURE, \ + testing::Combine( \ + ::testing::ValuesIn(uur::DevicesEnvironment::instance->devices), \ + MODES), \ + PRINTER) + +#define UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(FIXTURE) \ + UUR_DEVICE_TEST_SUITE_WITH_QUEUE_TYPES( \ + FIXTURE, ::testing::Values((ur_queue_flag_t)0)) + namespace uur { template struct urContextTestWithParam : urDeviceTestWithParam { @@ -409,12 +456,35 @@ struct urQueueTest : urContextTest { ur_queue_handle_t queue = nullptr; }; -struct urHostPipeTest : urQueueTest { +struct urMultiQueueTypeTest : urContextTest { + void SetUp() override { + UUR_RETURN_ON_FATAL_FAILURE(urContextTest::SetUp()); + + ur_queue_flag_t queueMode = std::get<1>(GetParam()); + ur_queue_properties_t queue_properties = { + UR_STRUCTURE_TYPE_QUEUE_PROPERTIES, nullptr, queueMode}; + ASSERT_SUCCESS(urQueueCreate(context, device, &queue_properties, &queue)); + ASSERT_NE(queue, nullptr); + } + + void TearDown() override { + if (queue) { + EXPECT_SUCCESS(urQueueRelease(queue)); + } + UUR_RETURN_ON_FATAL_FAILURE(urContextTest::TearDown()); + } + + ur_queue_flag_t getQueueMode() { return std::get<1>(GetParam()); } + + ur_queue_handle_t queue = nullptr; +}; + +struct urHostPipeTest : urMultiQueueTypeTest { void SetUp() override { // 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()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTest::SetUp()); size_t size = 0; ASSERT_SUCCESS(urDeviceGetInfo(device, @@ -446,7 +516,7 @@ struct urHostPipeTest : urQueueTest { if (program) { EXPECT_SUCCESS(urProgramRelease(program)); } - UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::TearDown()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTest::TearDown()); } std::shared_ptr> il_binary; @@ -480,10 +550,48 @@ template struct urQueueTestWithParam : urContextTestWithParam { ur_queue_handle_t queue = nullptr; }; +template using MultiQueueParam = std::tuple; + +template +struct urMultiQueueTypeTestWithParam + : urContextTestWithParam> { + using urContextTestWithParam>::device; + using urContextTestWithParam>::context; + + void SetUp() override { + UUR_RETURN_ON_FATAL_FAILURE( + urContextTestWithParam>::SetUp()); + + ur_queue_properties_t queue_properties = { + UR_STRUCTURE_TYPE_QUEUE_PROPERTIES, nullptr, this->getQueueFlag()}; + + ASSERT_SUCCESS(urQueueCreate(context, device, &queue_properties, &queue)); + ASSERT_NE(queue, nullptr); + } + + void TearDown() override { + if (queue) { + EXPECT_SUCCESS(urQueueRelease(queue)); + } + UUR_RETURN_ON_FATAL_FAILURE( + urContextTestWithParam>::TearDown()); + } + + const MultiQueueParam &getParamTuple() const { + return urContextTestWithParam>::getParam(); + } + + const T &getParam() const { return std::get<0>(this->getParamTuple()); } + + ur_queue_flag_t getQueueFlag() { return std::get<1>(this->getParamTuple()); } + + ur_queue_handle_t queue = nullptr; +}; + template -struct urMemBufferQueueTestWithParam : urQueueTestWithParam { +struct urMemBufferQueueTestWithParam : urMultiQueueTypeTestWithParam { void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urQueueTestWithParam::SetUp()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTestWithParam::SetUp()); ASSERT_SUCCESS( urMemBufferCreate(this->context, mem_flag, size, nullptr, &buffer)); } @@ -492,7 +600,7 @@ struct urMemBufferQueueTestWithParam : urQueueTestWithParam { if (buffer) { EXPECT_SUCCESS(urMemRelease(buffer)); } - UUR_RETURN_ON_FATAL_FAILURE(urQueueTestWithParam::TearDown()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTestWithParam::TearDown()); } const size_t count = this->getParam().count; @@ -653,9 +761,9 @@ struct urMultiDeviceMemBufferQueueTest : urMultiDeviceMemBufferTest { std::vector queues; }; -struct urMemBufferQueueTest : urQueueTest { +struct urMemBufferQueueTest : urMultiQueueTypeTest { void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTest::SetUp()); ASSERT_SUCCESS(urMemBufferCreate(context, UR_MEM_FLAG_READ_WRITE, size, nullptr, &buffer)); } @@ -664,7 +772,7 @@ struct urMemBufferQueueTest : urQueueTest { if (buffer) { EXPECT_SUCCESS(urMemRelease(buffer)); } - UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::TearDown()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTest::TearDown()); } const size_t count = 8; @@ -672,9 +780,9 @@ struct urMemBufferQueueTest : urQueueTest { ur_mem_handle_t buffer = nullptr; }; -struct urMemImageQueueTest : urQueueTest { +struct urMemImageQueueTest : urMultiQueueTypeTest { void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTest::SetUp()); ur_bool_t imageSupported = false; ASSERT_SUCCESS(urDeviceGetInfo(this->device, UR_DEVICE_INFO_IMAGE_SUPPORT, sizeof(ur_bool_t), &imageSupported, @@ -702,7 +810,7 @@ struct urMemImageQueueTest : urQueueTest { if (image3D) { EXPECT_SUCCESS(urMemRelease(image3D)); } - UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::TearDown()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTest::TearDown()); } const size_t width = 1024; @@ -1209,6 +1317,23 @@ std::string platformTestWithParamPrinter( GTestSanitizeString(ss.str()); } +inline std::string +devicePrinter(const ::testing::TestParamInfo< + std::tuple> &info) { + auto device = std::get<0>(info.param).device; + auto queueMode = std::get<1>(info.param); + std::stringstream ss; + + if (queueMode == 0) { + ss << "default_queue_submission_mode"; + } else { + ss << queueMode; + } + + return uur::GetPlatformAndDeviceName(device) + "__" + + GTestSanitizeString(ss.str()); +} + /// @brief /// @tparam T /// @param info @@ -1225,6 +1350,22 @@ std::string deviceTestWithParamPrinter( GTestSanitizeString(ss.str()); } +template +std::string deviceTestWithParamPrinterMulti( + const ::testing::TestParamInfo>> + &info) { + auto device = std::get<0>(info.param).device; + auto paramTuple = std::get<1>(info.param); + + auto param = std::get<0>(paramTuple); + auto queueMode = std::get<1>(paramTuple); + + std::stringstream ss; + ss << param << "__" << queueMode; + return uur::GetPlatformAndDeviceName(device) + "__" + + GTestSanitizeString(ss.str()); +} + template <> std::string deviceTestWithParamPrinter( const ::testing::TestParamInfo> @@ -1241,11 +1382,6 @@ struct BoolTestParam { } }; -template <> -std::string deviceTestWithParamPrinter( - const ::testing::TestParamInfo> - &info); - template <> std::string platformTestWithParamPrinter( const ::testing::TestParamInfo< @@ -1259,9 +1395,19 @@ std::string deviceTestWithParamPrinter( const ::testing::TestParamInfo> &info); -struct urProgramTest : urQueueTest { +template <> +std::string deviceTestWithParamPrinterMulti( + const ::testing::TestParamInfo< + std::tuple>> &info); + +template <> +std::string deviceTestWithParamPrinterMulti( + const ::testing::TestParamInfo< + std::tuple>> &info); + +struct urProgramTest : urMultiQueueTypeTest { void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTest::SetUp()); ur_backend_t backend; ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND, @@ -1286,7 +1432,7 @@ struct urProgramTest : urQueueTest { if (program) { EXPECT_SUCCESS(urProgramRelease(program)); } - UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::TearDown()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTest::TearDown()); } std::shared_ptr> il_binary; @@ -1295,9 +1441,10 @@ struct urProgramTest : urQueueTest { std::vector metadatas{}; }; -template struct urProgramTestWithParam : urQueueTestWithParam { +template +struct urProgramTestWithParam : urMultiQueueTypeTestWithParam { void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urQueueTestWithParam::SetUp()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTestWithParam::SetUp()); ur_backend_t backend; ASSERT_SUCCESS(urPlatformGetInfo(this->platform, UR_PLATFORM_INFO_BACKEND, @@ -1325,7 +1472,7 @@ template struct urProgramTestWithParam : urQueueTestWithParam { if (program) { EXPECT_SUCCESS(urProgramRelease(program)); } - UUR_RETURN_ON_FATAL_FAILURE(urQueueTestWithParam::TearDown()); + UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueTypeTestWithParam::TearDown()); } std::shared_ptr> il_binary; diff --git a/unified-runtime/test/conformance/testing/source/fixtures.cpp b/unified-runtime/test/conformance/testing/source/fixtures.cpp index ecd951cf6200f..4990cbc86e844 100644 --- a/unified-runtime/test/conformance/testing/source/fixtures.cpp +++ b/unified-runtime/test/conformance/testing/source/fixtures.cpp @@ -7,18 +7,6 @@ #include "uur/fixtures.h" namespace uur { -template <> -std::string deviceTestWithParamPrinter( - const ::testing::TestParamInfo> - &info) { - auto device = std::get<0>(info.param).device; - auto ¶m = std::get<1>(info.param); - - std::stringstream ss; - ss << param.name << (param.value ? "Enabled" : "Disabled"); - return uur::GetPlatformAndDeviceName(device) + "__" + ss.str(); -} - template <> std::string platformTestWithParamPrinter( const ::testing::TestParamInfo< @@ -53,6 +41,49 @@ std::string deviceTestWithParamPrinter( return uur::GetPlatformAndDeviceName(device) + "__" + ss.str(); } +template <> +std::string deviceTestWithParamPrinterMulti( + const ::testing::TestParamInfo< + std::tuple>> + &info) { + auto device = std::get<0>(info.param).device; + auto ¶mTuple = std::get<1>(info.param); + auto param = std::get<0>(paramTuple); + + const auto normalized = std::get<0>(param); + const auto addr_mode = std::get<1>(param); + const auto filter_mode = std::get<2>(param); + + auto queueMode = std::get<1>(paramTuple); + + std::stringstream ss; + + if (normalized) { + ss << "NORMALIZED_"; + } else { + ss << "UNNORMALIZED_"; + } + ss << addr_mode << "_" << filter_mode; + ss << "__" << queueMode; + return uur::GetPlatformAndDeviceName(device) + "__" + ss.str(); +} + +template <> +std::string deviceTestWithParamPrinterMulti( + const ::testing::TestParamInfo< + std::tuple>> &info) { + auto device = std::get<0>(info.param).device; + auto ¶mTuple = std::get<1>(info.param); + auto param = std::get<0>(paramTuple); + auto queueMode = std::get<1>(paramTuple); + + std::stringstream ss; + ss << param.name << (param.value ? "Enabled" : "Disabled"); + ss << "__" << queueMode; + + return uur::GetPlatformAndDeviceName(device) + "__" + ss.str(); +} + template <> std::string deviceTestWithParamPrinter( const ::testing::TestParamInfo> diff --git a/unified-runtime/test/conformance/usm/urUSMFree.cpp b/unified-runtime/test/conformance/usm/urUSMFree.cpp index 6d7df2f17acd1..361b94a869040 100644 --- a/unified-runtime/test/conformance/usm/urUSMFree.cpp +++ b/unified-runtime/test/conformance/usm/urUSMFree.cpp @@ -4,6 +4,8 @@ // // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include "ur_api.h" +#include "gtest/gtest.h" #include #include @@ -118,7 +120,8 @@ struct urUSMFreeDuringExecutionTest : uur::urKernelExecutionTest { uint32_t data = 42; size_t wg_offset = 0; }; -UUR_INSTANTIATE_DEVICE_TEST_SUITE(urUSMFreeDuringExecutionTest); + +UUR_DEVICE_TEST_SUITE_WITH_DEFAULT_QUEUE(urUSMFreeDuringExecutionTest); TEST_P(urUSMFreeDuringExecutionTest, SuccessHost) { // Causes an abort in liboffload