Add HardwareInfo argument to setupHardwareCapabilities method

Change-Id: Iaf75459402d4f1ec3048646d646b130dcc710b2f
This commit is contained in:
Hoppe, Mateusz
2018-08-23 17:42:35 +02:00
committed by sys_ocldev
parent b59e3aec14
commit 83537d55bf
11 changed files with 13 additions and 13 deletions

View File

@ -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() {

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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);

View File

@ -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) {

View File

@ -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);

View File

@ -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) {

View File

@ -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);

View File

@ -40,4 +40,4 @@ class HwHelperTest : public testing::Test {
HardwareInfo hwInfo;
};
void testDefaultImplementationOfSetupHardwareCapabilities(HwHelper &hwHelper);
void testDefaultImplementationOfSetupHardwareCapabilities(HwHelper &hwHelper, const HardwareInfo &hwInfo);

View File

@ -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 {