mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Add HardwareInfo argument to setupHardwareCapabilities method
Change-Id: Iaf75459402d4f1ec3048646d646b130dcc710b2f
This commit is contained in:

committed by
sys_ocldev

parent
b59e3aec14
commit
83537d55bf
@ -93,7 +93,7 @@ Device::Device(const HardwareInfo &hwInfo, ExecutionEnvironment *executionEnviro
|
||||
}
|
||||
this->executionEnvironment->incRefInternal();
|
||||
auto &hwHelper = HwHelper::get(hwInfo.pPlatform->eRenderCoreFamily);
|
||||
hwHelper.setupHardwareCapabilities(&this->hardwareCapabilities);
|
||||
hwHelper.setupHardwareCapabilities(&this->hardwareCapabilities, hwInfo);
|
||||
}
|
||||
|
||||
Device::~Device() {
|
||||
|
@ -38,7 +38,7 @@ bool HwHelperHw<Family>::setupPreemptionRegisters(HardwareInfo *pHwInfo, bool en
|
||||
}
|
||||
|
||||
template <>
|
||||
void HwHelperHw<Family>::setupHardwareCapabilities(HardwareCapabilities *caps) {
|
||||
void HwHelperHw<Family>::setupHardwareCapabilities(HardwareCapabilities *caps, const HardwareInfo &hwInfo) {
|
||||
caps->image3DMaxHeight = 2048;
|
||||
caps->image3DMaxWidth = 2048;
|
||||
caps->maxMemAllocSize = 2 * MemoryConstants::gigaByte - 8 * MemoryConstants::megaByte;
|
||||
|
@ -43,7 +43,7 @@ class HwHelper {
|
||||
virtual void setCapabilityCoherencyFlag(const HardwareInfo *pHwInfo, bool &coherencyFlag) = 0;
|
||||
virtual bool setupPreemptionRegisters(HardwareInfo *pHwInfo, bool enable) = 0;
|
||||
virtual void adjustDefaultEngineType(HardwareInfo *pHwInfo) = 0;
|
||||
virtual void setupHardwareCapabilities(HardwareCapabilities *caps) = 0;
|
||||
virtual void setupHardwareCapabilities(HardwareCapabilities *caps, const HardwareInfo &hwInfo) = 0;
|
||||
virtual SipKernelType getSipKernelType(bool debuggingActive) = 0;
|
||||
virtual uint32_t getConfigureAddressSpaceMode() = 0;
|
||||
|
||||
@ -91,7 +91,7 @@ class HwHelperHw : public HwHelper {
|
||||
|
||||
void adjustDefaultEngineType(HardwareInfo *pHwInfo) override;
|
||||
|
||||
void setupHardwareCapabilities(HardwareCapabilities *caps) override;
|
||||
void setupHardwareCapabilities(HardwareCapabilities *caps, const HardwareInfo &hwInfo) override;
|
||||
|
||||
SipKernelType getSipKernelType(bool debuggingActive) override;
|
||||
|
||||
|
@ -35,7 +35,7 @@ void HwHelperHw<Family>::adjustDefaultEngineType(HardwareInfo *pHwInfo) {
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
void HwHelperHw<Family>::setupHardwareCapabilities(HardwareCapabilities *caps) {
|
||||
void HwHelperHw<Family>::setupHardwareCapabilities(HardwareCapabilities *caps, const HardwareInfo &hwInfo) {
|
||||
caps->image3DMaxHeight = 16384;
|
||||
caps->image3DMaxWidth = 16384;
|
||||
//With statefull messages we have an allocation cap of 4GB
|
||||
|
@ -355,7 +355,7 @@ TEST(Device_GetCaps, givenGlobalMemSizeWhenCalculatingMaxAllocSizeThenAdjustToHW
|
||||
|
||||
HardwareCapabilities hwCaps = {0};
|
||||
auto &hwHelper = HwHelper::get(platformDevices[0]->pPlatform->eRenderCoreFamily);
|
||||
hwHelper.setupHardwareCapabilities(&hwCaps);
|
||||
hwHelper.setupHardwareCapabilities(&hwCaps, *platformDevices[0]);
|
||||
|
||||
uint64_t expectedSize = std::max((caps.globalMemSize / 2), static_cast<uint64_t>(128ULL * MemoryConstants::megaByte));
|
||||
expectedSize = std::min(expectedSize, hwCaps.maxMemAllocSize);
|
||||
|
@ -78,7 +78,7 @@ GEN10TEST_F(HwHelperTestCnl, givenGen10PlatformWhenSetupHardwareCapabilitiesIsCa
|
||||
auto &helper = HwHelper::get(renderCoreFamily);
|
||||
|
||||
// Test default method implementation
|
||||
testDefaultImplementationOfSetupHardwareCapabilities(helper);
|
||||
testDefaultImplementationOfSetupHardwareCapabilities(helper, hwInfo);
|
||||
}
|
||||
|
||||
GEN10TEST_F(HwHelperTestCnl, whenGetConfigureAddressSpaceModeThenReturnZero) {
|
||||
|
@ -61,7 +61,7 @@ GEN8TEST_F(HwHelperTestBdw, adjustDefaultEngineType) {
|
||||
GEN8TEST_F(HwHelperTestBdw, givenGen8PlatformWhenSetupHardwareCapabilitiesIsCalledThenSpecificImplementationIsUsed) {
|
||||
auto &helper = HwHelper::get(renderCoreFamily);
|
||||
HardwareCapabilities hwCaps = {0};
|
||||
helper.setupHardwareCapabilities(&hwCaps);
|
||||
helper.setupHardwareCapabilities(&hwCaps, hwInfo);
|
||||
|
||||
EXPECT_EQ(2048u, hwCaps.image3DMaxHeight);
|
||||
EXPECT_EQ(2048u, hwCaps.image3DMaxWidth);
|
||||
|
@ -62,7 +62,7 @@ GEN9TEST_F(HwHelperTestSkl, givenGen9PlatformWhenSetupHardwareCapabilitiesIsCall
|
||||
auto &helper = HwHelper::get(renderCoreFamily);
|
||||
|
||||
// Test default method implementation
|
||||
testDefaultImplementationOfSetupHardwareCapabilities(helper);
|
||||
testDefaultImplementationOfSetupHardwareCapabilities(helper, hwInfo);
|
||||
}
|
||||
|
||||
GEN9TEST_F(HwHelperTestSkl, givenDebuggingActiveWhenSipKernelTypeIsQueriedThenDbgCsrLocalTypeIsReturned) {
|
||||
|
@ -23,10 +23,10 @@
|
||||
#include "runtime/helpers/hw_info.h"
|
||||
#include "unit_tests/helpers/hw_helper_tests.h"
|
||||
|
||||
void testDefaultImplementationOfSetupHardwareCapabilities(HwHelper &hwHelper) {
|
||||
void testDefaultImplementationOfSetupHardwareCapabilities(HwHelper &hwHelper, const HardwareInfo &hwInfo) {
|
||||
HardwareCapabilities hwCaps = {0};
|
||||
|
||||
hwHelper.setupHardwareCapabilities(&hwCaps);
|
||||
hwHelper.setupHardwareCapabilities(&hwCaps, hwInfo);
|
||||
|
||||
EXPECT_EQ(16384u, hwCaps.image3DMaxHeight);
|
||||
EXPECT_EQ(16384u, hwCaps.image3DMaxWidth);
|
||||
|
@ -40,4 +40,4 @@ class HwHelperTest : public testing::Test {
|
||||
HardwareInfo hwInfo;
|
||||
};
|
||||
|
||||
void testDefaultImplementationOfSetupHardwareCapabilities(HwHelper &hwHelper);
|
||||
void testDefaultImplementationOfSetupHardwareCapabilities(HwHelper &hwHelper, const HardwareInfo &hwInfo);
|
||||
|
@ -2535,7 +2535,7 @@ TEST_F(ProgramTests, givenNewProgramTheStatelessToStatefulBufferOffsetOtimizatio
|
||||
auto it = internalOpts.find("-cl-intel-has-buffer-offset-arg ");
|
||||
|
||||
HardwareCapabilities hwCaps = {0};
|
||||
HwHelper::get(prog.getDevice(0).getHardwareInfo().pPlatform->eRenderCoreFamily).setupHardwareCapabilities(&hwCaps);
|
||||
HwHelper::get(prog.getDevice(0).getHardwareInfo().pPlatform->eRenderCoreFamily).setupHardwareCapabilities(&hwCaps, prog.getDevice(0).getHardwareInfo());
|
||||
if (hwCaps.isStatelesToStatefullWithOffsetSupported) {
|
||||
EXPECT_NE(std::string::npos, it);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user