refactor: don't use global GfxCoreHelper getter

Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2023-01-09 13:30:43 +00:00
committed by Compute-Runtime-Automation
parent 0dc5fb3e51
commit 60340734b7
15 changed files with 72 additions and 53 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -8,26 +8,32 @@
#include "shared/test/common/test_macros/test_checks_shared.h"
#include "shared/source/device/device.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/helpers/hw_helper.h"
#include "shared/test/common/test_macros/hw_test.h"
using namespace NEO;
bool TestChecks::supportsBlitter(const HardwareInfo *pHardwareInfo) {
auto engines = GfxCoreHelper::get(::renderCoreFamily).getGpgpuEngineInstances(*pHardwareInfo);
bool TestChecks::supportsBlitter(const RootDeviceEnvironment &rootDeviceEnvironment) {
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
auto hwInfo = rootDeviceEnvironment.getMutableHardwareInfo();
auto engines = gfxCoreHelper.getGpgpuEngineInstances(*hwInfo);
for (const auto &engine : engines) {
if (engine.first == aub_stream::EngineType::ENGINE_BCS) {
return pHardwareInfo->capabilityTable.blitterOperationsSupported;
return hwInfo->capabilityTable.blitterOperationsSupported;
}
}
return false;
}
bool TestChecks::fullySupportsBlitter(const HardwareInfo *pHardwareInfo) {
auto engines = GfxCoreHelper::get(::renderCoreFamily).getGpgpuEngineInstances(*pHardwareInfo);
bool TestChecks::fullySupportsBlitter(const RootDeviceEnvironment &rootDeviceEnvironment) {
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
auto hwInfo = rootDeviceEnvironment.getMutableHardwareInfo();
auto engines = gfxCoreHelper.getGpgpuEngineInstances(*hwInfo);
for (const auto &engine : engines) {
if (engine.first == aub_stream::EngineType::ENGINE_BCS) {
return ProductHelper::get(pHardwareInfo->platform.eProductFamily)->isBlitterFullySupported(*pHardwareInfo);
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
return productHelper.isBlitterFullySupported(*hwInfo);
}
}
return false;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -13,10 +13,11 @@
namespace NEO {
class Device;
struct HardwareInfo;
struct RootDeviceEnvironment;
namespace TestChecks {
bool supportsBlitter(const HardwareInfo *pHardwareInfo);
bool fullySupportsBlitter(const HardwareInfo *pHardwareInfo);
bool supportsBlitter(const RootDeviceEnvironment &rootDeviceEnvironemnt);
bool fullySupportsBlitter(const RootDeviceEnvironment &rootDeviceEnvironment);
bool supportsImages(const HardwareInfo &hardwareInfo);
bool supportsImages(const std::unique_ptr<HardwareInfo> &pHardwareInfo);
bool supportsSvm(const HardwareInfo *pHardwareInfo);

View File

@@ -1932,7 +1932,8 @@ HWTEST_F(CommandStreamReceiverTest, givenDebugFlagWhenCreatingCsrThenSetEnableSt
}
HWTEST_F(CommandStreamReceiverTest, whenCreatingWorkPartitionAllocationThenInitializeContentsWithCopyEngine) {
REQUIRE_BLITTER_OR_SKIP(defaultHwInfo.get());
MockExecutionEnvironment mockExecutionEnvironment{};
REQUIRE_BLITTER_OR_SKIP(*mockExecutionEnvironment.rootDeviceEnvironments[0].get());
DebugManagerStateRestore restore{};
DebugManager.flags.EnableStaticPartitioning.set(0);
@@ -2135,7 +2136,7 @@ TEST(CreateWorkPartitionAllocationTest, givenEnabledBlitterWhenInitializingWorkP
auto memoryManager = static_cast<MockMemoryManager *>(device.getMemoryManager());
auto commandStreamReceiver = device.getDefaultEngine().commandStreamReceiver;
REQUIRE_BLITTER_OR_SKIP(&device.getHardwareInfo());
REQUIRE_BLITTER_OR_SKIP(device.getRootDeviceEnvironment());
memoryManager->freeGraphicsMemory(commandStreamReceiver->getWorkPartitionAllocation());
memoryManager->copyMemoryToAllocationBanksCalled = 0u;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -298,7 +298,7 @@ HWTEST_F(BlitTests, givenMemorySizeTwiceBiggerThanMaxWidthWhenFillPatternWithBli
HardwareInfo *hwInfo = pDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
hwInfo->capabilityTable.blitterOperationsSupported = true;
REQUIRE_BLITTER_OR_SKIP(hwInfo);
REQUIRE_BLITTER_OR_SKIP(pDevice->getRootDeviceEnvironment());
uint32_t pattern[4] = {1, 0, 0, 0};
uint32_t streamBuffer[100] = {};
@@ -326,7 +326,7 @@ HWTEST_F(BlitTests, givenMemorySizeIsLessThanTwicenMaxWidthWhenFillPatternWithBl
HardwareInfo *hwInfo = pDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
hwInfo->capabilityTable.blitterOperationsSupported = true;
REQUIRE_BLITTER_OR_SKIP(hwInfo);
REQUIRE_BLITTER_OR_SKIP(pDevice->getRootDeviceEnvironment());
uint32_t pattern[4] = {1, 0, 0, 0};
uint32_t streamBuffer[100] = {};