refactor: don't use global ProductHelper getter 19/n

Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2023-01-30 00:53:04 +00:00
committed by Compute-Runtime-Automation
parent 004d3e3416
commit 7b7c28cb40
29 changed files with 120 additions and 75 deletions

View File

@@ -636,7 +636,8 @@ struct EngineInstancedDeviceExecuteTests : public ::testing::Test {
hwInfo->featureTable.flags.ftrCCSNode = (numCcs > 0); hwInfo->featureTable.flags.ftrCCSNode = (numCcs > 0);
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<NEO::GfxCoreHelper>(); auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<NEO::GfxCoreHelper>();
gfxCoreHelper.adjustDefaultEngineType(hwInfo); auto &productHelper = rootDeviceEnvironment.getHelper<NEO::ProductHelper>();
gfxCoreHelper.adjustDefaultEngineType(hwInfo, productHelper);
if (!multiCcsDevice(rootDeviceEnvironment, numCcs)) { if (!multiCcsDevice(rootDeviceEnvironment, numCcs)) {
return false; return false;

View File

@@ -68,8 +68,9 @@ void ClDevice::setupFp64Flags() {
void ClDevice::initializeCaps() { void ClDevice::initializeCaps() {
auto &hwInfo = getHardwareInfo(); auto &hwInfo = getHardwareInfo();
auto &productHelper = getRootDeviceEnvironment().getHelper<ProductHelper>(); auto &rootDeviceEnvironment = getRootDeviceEnvironment();
auto &gfxCoreHelper = getRootDeviceEnvironment().getHelper<GfxCoreHelper>(); auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
auto &sharedDeviceInfo = getSharedDeviceInfo(); auto &sharedDeviceInfo = getSharedDeviceInfo();
deviceExtensions.clear(); deviceExtensions.clear();
deviceExtensions.append(deviceExtensionsList); deviceExtensions.append(deviceExtensionsList);
@@ -227,7 +228,7 @@ void ClDevice::initializeCaps() {
deviceExtensions += "cl_khr_pci_bus_info "; deviceExtensions += "cl_khr_pci_bus_info ";
} }
deviceExtensions += gfxCoreHelper.getExtensions(hwInfo); deviceExtensions += gfxCoreHelper.getExtensions(rootDeviceEnvironment);
deviceInfo.deviceExtensions = deviceExtensions.c_str(); deviceInfo.deviceExtensions = deviceExtensions.c_str();
std::vector<std::string> exposedBuiltinKernelsVector; std::vector<std::string> exposedBuiltinKernelsVector;
@@ -327,7 +328,7 @@ void ClDevice::initializeCaps() {
deviceInfo.image3DMaxHeight = gfxCoreHelper.getMax3dImageWidthOrHeight(); deviceInfo.image3DMaxHeight = gfxCoreHelper.getMax3dImageWidthOrHeight();
// cl_khr_image2d_from_buffer // cl_khr_image2d_from_buffer
deviceInfo.imagePitchAlignment = gfxCoreHelper.getPitchAlignmentForImage(this->getRootDeviceEnvironment()); deviceInfo.imagePitchAlignment = gfxCoreHelper.getPitchAlignmentForImage(rootDeviceEnvironment);
deviceInfo.imageBaseAddressAlignment = 4; deviceInfo.imageBaseAddressAlignment = 4;
deviceInfo.queueOnHostProperties = CL_QUEUE_PROFILING_ENABLE | CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE; deviceInfo.queueOnHostProperties = CL_QUEUE_PROFILING_ENABLE | CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE;
@@ -379,7 +380,7 @@ void ClDevice::initializeCaps() {
getQueueFamilyName(properties.name, engineGroup.engineGroupType); getQueueFamilyName(properties.name, engineGroup.engineGroupType);
deviceInfo.queueFamilyProperties.push_back(properties); deviceInfo.queueFamilyProperties.push_back(properties);
} }
auto &clGfxCoreHelper = this->getRootDeviceEnvironment().getHelper<ClGfxCoreHelper>(); auto &clGfxCoreHelper = rootDeviceEnvironment.getHelper<ClGfxCoreHelper>();
const std::vector<uint32_t> &supportedThreadArbitrationPolicies = clGfxCoreHelper.getSupportedThreadArbitrationPolicies(); const std::vector<uint32_t> &supportedThreadArbitrationPolicies = clGfxCoreHelper.getSupportedThreadArbitrationPolicies();
deviceInfo.supportedThreadArbitrationPolicies.resize(supportedThreadArbitrationPolicies.size()); deviceInfo.supportedThreadArbitrationPolicies.resize(supportedThreadArbitrationPolicies.size());
for (size_t policy = 0u; policy < supportedThreadArbitrationPolicies.size(); policy++) { for (size_t policy = 0u; policy < supportedThreadArbitrationPolicies.size(); policy++) {

View File

@@ -390,7 +390,8 @@ HWTEST_F(DeviceTest, givenDeviceWhenAskingForDefaultEngineThenReturnValidValue)
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment(); ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1u); executionEnvironment->prepareRootDeviceEnvironments(1u);
auto &gfxCoreHelper = getHelper<GfxCoreHelper>(); auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
gfxCoreHelper.adjustDefaultEngineType(executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo()); auto &productHelper = getHelper<ProductHelper>();
gfxCoreHelper.adjustDefaultEngineType(executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo(), productHelper);
auto device = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 0)); auto device = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 0));
auto osContext = device->getDefaultEngine().osContext; auto osContext = device->getDefaultEngine().osContext;

View File

@@ -335,7 +335,8 @@ struct EngineInstancedDeviceTests : public ::testing::Test {
hwInfo->featureTable.flags.ftrCCSNode = (numCcs > 0); hwInfo->featureTable.flags.ftrCCSNode = (numCcs > 0);
hwInfo->capabilityTable.blitterOperationsSupported = true; hwInfo->capabilityTable.blitterOperationsSupported = true;
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>(); auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
gfxCoreHelper.adjustDefaultEngineType(hwInfo); auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
gfxCoreHelper.adjustDefaultEngineType(hwInfo, productHelper);
if (!multiCcsDevice(rootDeviceEnvironment, numCcs)) { if (!multiCcsDevice(rootDeviceEnvironment, numCcs)) {
return false; return false;

View File

@@ -89,7 +89,9 @@ GEN12LPTEST_F(GfxCoreHelperTestGen12Lp, WhenAdjustingDefaultEngineTypeThenRcsIsS
hardwareInfo.featureTable.flags.ftrCCSNode = false; hardwareInfo.featureTable.flags.ftrCCSNode = false;
auto &gfxCoreHelper = getHelper<GfxCoreHelper>(); auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo); auto &productHelper = getHelper<ProductHelper>();
gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo, productHelper);
EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType); EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType);
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2022 Intel Corporation * Copyright (C) 2020-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -23,7 +23,7 @@ uint32_t GfxCoreHelperHw<Family>::getComputeUnitsUsedForScratch(const RootDevice
} }
template <> template <>
std::string GfxCoreHelperHw<Family>::getExtensions(const HardwareInfo &hwInfo) const { std::string GfxCoreHelperHw<Family>::getExtensions(const RootDeviceEnvironment &rootDeviceEnvironment) const {
return "cl_intel_subgroup_local_block_io "; return "cl_intel_subgroup_local_block_io ";
} }

View File

@@ -134,7 +134,7 @@ EngineGroupType GfxCoreHelperHw<Family>::getEngineGroupType(aub_stream::EngineTy
} }
template <> template <>
std::string GfxCoreHelperHw<Family>::getExtensions(const HardwareInfo &hwInfo) const { std::string GfxCoreHelperHw<Family>::getExtensions(const RootDeviceEnvironment &rootDeviceEnvironment) const {
std::string extensions; std::string extensions;
extensions += "cl_intel_subgroup_local_block_io "; extensions += "cl_intel_subgroup_local_block_io ";

View File

@@ -55,7 +55,7 @@ class GfxCoreHelper {
virtual uint32_t getComputeUnitsUsedForScratch(const RootDeviceEnvironment &rootDeviceEnvironment) const = 0; virtual uint32_t getComputeUnitsUsedForScratch(const RootDeviceEnvironment &rootDeviceEnvironment) const = 0;
virtual uint32_t getPitchAlignmentForImage(const RootDeviceEnvironment &rootDeviceEnvironment) const = 0; virtual uint32_t getPitchAlignmentForImage(const RootDeviceEnvironment &rootDeviceEnvironment) const = 0;
virtual uint32_t getMaxNumSamplers() const = 0; virtual uint32_t getMaxNumSamplers() const = 0;
virtual void adjustDefaultEngineType(HardwareInfo *pHwInfo) = 0; virtual void adjustDefaultEngineType(HardwareInfo *pHwInfo, const ProductHelper &productHelper) = 0;
virtual SipKernelType getSipKernelType(bool debuggingActive) const = 0; virtual SipKernelType getSipKernelType(bool debuggingActive) const = 0;
virtual bool isLocalMemoryEnabled(const HardwareInfo &hwInfo) const = 0; virtual bool isLocalMemoryEnabled(const HardwareInfo &hwInfo) const = 0;
virtual bool is1MbAlignmentSupported(const HardwareInfo &hwInfo, bool isCompressionEnabled) const = 0; virtual bool is1MbAlignmentSupported(const HardwareInfo &hwInfo, bool isCompressionEnabled) const = 0;
@@ -89,7 +89,7 @@ class GfxCoreHelper {
virtual const StackVec<size_t, 3> getDeviceSubGroupSizes() const = 0; virtual const StackVec<size_t, 3> getDeviceSubGroupSizes() const = 0;
virtual const StackVec<uint32_t, 6> getThreadsPerEUConfigs() const = 0; virtual const StackVec<uint32_t, 6> getThreadsPerEUConfigs() const = 0;
virtual bool getEnableLocalMemory(const HardwareInfo &hwInfo) const = 0; virtual bool getEnableLocalMemory(const HardwareInfo &hwInfo) const = 0;
virtual std::string getExtensions(const HardwareInfo &hwInfo) const = 0; virtual std::string getExtensions(const RootDeviceEnvironment &rootDeviceEnvironment) const = 0;
static uint32_t getMaxThreadsForVfe(const HardwareInfo &hwInfo); static uint32_t getMaxThreadsForVfe(const HardwareInfo &hwInfo);
virtual uint32_t getMetricsLibraryGenId() const = 0; virtual uint32_t getMetricsLibraryGenId() const = 0;
virtual uint32_t getMocsIndex(const GmmHelper &gmmHelper, bool l3enabled, bool l1enabled) const = 0; virtual uint32_t getMocsIndex(const GmmHelper &gmmHelper, bool l3enabled, bool l1enabled) const = 0;
@@ -219,7 +219,7 @@ class GfxCoreHelperHw : public GfxCoreHelper {
uint32_t getMaxNumSamplers() const override; uint32_t getMaxNumSamplers() const override;
void adjustDefaultEngineType(HardwareInfo *pHwInfo) override; void adjustDefaultEngineType(HardwareInfo *pHwInfo, const ProductHelper &productHelper) override;
SipKernelType getSipKernelType(bool debuggingActive) const override; SipKernelType getSipKernelType(bool debuggingActive) const override;
@@ -264,7 +264,7 @@ class GfxCoreHelperHw : public GfxCoreHelper {
bool getEnableLocalMemory(const HardwareInfo &hwInfo) const override; bool getEnableLocalMemory(const HardwareInfo &hwInfo) const override;
std::string getExtensions(const HardwareInfo &hwInfo) const override; std::string getExtensions(const RootDeviceEnvironment &rootDeviceEnvironment) const override;
uint32_t getMetricsLibraryGenId() const override; uint32_t getMetricsLibraryGenId() const override;

View File

@@ -11,7 +11,7 @@
namespace NEO { namespace NEO {
template <typename GfxFamily> template <typename GfxFamily>
void GfxCoreHelperHw<GfxFamily>::adjustDefaultEngineType(HardwareInfo *pHwInfo) { void GfxCoreHelperHw<GfxFamily>::adjustDefaultEngineType(HardwareInfo *pHwInfo, const ProductHelper &productHelper) {
} }
template <typename GfxFamily> template <typename GfxFamily>
@@ -71,7 +71,7 @@ EngineGroupType GfxCoreHelperHw<GfxFamily>::getEngineGroupType(aub_stream::Engin
} }
template <typename GfxFamily> template <typename GfxFamily>
std::string GfxCoreHelperHw<GfxFamily>::getExtensions(const HardwareInfo &hwInfo) const { std::string GfxCoreHelperHw<GfxFamily>::getExtensions(const RootDeviceEnvironment &rootDeviceEnvironment) const {
return ""; return "";
} }

View File

@@ -19,7 +19,7 @@
namespace NEO { namespace NEO {
template <typename GfxFamily> template <typename GfxFamily>
void GfxCoreHelperHw<GfxFamily>::adjustDefaultEngineType(HardwareInfo *pHwInfo) { void GfxCoreHelperHw<GfxFamily>::adjustDefaultEngineType(HardwareInfo *pHwInfo, const ProductHelper &productHelper) {
if (!pHwInfo->featureTable.flags.ftrCCSNode) { if (!pHwInfo->featureTable.flags.ftrCCSNode) {
pHwInfo->capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS; pHwInfo->capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS;
} }

View File

@@ -141,10 +141,10 @@ int ProductHelper::configureHwInfoDrm(const HardwareInfo *inHwInfo, HardwareInfo
outHwInfo->capabilityTable.maxRenderFrequency = maxGpuFreq; outHwInfo->capabilityTable.maxRenderFrequency = maxGpuFreq;
outHwInfo->capabilityTable.ftrSvm = featureTable->flags.ftrSVM; outHwInfo->capabilityTable.ftrSvm = featureTable->flags.ftrSVM;
GfxCoreHelper &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>(); auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
outHwInfo->capabilityTable.ftrSupportsCoherency = false; outHwInfo->capabilityTable.ftrSupportsCoherency = false;
gfxCoreHelper.adjustDefaultEngineType(outHwInfo); gfxCoreHelper.adjustDefaultEngineType(outHwInfo, *this);
outHwInfo->capabilityTable.defaultEngineType = getChosenEngineType(*outHwInfo); outHwInfo->capabilityTable.defaultEngineType = getChosenEngineType(*outHwInfo);
drm->checkQueueSliceSupport(); drm->checkQueueSliceSupport();

View File

@@ -20,14 +20,13 @@ namespace NEO {
int ProductHelper::configureHwInfoWddm(const HardwareInfo *inHwInfo, HardwareInfo *outHwInfo, const RootDeviceEnvironment &rootDeviceEnvironment) { int ProductHelper::configureHwInfoWddm(const HardwareInfo *inHwInfo, HardwareInfo *outHwInfo, const RootDeviceEnvironment &rootDeviceEnvironment) {
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>(); auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
auto &compilerProductHelper = rootDeviceEnvironment.getHelper<CompilerProductHelper>(); auto &compilerProductHelper = rootDeviceEnvironment.getHelper<CompilerProductHelper>();
outHwInfo->capabilityTable.ftrSvm = outHwInfo->featureTable.flags.ftrSVM; outHwInfo->capabilityTable.ftrSvm = outHwInfo->featureTable.flags.ftrSVM;
gfxCoreHelper.adjustDefaultEngineType(outHwInfo); gfxCoreHelper.adjustDefaultEngineType(outHwInfo, *this);
outHwInfo->capabilityTable.defaultEngineType = getChosenEngineType(*outHwInfo); outHwInfo->capabilityTable.defaultEngineType = getChosenEngineType(*outHwInfo);
productHelper.setCapabilityCoherencyFlag(*outHwInfo, outHwInfo->capabilityTable.ftrSupportsCoherency); this->setCapabilityCoherencyFlag(*outHwInfo, outHwInfo->capabilityTable.ftrSupportsCoherency);
outHwInfo->capabilityTable.ftrSupportsCoherency &= inHwInfo->featureTable.flags.ftrL3IACoherency; outHwInfo->capabilityTable.ftrSupportsCoherency &= inHwInfo->featureTable.flags.ftrL3IACoherency;
PreemptionHelper::adjustDefaultPreemptionMode(outHwInfo->capabilityTable, PreemptionHelper::adjustDefaultPreemptionMode(outHwInfo->capabilityTable,

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021-2022 Intel Corporation * Copyright (C) 2021-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -93,7 +93,7 @@ const StackVec<uint32_t, 6> GfxCoreHelperHw<Family>::getThreadsPerEUConfigs() co
} }
template <> template <>
std::string GfxCoreHelperHw<Family>::getExtensions(const HardwareInfo &hwInfo) const { std::string GfxCoreHelperHw<Family>::getExtensions(const RootDeviceEnvironment &rootDeviceEnvironment) const {
std::string extensions; std::string extensions;
extensions += "cl_intel_dot_accumulate "; extensions += "cl_intel_dot_accumulate ";
extensions += "cl_intel_subgroup_local_block_io "; extensions += "cl_intel_subgroup_local_block_io ";

View File

@@ -110,7 +110,7 @@ EngineGroupType GfxCoreHelperHw<Family>::getEngineGroupType(aub_stream::EngineTy
} }
template <> template <>
void GfxCoreHelperHw<Family>::adjustDefaultEngineType(HardwareInfo *pHwInfo) { void GfxCoreHelperHw<Family>::adjustDefaultEngineType(HardwareInfo *pHwInfo, const ProductHelper &productHelper) {
if (!pHwInfo->featureTable.flags.ftrCCSNode) { if (!pHwInfo->featureTable.flags.ftrCCSNode) {
pHwInfo->capabilityTable.defaultEngineType = aub_stream::EngineType::ENGINE_CCCS; pHwInfo->capabilityTable.defaultEngineType = aub_stream::EngineType::ENGINE_CCCS;
} }
@@ -274,7 +274,7 @@ uint32_t GfxCoreHelperHw<Family>::getNumCacheRegions() const {
} }
template <> template <>
std::string GfxCoreHelperHw<Family>::getExtensions(const HardwareInfo &hwInfo) const { std::string GfxCoreHelperHw<Family>::getExtensions(const RootDeviceEnvironment &rootDeviceEnvironment) const {
std::string extensions; std::string extensions;
extensions += "cl_intel_create_buffer_with_properties "; extensions += "cl_intel_create_buffer_with_properties ";

View File

@@ -44,11 +44,11 @@ uint32_t GfxCoreHelperHw<Family>::getMetricsLibraryGenId() const {
} }
template <> template <>
void GfxCoreHelperHw<Family>::adjustDefaultEngineType(HardwareInfo *pHwInfo) { void GfxCoreHelperHw<Family>::adjustDefaultEngineType(HardwareInfo *pHwInfo, const ProductHelper &productHelper) {
if (!pHwInfo->featureTable.flags.ftrCCSNode) { if (!pHwInfo->featureTable.flags.ftrCCSNode) {
pHwInfo->capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS; pHwInfo->capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS;
} }
if (ProductHelper::get(pHwInfo->platform.eProductFamily)->isDefaultEngineTypeAdjustmentRequired(*pHwInfo)) { if (productHelper.isDefaultEngineTypeAdjustmentRequired(*pHwInfo)) {
pHwInfo->capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS; pHwInfo->capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS;
} }
} }
@@ -97,13 +97,14 @@ const StackVec<uint32_t, 6> GfxCoreHelperHw<Family>::getThreadsPerEUConfigs() co
} }
template <> template <>
std::string GfxCoreHelperHw<Family>::getExtensions(const HardwareInfo &hwInfo) const { std::string GfxCoreHelperHw<Family>::getExtensions(const RootDeviceEnvironment &rootDeviceEnvironment) const {
std::string extensions; std::string extensions;
extensions += "cl_intel_create_buffer_with_properties "; extensions += "cl_intel_create_buffer_with_properties ";
extensions += "cl_intel_dot_accumulate "; extensions += "cl_intel_dot_accumulate ";
extensions += "cl_intel_subgroup_local_block_io "; extensions += "cl_intel_subgroup_local_block_io ";
auto &productHelper = *ProductHelper::get(hwInfo.platform.eProductFamily); auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
auto &productHelper = rootDeviceEnvironment.template getHelper<ProductHelper>();
if (productHelper.isMatrixMultiplyAccumulateSupported(hwInfo)) { if (productHelper.isMatrixMultiplyAccumulateSupported(hwInfo)) {
extensions += "cl_intel_subgroup_matrix_multiply_accumulate "; extensions += "cl_intel_subgroup_matrix_multiply_accumulate ";
extensions += "cl_intel_subgroup_split_matrix_multiply_accumulate "; extensions += "cl_intel_subgroup_split_matrix_multiply_accumulate ";

View File

@@ -28,7 +28,9 @@ GEN11TEST_F(GfxCoreHelperTestGen11, WhenGettingPitchAlignmentForImageThenCorrect
GEN11TEST_F(GfxCoreHelperTestGen11, WhenAdjustingDefaultEngineTypeThenEngineTypeIsSet) { GEN11TEST_F(GfxCoreHelperTestGen11, WhenAdjustingDefaultEngineTypeThenEngineTypeIsSet) {
auto engineType = hardwareInfo.capabilityTable.defaultEngineType; auto engineType = hardwareInfo.capabilityTable.defaultEngineType;
auto &gfxCoreHelper = getHelper<GfxCoreHelper>(); auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo); auto &productHelper = getHelper<ProductHelper>();
gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo, productHelper);
EXPECT_EQ(engineType, hardwareInfo.capabilityTable.defaultEngineType); EXPECT_EQ(engineType, hardwareInfo.capabilityTable.defaultEngineType);
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2019-2022 Intel Corporation * Copyright (C) 2019-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -8,6 +8,7 @@
#include "shared/source/gen11/hw_cmds.h" #include "shared/source/gen11/hw_cmds.h"
#include "shared/source/os_interface/hw_info_config.h" #include "shared/source/os_interface/hw_info_config.h"
#include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/mocks/mock_execution_environment.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h"
#include "shared/test/common/test_macros/test.h" #include "shared/test/common/test_macros/test.h"
@@ -18,11 +19,13 @@ using namespace NEO;
using Gen11SamplerTest = ::testing::Test; using Gen11SamplerTest = ::testing::Test;
GEN11TEST_F(Gen11SamplerTest, WhenAppendingSamplerStateParamsThenStateIsNotChanged) { GEN11TEST_F(Gen11SamplerTest, WhenAppendingSamplerStateParamsThenStateIsNotChanged) {
typedef typename FamilyType::SAMPLER_STATE SAMPLER_STATE; using SAMPLER_STATE = typename FamilyType::SAMPLER_STATE;
MockExecutionEnvironment mockExecutionEnvironment{};
auto &rootDeviceEnvironment = *mockExecutionEnvironment.rootDeviceEnvironments[0];
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
auto stateWithoutAppendedParams = FamilyType::cmdInitSamplerState; auto stateWithoutAppendedParams = FamilyType::cmdInitSamplerState;
auto stateWithAppendedParams = FamilyType::cmdInitSamplerState; auto stateWithAppendedParams = FamilyType::cmdInitSamplerState;
EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0); EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0);
ProductHelper::get(defaultHwInfo->platform.eProductFamily)->adjustSamplerState(&stateWithAppendedParams, *defaultHwInfo); productHelper.adjustSamplerState(&stateWithAppendedParams, *defaultHwInfo);
EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0); EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0);
} }

View File

@@ -24,7 +24,7 @@ DG1TEST_F(GfxCoreHelperTestDg1, givenDg1SteppingA0WhenAdjustDefaultEngineTypeCal
hardwareInfo.featureTable.flags.ftrCCSNode = true; hardwareInfo.featureTable.flags.ftrCCSNode = true;
hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hardwareInfo); hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hardwareInfo);
gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo); gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo, productHelper);
EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType); EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType);
} }
@@ -34,7 +34,7 @@ DG1TEST_F(GfxCoreHelperTestDg1, givenDg1SteppingBWhenAdjustDefaultEngineTypeCall
hardwareInfo.featureTable.flags.ftrCCSNode = true; hardwareInfo.featureTable.flags.ftrCCSNode = true;
hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hardwareInfo); hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hardwareInfo);
gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo); gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo, productHelper);
EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType); EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType);
} }

View File

@@ -21,7 +21,7 @@ RKLTEST_F(GfxCoreHelperTestRkl, givenRklSteppingA0WhenAdjustDefaultEngineTypeCal
hardwareInfo.featureTable.flags.ftrCCSNode = true; hardwareInfo.featureTable.flags.ftrCCSNode = true;
hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hardwareInfo); hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hardwareInfo);
gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo); gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo, productHelper);
EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType); EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType);
} }
@@ -32,7 +32,7 @@ RKLTEST_F(GfxCoreHelperTestRkl, givenRklSteppingBWhenAdjustDefaultEngineTypeCall
hardwareInfo.featureTable.flags.ftrCCSNode = true; hardwareInfo.featureTable.flags.ftrCCSNode = true;
hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hardwareInfo); hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hardwareInfo);
gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo); gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo, productHelper);
EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType); EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType);
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2019-2022 Intel Corporation * Copyright (C) 2019-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -20,7 +20,7 @@ TGLLPTEST_F(GfxCoreHelperTestGen12Lp, givenTgllpSteppingA0WhenAdjustDefaultEngin
hardwareInfo.featureTable.flags.ftrCCSNode = true; hardwareInfo.featureTable.flags.ftrCCSNode = true;
hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hardwareInfo); hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hardwareInfo);
gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo); gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo, productHelper);
EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType); EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType);
} }
@@ -31,7 +31,7 @@ TGLLPTEST_F(GfxCoreHelperTestGen12Lp, givenTgllpSteppingBWhenAdjustDefaultEngine
hardwareInfo.featureTable.flags.ftrCCSNode = true; hardwareInfo.featureTable.flags.ftrCCSNode = true;
hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A1, hardwareInfo); hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A1, hardwareInfo);
gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo); gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo, productHelper);
EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType); EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType);
} }
@@ -43,7 +43,7 @@ TGLLPTEST_F(GfxCoreHelperTestGen12Lp, givenTgllWhenWaForDefaultEngineIsNotApplie
hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hardwareInfo); hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hardwareInfo);
hardwareInfo.platform.eProductFamily = IGFX_UNKNOWN; hardwareInfo.platform.eProductFamily = IGFX_UNKNOWN;
gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo); gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo, productHelper);
EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType); EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType);
} }

View File

@@ -31,7 +31,8 @@ GEN8TEST_F(GfxCoreHelperTestGen8, WhenGettingPitchAlignmentForImageThenCorrectVa
GEN8TEST_F(GfxCoreHelperTestGen8, WhenAdjustingDefaultEngineTypeThenEngineTypeIsSet) { GEN8TEST_F(GfxCoreHelperTestGen8, WhenAdjustingDefaultEngineTypeThenEngineTypeIsSet) {
auto engineType = hardwareInfo.capabilityTable.defaultEngineType; auto engineType = hardwareInfo.capabilityTable.defaultEngineType;
auto &gfxCoreHelper = getHelper<GfxCoreHelper>(); auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo); auto &productHelper = getHelper<ProductHelper>();
gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo, productHelper);
EXPECT_EQ(engineType, hardwareInfo.capabilityTable.defaultEngineType); EXPECT_EQ(engineType, hardwareInfo.capabilityTable.defaultEngineType);
} }
@@ -59,5 +60,6 @@ GEN8TEST_F(MemorySynchronizatiopCommandsTestsGen8, WhenProgrammingCacheFlushThen
using ProductHelperTestGen8 = Test<DeviceFixture>; using ProductHelperTestGen8 = Test<DeviceFixture>;
GEN8TEST_F(ProductHelperTestGen8, givenHwInfosWhenIsMatrixMultiplyAccumulateSupportedThenReturnFalse) { GEN8TEST_F(ProductHelperTestGen8, givenHwInfosWhenIsMatrixMultiplyAccumulateSupportedThenReturnFalse) {
EXPECT_FALSE(ProductHelper::get(productFamily)->isMatrixMultiplyAccumulateSupported(*defaultHwInfo)); auto &productHelper = getHelper<ProductHelper>();
EXPECT_FALSE(productHelper.isMatrixMultiplyAccumulateSupported(*defaultHwInfo));
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2022 Intel Corporation * Copyright (C) 2018-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -8,6 +8,7 @@
#include "shared/source/gen8/hw_cmds.h" #include "shared/source/gen8/hw_cmds.h"
#include "shared/source/os_interface/hw_info_config.h" #include "shared/source/os_interface/hw_info_config.h"
#include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/mocks/mock_execution_environment.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h"
#include "shared/test/common/test_macros/test.h" #include "shared/test/common/test_macros/test.h"
@@ -18,10 +19,15 @@ using namespace NEO;
using Gen8SamplerTest = ::testing::Test; using Gen8SamplerTest = ::testing::Test;
GEN8TEST_F(Gen8SamplerTest, WhenAppendingSamplerStateParamsThenStateIsNotChanged) { GEN8TEST_F(Gen8SamplerTest, WhenAppendingSamplerStateParamsThenStateIsNotChanged) {
typedef typename FamilyType::SAMPLER_STATE SAMPLER_STATE;
using SAMPLER_STATE = typename FamilyType::SAMPLER_STATE;
MockExecutionEnvironment mockExecutionEnvironment{};
auto &rootDeviceEnvironment = *mockExecutionEnvironment.rootDeviceEnvironments[0];
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
auto stateWithoutAppendedParams = FamilyType::cmdInitSamplerState; auto stateWithoutAppendedParams = FamilyType::cmdInitSamplerState;
auto stateWithAppendedParams = FamilyType::cmdInitSamplerState; auto stateWithAppendedParams = FamilyType::cmdInitSamplerState;
EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0); EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0);
ProductHelper::get(defaultHwInfo->platform.eProductFamily)->adjustSamplerState(&stateWithAppendedParams, *defaultHwInfo); productHelper.adjustSamplerState(&stateWithAppendedParams, *defaultHwInfo);
EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0); EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0);
} }

View File

@@ -33,7 +33,8 @@ GEN9TEST_F(GfxCoreHelperTestGen9, WhenGettingPitchAlignmentForImageThenCorrectVa
GEN9TEST_F(GfxCoreHelperTestGen9, WhenAdjustingDefaultEngineTypeThenEngineTypeIsSet) { GEN9TEST_F(GfxCoreHelperTestGen9, WhenAdjustingDefaultEngineTypeThenEngineTypeIsSet) {
auto engineType = hardwareInfo.capabilityTable.defaultEngineType; auto engineType = hardwareInfo.capabilityTable.defaultEngineType;
auto &gfxCoreHelper = getHelper<GfxCoreHelper>(); auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo); auto &productHelper = getHelper<ProductHelper>();
gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo, productHelper);
EXPECT_EQ(engineType, hardwareInfo.capabilityTable.defaultEngineType); EXPECT_EQ(engineType, hardwareInfo.capabilityTable.defaultEngineType);
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2022 Intel Corporation * Copyright (C) 2018-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -8,6 +8,7 @@
#include "shared/source/gen9/hw_cmds.h" #include "shared/source/gen9/hw_cmds.h"
#include "shared/source/os_interface/hw_info_config.h" #include "shared/source/os_interface/hw_info_config.h"
#include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/mocks/mock_execution_environment.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h"
#include "shared/test/common/test_macros/test.h" #include "shared/test/common/test_macros/test.h"
@@ -18,10 +19,14 @@ using namespace NEO;
using Gen9SamplerTest = ::testing::Test; using Gen9SamplerTest = ::testing::Test;
GEN9TEST_F(Gen9SamplerTest, WhenAppendingSamplerStateParamsThenStateIsNotChanged) { GEN9TEST_F(Gen9SamplerTest, WhenAppendingSamplerStateParamsThenStateIsNotChanged) {
typedef typename FamilyType::SAMPLER_STATE SAMPLER_STATE; using SAMPLER_STATE = typename FamilyType::SAMPLER_STATE;
MockExecutionEnvironment mockExecutionEnvironment{};
auto &rootDeviceEnvironment = *mockExecutionEnvironment.rootDeviceEnvironments[0];
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
auto stateWithoutAppendedParams = FamilyType::cmdInitSamplerState; auto stateWithoutAppendedParams = FamilyType::cmdInitSamplerState;
auto stateWithAppendedParams = FamilyType::cmdInitSamplerState; auto stateWithAppendedParams = FamilyType::cmdInitSamplerState;
EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0); EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0);
ProductHelper::get(defaultHwInfo->platform.eProductFamily)->adjustSamplerState(&stateWithAppendedParams, *defaultHwInfo); productHelper.adjustSamplerState(&stateWithAppendedParams, *defaultHwInfo);
EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0); EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0);
} }

View File

@@ -41,7 +41,9 @@ HWTEST2_F(GfxCoreHelperTestPvcAndLater, givenRenderEngineWhenRemapCalledThenUseC
hardwareInfo.featureTable.flags.ftrCCSNode = false; hardwareInfo.featureTable.flags.ftrCCSNode = false;
auto &gfxCoreHelper = getHelper<GfxCoreHelper>(); auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo); auto &productHelper = getHelper<ProductHelper>();
gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo, productHelper);
auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment(); auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment();
EXPECT_EQ(aub_stream::EngineType::ENGINE_CCCS, EngineHelpers::remapEngineTypeToHwSpecific(aub_stream::EngineType::ENGINE_RCS, rootDeviceEnvironment)); EXPECT_EQ(aub_stream::EngineType::ENGINE_CCCS, EngineHelpers::remapEngineTypeToHwSpecific(aub_stream::EngineType::ENGINE_RCS, rootDeviceEnvironment));

View File

@@ -271,7 +271,8 @@ HWTEST2_F(GmmTestsDG2, givenGmmForImageWithForceLocalMemThenNonLocalIsSetToFalse
using WddmLinuxConfigureDeviceAddressSpaceTest = WddmLinuxTest; using WddmLinuxConfigureDeviceAddressSpaceTest = WddmLinuxTest;
TEST_F(WddmLinuxConfigureDeviceAddressSpaceTest, givenSvmAddressSpaceThenReserveGpuVAForUSM) { TEST_F(WddmLinuxConfigureDeviceAddressSpaceTest, givenSvmAddressSpaceThenReserveGpuVAForUSM) {
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace < MemoryConstants::max64BitAppAddress || NEO::ProductHelper::get(productFamily)->overrideGfxPartitionLayoutForWsl()) { auto &productHelper = mockExecEnv.rootDeviceEnvironments[0]->getHelper<NEO::ProductHelper>();
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace < MemoryConstants::max64BitAppAddress || productHelper.overrideGfxPartitionLayoutForWsl()) {
GTEST_SKIP(); GTEST_SKIP();
} }
@@ -288,7 +289,8 @@ TEST_F(WddmLinuxConfigureDeviceAddressSpaceTest, givenSvmAddressSpaceThenReserve
} }
TEST_F(WddmLinuxConfigureDeviceAddressSpaceTest, givenPreReservedSvmAddressSpaceThenMakeSureWholeGpuVAForUSMIsReservedAndProperlyAligned) { TEST_F(WddmLinuxConfigureDeviceAddressSpaceTest, givenPreReservedSvmAddressSpaceThenMakeSureWholeGpuVAForUSMIsReservedAndProperlyAligned) {
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace < MemoryConstants::max64BitAppAddress || NEO::ProductHelper::get(productFamily)->overrideGfxPartitionLayoutForWsl()) { auto &productHelper = mockExecEnv.rootDeviceEnvironments[0]->getHelper<NEO::ProductHelper>();
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace < MemoryConstants::max64BitAppAddress || productHelper.overrideGfxPartitionLayoutForWsl()) {
GTEST_SKIP(); GTEST_SKIP();
} }
@@ -332,7 +334,8 @@ TEST_F(WddmLinuxConfigureDeviceAddressSpaceTest, givenNonSvmAddressSpaceThenRese
using WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest = WddmLinuxConfigureDeviceAddressSpaceTest; using WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest = WddmLinuxConfigureDeviceAddressSpaceTest;
TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, whenFailedToReadProceesPartitionLayoutThenFail) { TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, whenFailedToReadProceesPartitionLayoutThenFail) {
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !NEO::ProductHelper::get(productFamily)->overrideGfxPartitionLayoutForWsl()) { auto &productHelper = mockExecEnv.rootDeviceEnvironments[0]->getHelper<NEO::ProductHelper>();
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !productHelper.overrideGfxPartitionLayoutForWsl()) {
GTEST_SKIP(); GTEST_SKIP();
} }
@@ -358,7 +361,8 @@ TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, whenFailedToTransla
} }
}; };
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !NEO::ProductHelper::get(productFamily)->overrideGfxPartitionLayoutForWsl()) { auto &productHelper = mockExecEnv.rootDeviceEnvironments[0]->getHelper<NEO::ProductHelper>();
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !productHelper.overrideGfxPartitionLayoutForWsl()) {
GTEST_SKIP(); GTEST_SKIP();
} }
@@ -376,7 +380,8 @@ TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, whenFailedToTransla
} }
TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenPreconfiguredAddressSpaceFromKmdThenUseIt) { TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenPreconfiguredAddressSpaceFromKmdThenUseIt) {
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !NEO::ProductHelper::get(productFamily)->overrideGfxPartitionLayoutForWsl()) { auto &productHelper = mockExecEnv.rootDeviceEnvironments[0]->getHelper<NEO::ProductHelper>();
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !productHelper.overrideGfxPartitionLayoutForWsl()) {
GTEST_SKIP(); GTEST_SKIP();
} }
@@ -396,7 +401,8 @@ TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenPreconfiguredA
} }
TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenNoPreconfiguredAddressSpaceFromKmdThenConfigureOneAndUpdateKmdItInKmd) { TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenNoPreconfiguredAddressSpaceFromKmdThenConfigureOneAndUpdateKmdItInKmd) {
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !NEO::ProductHelper::get(productFamily)->overrideGfxPartitionLayoutForWsl()) { auto &productHelper = mockExecEnv.rootDeviceEnvironments[0]->getHelper<NEO::ProductHelper>();
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !productHelper.overrideGfxPartitionLayoutForWsl()) {
GTEST_SKIP(); GTEST_SKIP();
} }
@@ -413,7 +419,8 @@ TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenNoPreconfigure
} }
TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenNoPreconfiguredAddressSpaceFromKmdWhenFailedToReserveValidCpuAddressRangeThenFail) { TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenNoPreconfiguredAddressSpaceFromKmdWhenFailedToReserveValidCpuAddressRangeThenFail) {
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !NEO::ProductHelper::get(productFamily)->overrideGfxPartitionLayoutForWsl()) { auto &productHelper = mockExecEnv.rootDeviceEnvironments[0]->getHelper<NEO::ProductHelper>();
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !productHelper.overrideGfxPartitionLayoutForWsl()) {
GTEST_SKIP(); GTEST_SKIP();
} }
@@ -433,7 +440,8 @@ TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenNoPreconfigure
} }
TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenNoPreconfiguredAddressSpaceFromKmdWhenUpdatingItInKmdAndFailedToTranslateThenFail) { TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenNoPreconfiguredAddressSpaceFromKmdWhenUpdatingItInKmdAndFailedToTranslateThenFail) {
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !NEO::ProductHelper::get(productFamily)->overrideGfxPartitionLayoutForWsl()) { auto &productHelper = mockExecEnv.rootDeviceEnvironments[0]->getHelper<NEO::ProductHelper>();
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !productHelper.overrideGfxPartitionLayoutForWsl()) {
GTEST_SKIP(); GTEST_SKIP();
} }
@@ -462,7 +470,8 @@ TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenNoPreconfigure
} }
TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenNoPreconfiguredAddressSpaceFromKmdWhenKmdGotJustUpdatedByDifferentClientThenUseItsAddressSpaceConfiguration) { TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenNoPreconfiguredAddressSpaceFromKmdWhenKmdGotJustUpdatedByDifferentClientThenUseItsAddressSpaceConfiguration) {
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !NEO::ProductHelper::get(productFamily)->overrideGfxPartitionLayoutForWsl()) { auto &productHelper = mockExecEnv.rootDeviceEnvironments[0]->getHelper<NEO::ProductHelper>();
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !productHelper.overrideGfxPartitionLayoutForWsl()) {
GTEST_SKIP(); GTEST_SKIP();
} }
@@ -484,7 +493,8 @@ TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenNoPreconfigure
} }
TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenNoPreconfiguredAddressSpaceFromKmdThenConfigureOneBasedOnAligmentAndSizeRequirements) { TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenNoPreconfiguredAddressSpaceFromKmdThenConfigureOneBasedOnAligmentAndSizeRequirements) {
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !NEO::ProductHelper::get(productFamily)->overrideGfxPartitionLayoutForWsl()) { auto &productHelper = mockExecEnv.rootDeviceEnvironments[0]->getHelper<NEO::ProductHelper>();
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !productHelper.overrideGfxPartitionLayoutForWsl()) {
GTEST_SKIP(); GTEST_SKIP();
} }
@@ -523,7 +533,8 @@ TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenNoPreconfigure
} }
TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenTwoSvmAddressSpacesThenReserveGpuVAForBoth) { TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenTwoSvmAddressSpacesThenReserveGpuVAForBoth) {
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !NEO::ProductHelper::get(productFamily)->overrideGfxPartitionLayoutForWsl()) { auto &productHelper = mockExecEnv.rootDeviceEnvironments[0]->getHelper<NEO::ProductHelper>();
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !productHelper.overrideGfxPartitionLayoutForWsl()) {
GTEST_SKIP(); GTEST_SKIP();
} }
@@ -565,7 +576,8 @@ TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenTwoSvmAddressS
} }
TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenTwoSvmAddressSpacesWhenReservGpuVAForFirstOneFailsThenFail) { TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenTwoSvmAddressSpacesWhenReservGpuVAForFirstOneFailsThenFail) {
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !NEO::ProductHelper::get(productFamily)->overrideGfxPartitionLayoutForWsl()) { auto &productHelper = mockExecEnv.rootDeviceEnvironments[0]->getHelper<NEO::ProductHelper>();
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !productHelper.overrideGfxPartitionLayoutForWsl()) {
GTEST_SKIP(); GTEST_SKIP();
} }
@@ -586,7 +598,8 @@ TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenTwoSvmAddressS
} }
TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenTwoSvmAddressSpacesWhenReservGpuVAForSecondOneFailsThenFail) { TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenTwoSvmAddressSpacesWhenReservGpuVAForSecondOneFailsThenFail) {
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !NEO::ProductHelper::get(productFamily)->overrideGfxPartitionLayoutForWsl()) { auto &productHelper = mockExecEnv.rootDeviceEnvironments[0]->getHelper<NEO::ProductHelper>();
if (NEO::hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max64BitAppAddress && !productHelper.overrideGfxPartitionLayoutForWsl()) {
GTEST_SKIP(); GTEST_SKIP();
} }

View File

@@ -25,8 +25,9 @@ using GfxCoreHelperTestDg2 = ::testing::Test;
DG2TEST_F(GfxCoreHelperTestDg2, whenGetExtensionsIsCalledThenMatrixMultiplyAccumulateExtensionsAreReturned) { DG2TEST_F(GfxCoreHelperTestDg2, whenGetExtensionsIsCalledThenMatrixMultiplyAccumulateExtensionsAreReturned) {
MockExecutionEnvironment mockExecutionEnvironment{}; MockExecutionEnvironment mockExecutionEnvironment{};
auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<GfxCoreHelper>(); auto &rootDeviceEnvironment = *mockExecutionEnvironment.rootDeviceEnvironments[0];
auto extensions = gfxCoreHelper.getExtensions(*defaultHwInfo); auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
auto extensions = gfxCoreHelper.getExtensions(rootDeviceEnvironment);
EXPECT_TRUE(hasSubstr(extensions, std::string("cl_intel_subgroup_matrix_multiply_accumulate"))); EXPECT_TRUE(hasSubstr(extensions, std::string("cl_intel_subgroup_matrix_multiply_accumulate")));
EXPECT_TRUE(hasSubstr(extensions, std::string("cl_intel_subgroup_split_matrix_multiply_accumulate"))); EXPECT_TRUE(hasSubstr(extensions, std::string("cl_intel_subgroup_split_matrix_multiply_accumulate")));

View File

@@ -115,13 +115,14 @@ DG2TEST_F(ProductHelperTestDg2, whenAdjustingDefaultEngineTypeThenSelectEngineTy
auto hwInfo = *defaultHwInfo; auto hwInfo = *defaultHwInfo;
hwInfo.featureTable.flags.ftrCCSNode = true; hwInfo.featureTable.flags.ftrCCSNode = true;
auto &gfxCoreHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper<GfxCoreHelper>(); auto &gfxCoreHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper<GfxCoreHelper>();
auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper<ProductHelper>();
for (uint8_t revision : {REVISION_A0, REVISION_A1, REVISION_B, REVISION_C}) { for (uint8_t revision : {REVISION_A0, REVISION_A1, REVISION_B, REVISION_C}) {
for (auto deviceId : {dg2G10DeviceIds[0], dg2G11DeviceIds[0], dg2G12DeviceIds[0]}) { for (auto deviceId : {dg2G10DeviceIds[0], dg2G11DeviceIds[0], dg2G12DeviceIds[0]}) {
hwInfo.platform.usRevId = productHelper->getHwRevIdFromStepping(revision, hwInfo); hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(revision, hwInfo);
hwInfo.platform.usDeviceID = deviceId; hwInfo.platform.usDeviceID = deviceId;
hwInfo.capabilityTable.defaultEngineType = defaultHwInfo->capabilityTable.defaultEngineType; hwInfo.capabilityTable.defaultEngineType = defaultHwInfo->capabilityTable.defaultEngineType;
gfxCoreHelper.adjustDefaultEngineType(&hwInfo); gfxCoreHelper.adjustDefaultEngineType(&hwInfo, productHelper);
if (DG2::isG10(hwInfo) && revision < REVISION_B) { if (DG2::isG10(hwInfo) && revision < REVISION_B) {
EXPECT_EQ(aub_stream::ENGINE_RCS, hwInfo.capabilityTable.defaultEngineType); EXPECT_EQ(aub_stream::ENGINE_RCS, hwInfo.capabilityTable.defaultEngineType);
} else { } else {

View File

@@ -14,6 +14,7 @@
#include "shared/test/common/helpers/hw_helper_tests.h" #include "shared/test/common/helpers/hw_helper_tests.h"
#include "shared/test/common/helpers/variable_backup.h" #include "shared/test/common/helpers/variable_backup.h"
#include "shared/test/common/mocks/mock_device.h" #include "shared/test/common/mocks/mock_device.h"
#include "shared/test/common/mocks/mock_execution_environment.h"
#include "shared/test/common/mocks/ult_device_factory.h" #include "shared/test/common/mocks/ult_device_factory.h"
#include "shared/test/common/test_macros/hw_test.h" #include "shared/test/common/test_macros/hw_test.h"
@@ -22,14 +23,16 @@ using namespace NEO;
using GfxCoreHelperTestMtl = GfxCoreHelperTest; using GfxCoreHelperTestMtl = GfxCoreHelperTest;
MTLTEST_F(GfxCoreHelperTestMtl, givenVariousMtlReleasesWhenGetExtensionsIsCalledThenMatrixMultiplyAccumulateExtensionsAreCorrectlyReported) { MTLTEST_F(GfxCoreHelperTestMtl, givenVariousMtlReleasesWhenGetExtensionsIsCalledThenMatrixMultiplyAccumulateExtensionsAreCorrectlyReported) {
auto &gfxCoreHelper = getHelper<GfxCoreHelper>(); MockExecutionEnvironment mockExecutionEnvironment{};
auto hwInfo = *defaultHwInfo; auto &rootDeviceEnvironment = *mockExecutionEnvironment.rootDeviceEnvironments[0];
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo();
unsigned int gmdReleases[] = {70, 71, 72, 73}; unsigned int gmdReleases[] = {70, 71, 72, 73};
hwInfo.ipVersion.architecture = 12; hwInfo.ipVersion.architecture = 12;
for (auto gmdRelease : gmdReleases) { for (auto gmdRelease : gmdReleases) {
hwInfo.ipVersion.release = gmdRelease; hwInfo.ipVersion.release = gmdRelease;
auto extensions = gfxCoreHelper.getExtensions(hwInfo); auto extensions = gfxCoreHelper.getExtensions(rootDeviceEnvironment);
EXPECT_EQ(!MTL::isLpg(hwInfo), hasSubstr(extensions, std::string("cl_intel_subgroup_matrix_multiply_accumulate"))); EXPECT_EQ(!MTL::isLpg(hwInfo), hasSubstr(extensions, std::string("cl_intel_subgroup_matrix_multiply_accumulate")));
EXPECT_EQ(!MTL::isLpg(hwInfo), hasSubstr(extensions, std::string("cl_intel_subgroup_split_matrix_multiply_accumulate"))); EXPECT_EQ(!MTL::isLpg(hwInfo), hasSubstr(extensions, std::string("cl_intel_subgroup_split_matrix_multiply_accumulate")));