mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 08:53:55 +08:00
Correct getDeviceMemoryName
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com> Related-To: NEO-6112
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d2014b2869
commit
4f15365dae
@@ -272,10 +272,9 @@ ze_result_t DeviceImp::getMemoryProperties(uint32_t *pCount, ze_device_memory_pr
|
||||
}
|
||||
|
||||
const auto &deviceInfo = this->neoDevice->getDeviceInfo();
|
||||
|
||||
strcpy_s(pMemProperties->name, ZE_MAX_DEVICE_NAME, getHwHelper().getDeviceMemoryName().c_str());
|
||||
auto &hwInfo = this->getHwInfo();
|
||||
auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
strcpy_s(pMemProperties->name, ZE_MAX_DEVICE_NAME, hwInfoConfig.getDeviceMemoryName().c_str());
|
||||
pMemProperties->maxClockRate = hwInfoConfig.getDeviceMemoryMaxClkRate(&hwInfo);
|
||||
pMemProperties->maxBusWidth = deviceInfo.addressBits;
|
||||
if (NEO::ImplicitScalingHelper::isImplicitScalingEnabled(this->getNEODevice()->getDeviceBitfield(), true) ||
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
#include "opencl/source/sampler/sampler.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
void HwInfoConfigTest::SetUp() {
|
||||
@@ -207,3 +209,9 @@ HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedForDefaultEngineTypeAdjustm
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily);
|
||||
EXPECT_FALSE(hwInfoConfig.isDefaultEngineTypeAdjustmentRequired(pInHwInfo));
|
||||
}
|
||||
|
||||
HWTEST_F(HwInfoConfigTest, whenCallingGetDeviceMemoryNameThenDdrIsReturned) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily);
|
||||
auto deviceMemoryName = hwInfoConfig.getDeviceMemoryName();
|
||||
EXPECT_THAT(deviceMemoryName, testing::HasSubstr(std::string("DDR")));
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ if(TESTS_XE_HP_SDV)
|
||||
set(IGDRCL_SRCS_tests_xe_hp_core_xehp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cache_flush_tests_xehp.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/excludes_xehp.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/get_device_info_xehp.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_tests_xehp.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_tests_xehp.inl
|
||||
|
||||
10
opencl/test/unit_test/xe_hp_core/xehp/excludes_xehp.cpp
Normal file
10
opencl/test/unit_test/xe_hp_core/xehp/excludes_xehp.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "test.h"
|
||||
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, whenCallingGetDeviceMemoryNameThenDdrIsReturned, IGFX_XE_HP_SDV);
|
||||
@@ -14,6 +14,8 @@
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
#include "test.h"
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using XeHPHwInfoConfig = ::testing::Test;
|
||||
@@ -66,6 +68,12 @@ XEHPTEST_F(XeHPHwInfoConfig, givenDebugVariableSetWhenConfiguringThenEnableRcs)
|
||||
EXPECT_TRUE(hwInfo.featureTable.ftrRcsNode);
|
||||
}
|
||||
|
||||
XEHPTEST_F(XeHPHwInfoConfig, givenXeHpWhenCallingGetDeviceMemoryNameThenHbmIsReturned) {
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
auto deviceMemoryName = hwInfoConfig->getDeviceMemoryName();
|
||||
EXPECT_THAT(deviceMemoryName, testing::HasSubstr(std::string("HBM")));
|
||||
}
|
||||
|
||||
using XeHPHwHelperTest = HwHelperTest;
|
||||
|
||||
XEHPTEST_F(XeHPHwHelperTest, givenXeHPMultiConfigWhenAllowRenderCompressionIsCalledThenCorrectValueIsReturned) {
|
||||
|
||||
@@ -93,7 +93,6 @@ class HwHelper {
|
||||
virtual const StackVec<uint32_t, 6> getThreadsPerEUConfigs() const = 0;
|
||||
virtual bool getEnableLocalMemory(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual std::string getExtensions() const = 0;
|
||||
virtual std::string getDeviceMemoryName() const = 0;
|
||||
static uint32_t getMaxThreadsForVfe(const HardwareInfo &hwInfo);
|
||||
virtual uint32_t getMetricsLibraryGenId() const = 0;
|
||||
virtual uint32_t getMocsIndex(const GmmHelper &gmmHelper, bool l3enabled, bool l1enabled) const = 0;
|
||||
@@ -272,8 +271,6 @@ class HwHelperHw : public HwHelper {
|
||||
|
||||
std::string getExtensions() const override;
|
||||
|
||||
std::string getDeviceMemoryName() const override;
|
||||
|
||||
uint32_t getMetricsLibraryGenId() const override;
|
||||
|
||||
uint32_t getMocsIndex(const GmmHelper &gmmHelper, bool l3enabled, bool l1enabled) const override;
|
||||
|
||||
@@ -134,9 +134,4 @@ bool HwHelperHw<GfxFamily>::additionalPipeControlArgsRequired() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
std::string HwHelperHw<GfxFamily>::getDeviceMemoryName() const {
|
||||
return "DDR";
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -187,10 +187,4 @@ inline bool HwHelperHw<GfxFamily>::preferSmallWorkgroupSizeForKernel(const size_
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
std::string HwHelperHw<GfxFamily>::getDeviceMemoryName() const {
|
||||
return "HBM";
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -52,6 +52,7 @@ class HwInfoConfig {
|
||||
virtual uint32_t getAubStreamSteppingFromHwRevId(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual void setAdditionalPipelineSelectFields(void *pipelineSelectCmd, const PipelineSelectArgs &pipelineSelectArgs, const HardwareInfo &hwInfo) = 0;
|
||||
virtual bool isDefaultEngineTypeAdjustmentRequired(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual std::string getDeviceMemoryName() const = 0;
|
||||
|
||||
uint32_t threadsPerEu;
|
||||
};
|
||||
@@ -86,6 +87,7 @@ class HwInfoConfigHw : public HwInfoConfig {
|
||||
uint32_t getAubStreamSteppingFromHwRevId(const HardwareInfo &hwInfo) const override;
|
||||
void setAdditionalPipelineSelectFields(void *pipelineSelectCmd, const PipelineSelectArgs &pipelineSelectArgs, const HardwareInfo &hwInfo) override;
|
||||
bool isDefaultEngineTypeAdjustmentRequired(const HardwareInfo &hwInfo) const override;
|
||||
std::string getDeviceMemoryName() const override;
|
||||
|
||||
protected:
|
||||
HwInfoConfigHw() = default;
|
||||
|
||||
@@ -140,4 +140,10 @@ template <PRODUCT_FAMILY gfxProduct>
|
||||
bool HwInfoConfigHw<gfxProduct>::isDefaultEngineTypeAdjustmentRequired(const HardwareInfo &hwInfo) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
std::string HwInfoConfigHw<gfxProduct>::getDeviceMemoryName() const {
|
||||
return "DDR";
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -48,4 +48,9 @@ void HwInfoConfigHw<IGFX_XE_HP_SDV>::adjustSamplerState(void *sampler, const Har
|
||||
if (DebugManager.flags.ForceSamplerLowFilteringPrecision.get()) {
|
||||
samplerState->setLowQualityFilter(SAMPLER_STATE::LOW_QUALITY_FILTER_ENABLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
std::string HwInfoConfigHw<IGFX_XE_HP_SDV>::getDeviceMemoryName() const {
|
||||
return "HBM";
|
||||
}
|
||||
|
||||
@@ -117,6 +117,10 @@ uint32_t HwInfoConfigHw<IGFX_UNKNOWN>::getAubStreamSteppingFromHwRevId(const Har
|
||||
return AubMemDump::SteppingValues::K;
|
||||
}
|
||||
}
|
||||
template <>
|
||||
std::string HwInfoConfigHw<IGFX_UNKNOWN>::getDeviceMemoryName() const {
|
||||
return "";
|
||||
}
|
||||
|
||||
template <>
|
||||
void HwInfoConfigHw<IGFX_UNKNOWN>::setAdditionalPipelineSelectFields(void *pipelineSelectCmd, const PipelineSelectArgs &pipelineSelectArgs, const HardwareInfo &hwInfo) {
|
||||
|
||||
Reference in New Issue
Block a user