diff --git a/level_zero/core/test/unit_tests/gen9/test_device_gen9.cpp b/level_zero/core/test/unit_tests/gen9/test_device_gen9.cpp index f048cf61cd..ee65f0379f 100644 --- a/level_zero/core/test/unit_tests/gen9/test_device_gen9.cpp +++ b/level_zero/core/test/unit_tests/gen9/test_device_gen9.cpp @@ -43,61 +43,52 @@ HWTEST2_F(DeviceQueueGroupTest, givenCommandQueuePropertiesCallThenCorrectNumber uint32_t count = 0; ze_result_t res = device->getCommandQueueGroupProperties(&count, nullptr); EXPECT_EQ(ZE_RESULT_SUCCESS, res); - auto expectedCount = 1u; - if (device->getHwInfo().featureTable.ftrBcsInfo.test(0)) { - expectedCount++; - } - EXPECT_EQ(expectedCount, count); + EXPECT_EQ(1u, count); - auto properties = std::make_unique(count); - res = device->getCommandQueueGroupProperties(&count, properties.get()); + ze_command_queue_group_properties_t properties; + res = device->getCommandQueueGroupProperties(&count, &properties); EXPECT_EQ(ZE_RESULT_SUCCESS, res); - EXPECT_TRUE(properties[0].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE); - EXPECT_TRUE(properties[0].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY); - EXPECT_TRUE(properties[0].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS); - EXPECT_TRUE(properties[0].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_METRICS); - EXPECT_EQ(properties[0].numQueues, 1u); - EXPECT_EQ(properties[0].maxMemoryFillPatternSize, sizeof(uint32_t)); + EXPECT_TRUE(properties.flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE); + EXPECT_TRUE(properties.flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY); + EXPECT_TRUE(properties.flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS); + EXPECT_TRUE(properties.flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_METRICS); + EXPECT_EQ(properties.numQueues, 1u); + EXPECT_EQ(properties.maxMemoryFillPatternSize, sizeof(uint32_t)); } HWTEST2_F(DeviceQueueGroupTest, givenQueueGroupsReturnedThenCommandListIsCreatedCorrectly, IsGen9) { uint32_t count = 0; ze_result_t res = device->getCommandQueueGroupProperties(&count, nullptr); EXPECT_EQ(ZE_RESULT_SUCCESS, res); - auto expectedCount = 1u; - if (device->getHwInfo().featureTable.ftrBcsInfo.test(0)) { - expectedCount++; - } - EXPECT_EQ(expectedCount, count); + EXPECT_EQ(1u, count); - auto properties = std::make_unique(count); - res = device->getCommandQueueGroupProperties(&count, properties.get()); + ze_command_queue_group_properties_t properties; + res = device->getCommandQueueGroupProperties(&count, &properties); EXPECT_EQ(ZE_RESULT_SUCCESS, res); - EXPECT_TRUE(properties[0].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE); - EXPECT_TRUE(properties[0].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY); - EXPECT_TRUE(properties[0].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS); - EXPECT_TRUE(properties[0].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_METRICS); - EXPECT_EQ(properties[0].numQueues, 1u); - EXPECT_EQ(properties[0].maxMemoryFillPatternSize, sizeof(uint32_t)); + EXPECT_TRUE(properties.flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE); + EXPECT_TRUE(properties.flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY); + EXPECT_TRUE(properties.flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS); + EXPECT_TRUE(properties.flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_METRICS); + EXPECT_EQ(properties.numQueues, 1u); + EXPECT_EQ(properties.maxMemoryFillPatternSize, sizeof(uint32_t)); ze_context_handle_t hContext; ze_context_desc_t contextDesc; res = driverHandle->createContext(&contextDesc, &hContext); EXPECT_EQ(ZE_RESULT_SUCCESS, res); L0::Context *context = Context::fromHandle(hContext); - for (uint32_t i = 0; i < count; i++) { - ze_command_list_desc_t listDesc = {}; - listDesc.commandQueueGroupOrdinal = i; - ze_command_list_handle_t hCommandList = {}; - res = context->createCommandList(device, &listDesc, &hCommandList); - EXPECT_EQ(ZE_RESULT_SUCCESS, res); + ze_command_list_desc_t listDesc = {}; + listDesc.commandQueueGroupOrdinal = 0; + ze_command_list_handle_t hCommandList = {}; - CommandList *commandList = CommandList::fromHandle(hCommandList); - commandList->destroy(); - } + res = context->createCommandList(device, &listDesc, &hCommandList); + EXPECT_EQ(ZE_RESULT_SUCCESS, res); + + CommandList *commandList = CommandList::fromHandle(hCommandList); + commandList->destroy(); context->destroy(); } diff --git a/opencl/test/unit_test/gen11/hw_helper_tests_gen11.cpp b/opencl/test/unit_test/gen11/hw_helper_tests_gen11.cpp index 8532fc5e1c..05b9d34ee8 100644 --- a/opencl/test/unit_test/gen11/hw_helper_tests_gen11.cpp +++ b/opencl/test/unit_test/gen11/hw_helper_tests_gen11.cpp @@ -45,9 +45,8 @@ GEN11TEST_F(HwHelperTestGen11, givenGen11PlatformWhenSetupHardwareCapabilitiesIs } GEN11TEST_F(HwHelperTestGen11, whenGetGpgpuEnginesThenReturnThreeRcsEngines) { - NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); - hwInfo.featureTable.ftrBcsInfo.set(0, false); - whenGetGpgpuEnginesThenReturnThreeRcsEngines(hwInfo); + whenGetGpgpuEnginesThenReturnTwoRcsEngines(pDevice->getHardwareInfo()); + EXPECT_EQ(3u, pDevice->engines.size()); } using MemorySynchronizatiopCommandsTestsGen11 = ::testing::Test; diff --git a/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl b/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl index 23600454cb..050178d98e 100644 --- a/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl @@ -118,7 +118,7 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenDifferentSizesOfAllocationWhenCheckingCo } } -GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeNotSetAndBcsInfoSetWhenGetGpgpuEnginesThenReturnThreeRcsEnginesEngine) { +GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeNotSetAndBcsInfoSetWhenGetGpgpuEnginesThenReturnThreeRcsEnginesAndOneBcsEngine) { HardwareInfo hwInfo = *defaultHwInfo; hwInfo.featureTable.ftrCCSNode = false; hwInfo.featureTable.ftrBcsInfo = 1; diff --git a/opencl/test/unit_test/gen8/hw_helper_tests_gen8.cpp b/opencl/test/unit_test/gen8/hw_helper_tests_gen8.cpp index 72f2d5c911..8be27da9b2 100644 --- a/opencl/test/unit_test/gen8/hw_helper_tests_gen8.cpp +++ b/opencl/test/unit_test/gen8/hw_helper_tests_gen8.cpp @@ -52,9 +52,8 @@ GEN8TEST_F(HwHelperTestGen8, givenGen8PlatformWhenSetupHardwareCapabilitiesIsCal } GEN8TEST_F(HwHelperTestGen8, whenGetGpgpuEnginesThenReturnThreeEngines) { - NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); - hwInfo.featureTable.ftrBcsInfo.set(0, false); - whenGetGpgpuEnginesThenReturnThreeRcsEngines(hwInfo); + whenGetGpgpuEnginesThenReturnTwoRcsEngines(pDevice->getHardwareInfo()); + EXPECT_EQ(3u, pDevice->engines.size()); } using MemorySynchronizatiopCommandsTestsGen8 = ::testing::Test; diff --git a/opencl/test/unit_test/gen9/hw_helper_tests_gen9.cpp b/opencl/test/unit_test/gen9/hw_helper_tests_gen9.cpp index 9ecec0d0e6..ce3a9d1e04 100644 --- a/opencl/test/unit_test/gen9/hw_helper_tests_gen9.cpp +++ b/opencl/test/unit_test/gen9/hw_helper_tests_gen9.cpp @@ -57,9 +57,8 @@ GEN9TEST_F(HwHelperTestGen9, givenDebuggingActiveWhenSipKernelTypeIsQueriedThenD } GEN9TEST_F(HwHelperTestGen9, whenGetGpgpuEnginesThenReturnThreeRcsEngines) { - NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); - hwInfo.featureTable.ftrBcsInfo.set(0, false); - whenGetGpgpuEnginesThenReturnThreeRcsEngines(hwInfo); + whenGetGpgpuEnginesThenReturnTwoRcsEngines(pDevice->getHardwareInfo()); + EXPECT_EQ(3u, pDevice->engines.size()); } using MemorySynchronizatiopCommandsTestsGen9 = ::testing::Test; diff --git a/opencl/test/unit_test/helpers/get_gpgpu_engines_tests.inl b/opencl/test/unit_test/helpers/get_gpgpu_engines_tests.inl index a38765fec3..6449954fe3 100644 --- a/opencl/test/unit_test/helpers/get_gpgpu_engines_tests.inl +++ b/opencl/test/unit_test/helpers/get_gpgpu_engines_tests.inl @@ -12,7 +12,7 @@ using namespace NEO; template -void whenGetGpgpuEnginesThenReturnThreeRcsEngines(const HardwareInfo &hwInfo) { +void whenGetGpgpuEnginesThenReturnTwoRcsEngines(const HardwareInfo &hwInfo) { auto gpgpuEngines = HwHelperHw::get().getGpgpuEngineInstances(hwInfo); EXPECT_EQ(3u, gpgpuEngines.size()); EXPECT_EQ(aub_stream::ENGINE_RCS, gpgpuEngines[0].first); diff --git a/shared/source/helpers/hw_helper_bdw_plus.inl b/shared/source/helpers/hw_helper_bdw_plus.inl index e23ed91d42..01df9da547 100644 --- a/shared/source/helpers/hw_helper_bdw_plus.inl +++ b/shared/source/helpers/hw_helper_bdw_plus.inl @@ -57,28 +57,17 @@ bool HwHelperHw::obtainBlitterPreference(const HardwareInfo &hwInfo) con template const HwHelper::EngineInstancesContainer HwHelperHw::getGpgpuEngineInstances(const HardwareInfo &hwInfo) const { - EngineInstancesContainer engines; - - engines.push_back({aub_stream::ENGINE_RCS, EngineUsage::Regular}); - engines.push_back({aub_stream::ENGINE_RCS, EngineUsage::LowPriority}); - engines.push_back({aub_stream::ENGINE_RCS, EngineUsage::Internal}); - - if (hwInfo.featureTable.ftrBcsInfo.test(0)) { - engines.push_back({aub_stream::ENGINE_BCS, EngineUsage::Regular}); - } - - return engines; + return { + {aub_stream::ENGINE_RCS, EngineUsage::Regular}, + {aub_stream::ENGINE_RCS, EngineUsage::LowPriority}, + {aub_stream::ENGINE_RCS, EngineUsage::Internal}, + }; } template void HwHelperHw::addEngineToEngineGroup(std::vector> &engineGroups, EngineControl &engine, const HardwareInfo &hwInfo) const { - if (engine.getEngineType() == aub_stream::ENGINE_RCS) { - engineGroups[static_cast(EngineGroupType::RenderCompute)].push_back(engine); - } - if (engine.getEngineType() == aub_stream::ENGINE_BCS && DebugManager.flags.EnableBlitterOperationsSupport.get() != 0) { - engineGroups[static_cast(EngineGroupType::Copy)].push_back(engine); - } + engineGroups[static_cast(EngineGroupType::RenderCompute)].push_back(engine); } template diff --git a/shared/test/unit_test/helpers/CMakeLists.txt b/shared/test/unit_test/helpers/CMakeLists.txt index d049875ecb..19cab378a3 100644 --- a/shared/test/unit_test/helpers/CMakeLists.txt +++ b/shared/test/unit_test/helpers/CMakeLists.txt @@ -16,7 +16,6 @@ set(NEO_CORE_HELPERS_TESTS ${CMAKE_CURRENT_SOURCE_DIR}/dispatch_flags_helper.h ${CMAKE_CURRENT_SOURCE_DIR}/file_io_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/hw_helper_extended_tests.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/hash_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/kernel_helpers_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/memory_leak_listener.h diff --git a/shared/test/unit_test/helpers/hw_helper_tests.cpp b/shared/test/unit_test/helpers/hw_helper_tests.cpp deleted file mode 100644 index 717be972c2..0000000000 --- a/shared/test/unit_test/helpers/hw_helper_tests.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2020 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/helpers/hw_helper.h" -#include "shared/test/unit_test/fixtures/device_fixture.h" -#include "shared/test/unit_test/helpers/debug_manager_state_restore.h" - -#include "test.h" - -using namespace NEO; - -typedef Test HwHelperTest; - -using Platforms = IsWithinProducts; - -HWTEST2_F(HwHelperTest, givenHwHelperWhenGetGpgpuEnginesThenReturnThreeRcsEnginesAndOneBcs, Platforms) { - HardwareInfo hwInfo = *defaultHwInfo; - hwInfo.featureTable.ftrCCSNode = false; - hwInfo.featureTable.ftrBcsInfo = 1; - hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS; - auto gpgpuEngines = HwHelperHw::get().getGpgpuEngineInstances(hwInfo); - EXPECT_EQ(4u, gpgpuEngines.size()); - EXPECT_EQ(aub_stream::ENGINE_RCS, gpgpuEngines[0].first); - EXPECT_EQ(aub_stream::ENGINE_RCS, gpgpuEngines[1].first); - EXPECT_EQ(aub_stream::ENGINE_RCS, gpgpuEngines[2].first); - EXPECT_EQ(aub_stream::ENGINE_BCS, gpgpuEngines[3].first); -} - -HWTEST_F(HwHelperTest, givenHwHelperWhenEnableBlitterOperationsSupportEnabledThenBcsInCopyGroupVecotr) { - DebugManagerStateRestore dbgRestorer; - DebugManager.flags.EnableBlitterOperationsSupport.set(1); - std::unique_ptr bcsOsContext; - bcsOsContext.reset(OsContext::create(nullptr, 1, 0, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, - false, false, false)); - EngineControl engineControl; - engineControl.osContext = bcsOsContext.get(); - std::vector> engineGroups; - engineGroups.resize(static_cast(EngineGroupType::MaxEngineGroups)); - HwHelperHw::get().addEngineToEngineGroup(engineGroups, engineControl, pDevice->getHardwareInfo()); - EXPECT_EQ(engineGroups[static_cast(EngineGroupType::Copy)].size(), 1u); -} - -HWTEST_F(HwHelperTest, givenHwHelperWhenEnableBlitterOperationsSupportDisabledThenCopyGroupVecotrIsEmpty) { - DebugManagerStateRestore dbgRestorer; - DebugManager.flags.EnableBlitterOperationsSupport.set(0); - std::unique_ptr bcsOsContext; - bcsOsContext.reset(OsContext::create(nullptr, 1, 0, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, - false, false, false)); - EngineControl engineControl; - engineControl.osContext = bcsOsContext.get(); - std::vector> engineGroups; - engineGroups.resize(static_cast(EngineGroupType::MaxEngineGroups)); - HwHelperHw::get().addEngineToEngineGroup(engineGroups, engineControl, pDevice->getHardwareInfo()); - EXPECT_EQ(engineGroups[static_cast(EngineGroupType::Copy)].size(), 0u); -} \ No newline at end of file