From 0f5c3b3336b8528dd613a02e73a9a809a74ecacb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Komar?= Date: Fri, 7 Feb 2025 10:45:31 +0000 Subject: [PATCH 1/5] Enable tests for v2 command buffer --- source/adapters/level_zero/v2/command_buffer.cpp | 2 +- test/conformance/exp_command_buffer/fixtures.h | 10 ---------- test/conformance/exp_command_buffer/release.cpp | 1 - 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/source/adapters/level_zero/v2/command_buffer.cpp b/source/adapters/level_zero/v2/command_buffer.cpp index 6bf3fdf040..02fbc4a487 100644 --- a/source/adapters/level_zero/v2/command_buffer.cpp +++ b/source/adapters/level_zero/v2/command_buffer.cpp @@ -56,7 +56,7 @@ urCommandBufferCreateExp(ur_context_handle_t context, ur_device_handle_t device, ur_exp_command_buffer_handle_t *commandBuffer) try { checkImmediateAppendSupport(context); - if (commandBufferDesc->isUpdatable && + if (commandBufferDesc != nullptr && commandBufferDesc->isUpdatable && !context->getPlatform()->ZeMutableCmdListExt.Supported) { throw UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/test/conformance/exp_command_buffer/fixtures.h b/test/conformance/exp_command_buffer/fixtures.h index 0cd4d7a6b3..1bd33ef9df 100644 --- a/test/conformance/exp_command_buffer/fixtures.h +++ b/test/conformance/exp_command_buffer/fixtures.h @@ -55,8 +55,6 @@ static void checkCommandBufferUpdateSupport( struct urCommandBufferExpTest : uur::urContextTest { void SetUp() override { - UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); - UUR_RETURN_ON_FATAL_FAILURE(uur::urContextTest::SetUp()); UUR_RETURN_ON_FATAL_FAILURE(checkCommandBufferSupport(device)); @@ -78,8 +76,6 @@ struct urCommandBufferExpTest : uur::urContextTest { template struct urCommandBufferExpTestWithParam : urQueueTestWithParam { void SetUp() override { - UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); - UUR_RETURN_ON_FATAL_FAILURE(uur::urQueueTestWithParam::SetUp()); UUR_RETURN_ON_FATAL_FAILURE(checkCommandBufferSupport(this->device)); @@ -100,8 +96,6 @@ struct urCommandBufferExpTestWithParam : urQueueTestWithParam { struct urCommandBufferExpExecutionTest : uur::urKernelExecutionTest { void SetUp() override { - UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); - UUR_RETURN_ON_FATAL_FAILURE(uur::urKernelExecutionTest::SetUp()); UUR_RETURN_ON_FATAL_FAILURE(checkCommandBufferSupport(device)); @@ -122,8 +116,6 @@ struct urCommandBufferExpExecutionTest : uur::urKernelExecutionTest { struct urUpdatableCommandBufferExpTest : uur::urQueueTest { void SetUp() override { - UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); - UUR_RETURN_ON_FATAL_FAILURE(uur::urQueueTest::SetUp()); UUR_RETURN_ON_FATAL_FAILURE(checkCommandBufferSupport(device)); @@ -158,8 +150,6 @@ struct urUpdatableCommandBufferExpTest : uur::urQueueTest { struct urUpdatableCommandBufferExpExecutionTest : uur::urKernelExecutionTest { void SetUp() override { - UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); - UUR_RETURN_ON_FATAL_FAILURE(uur::urKernelExecutionTest::SetUp()); ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND, diff --git a/test/conformance/exp_command_buffer/release.cpp b/test/conformance/exp_command_buffer/release.cpp index 51ec50c552..7b76822c76 100644 --- a/test/conformance/exp_command_buffer/release.cpp +++ b/test/conformance/exp_command_buffer/release.cpp @@ -13,7 +13,6 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE(urCommandBufferReleaseExpTest); TEST_P(urCommandBufferReleaseExpTest, Success) { EXPECT_SUCCESS(urCommandBufferRetainExp(cmd_buf_handle)); - uint32_t prev_ref_count = 0; EXPECT_SUCCESS(uur::GetObjectReferenceCount(cmd_buf_handle, prev_ref_count)); From cccacd27bf0024ccdb022ccde1bcdd373fc566f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Komar?= Date: Fri, 7 Feb 2025 11:47:41 +0000 Subject: [PATCH 2/5] Add checks to failing tests --- test/conformance/exp_command_buffer/commands.cpp | 11 +++++++++++ test/conformance/exp_command_buffer/fill.cpp | 1 + 2 files changed, 12 insertions(+) diff --git a/test/conformance/exp_command_buffer/commands.cpp b/test/conformance/exp_command_buffer/commands.cpp index e35ebb9d02..2ee7e9aba9 100644 --- a/test/conformance/exp_command_buffer/commands.cpp +++ b/test/conformance/exp_command_buffer/commands.cpp @@ -56,12 +56,14 @@ struct urCommandBufferCommandsTest UUR_INSTANTIATE_DEVICE_TEST_SUITE(urCommandBufferCommandsTest); TEST_P(urCommandBufferCommandsTest, urCommandBufferAppendUSMMemcpyExp) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); ASSERT_SUCCESS(urCommandBufferAppendUSMMemcpyExp( cmd_buf_handle, device_ptrs[0], device_ptrs[1], allocation_size, 0, nullptr, 0, nullptr, nullptr, nullptr, nullptr)); } TEST_P(urCommandBufferCommandsTest, urCommandBufferAppendUSMFillExp) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); uint32_t pattern = 42; ASSERT_SUCCESS(urCommandBufferAppendUSMFillExp( cmd_buf_handle, device_ptrs[0], &pattern, sizeof(pattern), @@ -69,12 +71,14 @@ TEST_P(urCommandBufferCommandsTest, urCommandBufferAppendUSMFillExp) { } TEST_P(urCommandBufferCommandsTest, urCommandBufferAppendMemBufferCopyExp) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); ASSERT_SUCCESS(urCommandBufferAppendMemBufferCopyExp( cmd_buf_handle, buffers[0], buffers[1], 0, 0, allocation_size, 0, nullptr, 0, nullptr, nullptr, nullptr, nullptr)); } TEST_P(urCommandBufferCommandsTest, urCommandBufferAppendMemBufferCopyRectExp) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); ur_rect_offset_t origin{0, 0, 0}; ur_rect_region_t region{4, 4, 1}; ASSERT_SUCCESS(urCommandBufferAppendMemBufferCopyRectExp( @@ -83,6 +87,7 @@ TEST_P(urCommandBufferCommandsTest, urCommandBufferAppendMemBufferCopyRectExp) { } TEST_P(urCommandBufferCommandsTest, urCommandBufferAppendMemBufferReadExp) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); std::array host_data{}; ASSERT_SUCCESS(urCommandBufferAppendMemBufferReadExp( cmd_buf_handle, buffers[0], 0, allocation_size, host_data.data(), 0, @@ -90,6 +95,7 @@ TEST_P(urCommandBufferCommandsTest, urCommandBufferAppendMemBufferReadExp) { } TEST_P(urCommandBufferCommandsTest, urCommandBufferAppendMemBufferReadRectExp) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); std::array host_data{}; ur_rect_offset_t origin{0, 0, 0}; ur_rect_region_t region{4, 4, 1}; @@ -99,6 +105,7 @@ TEST_P(urCommandBufferCommandsTest, urCommandBufferAppendMemBufferReadRectExp) { } TEST_P(urCommandBufferCommandsTest, urCommandBufferAppendMemBufferWriteExp) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); std::array host_data{}; ASSERT_SUCCESS(urCommandBufferAppendMemBufferWriteExp( cmd_buf_handle, buffers[0], 0, allocation_size, host_data.data(), 0, @@ -107,6 +114,7 @@ TEST_P(urCommandBufferCommandsTest, urCommandBufferAppendMemBufferWriteExp) { TEST_P(urCommandBufferCommandsTest, urCommandBufferAppendMemBufferWriteRectExp) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); std::array host_data{}; ur_rect_offset_t origin{0, 0, 0}; ur_rect_region_t region{4, 4, 1}; @@ -116,6 +124,7 @@ TEST_P(urCommandBufferCommandsTest, } TEST_P(urCommandBufferCommandsTest, urCommandBufferAppendMemBufferFillExp) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); uint32_t pattern = 42; ASSERT_SUCCESS(urCommandBufferAppendMemBufferFillExp( cmd_buf_handle, buffers[0], &pattern, sizeof(pattern), 0, allocation_size, @@ -123,12 +132,14 @@ TEST_P(urCommandBufferCommandsTest, urCommandBufferAppendMemBufferFillExp) { } TEST_P(urCommandBufferCommandsTest, urCommandBufferAppendUSMPrefetchExp) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); ASSERT_SUCCESS(urCommandBufferAppendUSMPrefetchExp( cmd_buf_handle, device_ptrs[0], allocation_size, 0, 0, nullptr, 0, nullptr, nullptr, nullptr, nullptr)); } TEST_P(urCommandBufferCommandsTest, urCommandBufferAppendUSMAdviseExp) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); ASSERT_SUCCESS(urCommandBufferAppendUSMAdviseExp( cmd_buf_handle, device_ptrs[0], allocation_size, 0, 0, nullptr, 0, nullptr, nullptr, nullptr, nullptr)); diff --git a/test/conformance/exp_command_buffer/fill.cpp b/test/conformance/exp_command_buffer/fill.cpp index 262b4ce9db..4177dff582 100644 --- a/test/conformance/exp_command_buffer/fill.cpp +++ b/test/conformance/exp_command_buffer/fill.cpp @@ -14,6 +14,7 @@ struct testParametersFill { struct urCommandBufferFillCommandsTest : uur::command_buffer::urCommandBufferExpTestWithParam { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); UUR_RETURN_ON_FATAL_FAILURE( uur::command_buffer::urCommandBufferExpTestWithParam< testParametersFill>::SetUp()); From 4656916f881c00d7cba876bcf10e03312b6b933d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Komar?= Date: Fri, 7 Feb 2025 12:13:46 +0000 Subject: [PATCH 3/5] Move V2 check to test command --- test/conformance/exp_command_buffer/fill.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/conformance/exp_command_buffer/fill.cpp b/test/conformance/exp_command_buffer/fill.cpp index 4177dff582..8a973ceef4 100644 --- a/test/conformance/exp_command_buffer/fill.cpp +++ b/test/conformance/exp_command_buffer/fill.cpp @@ -14,7 +14,6 @@ struct testParametersFill { struct urCommandBufferFillCommandsTest : uur::command_buffer::urCommandBufferExpTestWithParam { void SetUp() override { - UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); UUR_RETURN_ON_FATAL_FAILURE( uur::command_buffer::urCommandBufferExpTestWithParam< testParametersFill>::SetUp()); @@ -105,6 +104,7 @@ UUR_DEVICE_TEST_SUITE_WITH_PARAM( printFillTestString); TEST_P(urCommandBufferFillCommandsTest, Buffer) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); ASSERT_SUCCESS(urCommandBufferAppendMemBufferFillExp( cmd_buf_handle, buffer, pattern.data(), pattern_size, 0, size, 0, nullptr, 0, nullptr, &sync_point, nullptr, nullptr)); @@ -124,6 +124,7 @@ TEST_P(urCommandBufferFillCommandsTest, Buffer) { } TEST_P(urCommandBufferFillCommandsTest, USM) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); ASSERT_SUCCESS(urCommandBufferAppendUSMFillExp( cmd_buf_handle, device_ptr, pattern.data(), pattern_size, size, 0, nullptr, 0, nullptr, &sync_point, nullptr, nullptr)); From 1929e675d7ec5e46d17ed1717360265bb3c9fac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Komar?= Date: Fri, 7 Feb 2025 12:14:13 +0000 Subject: [PATCH 4/5] Fix indentation --- test/conformance/exp_command_buffer/fill.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/conformance/exp_command_buffer/fill.cpp b/test/conformance/exp_command_buffer/fill.cpp index 8a973ceef4..5219b96271 100644 --- a/test/conformance/exp_command_buffer/fill.cpp +++ b/test/conformance/exp_command_buffer/fill.cpp @@ -104,7 +104,7 @@ UUR_DEVICE_TEST_SUITE_WITH_PARAM( printFillTestString); TEST_P(urCommandBufferFillCommandsTest, Buffer) { - UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); ASSERT_SUCCESS(urCommandBufferAppendMemBufferFillExp( cmd_buf_handle, buffer, pattern.data(), pattern_size, 0, size, 0, nullptr, 0, nullptr, &sync_point, nullptr, nullptr)); @@ -124,7 +124,7 @@ TEST_P(urCommandBufferFillCommandsTest, Buffer) { } TEST_P(urCommandBufferFillCommandsTest, USM) { - UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); ASSERT_SUCCESS(urCommandBufferAppendUSMFillExp( cmd_buf_handle, device_ptr, pattern.data(), pattern_size, size, 0, nullptr, 0, nullptr, &sync_point, nullptr, nullptr)); From 6bb51a23c0e70974c031e8b2f4b757838f925eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Komar?= Date: Mon, 10 Feb 2025 10:47:29 +0000 Subject: [PATCH 5/5] Removed nullptr check --- source/adapters/level_zero/v2/command_buffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/adapters/level_zero/v2/command_buffer.cpp b/source/adapters/level_zero/v2/command_buffer.cpp index 02fbc4a487..6bf3fdf040 100644 --- a/source/adapters/level_zero/v2/command_buffer.cpp +++ b/source/adapters/level_zero/v2/command_buffer.cpp @@ -56,7 +56,7 @@ urCommandBufferCreateExp(ur_context_handle_t context, ur_device_handle_t device, ur_exp_command_buffer_handle_t *commandBuffer) try { checkImmediateAppendSupport(context); - if (commandBufferDesc != nullptr && commandBufferDesc->isUpdatable && + if (commandBufferDesc->isUpdatable && !context->getPlatform()->ZeMutableCmdListExt.Supported) { throw UR_RESULT_ERROR_UNSUPPORTED_FEATURE; }