Don't use global ProductHelper getter in L0 1/n

Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2022-12-20 15:13:56 +00:00
committed by Compute-Runtime-Automation
parent 772dec81e4
commit 0e6cc86821
11 changed files with 28 additions and 21 deletions

View File

@@ -91,7 +91,7 @@ size_t CommandQueueHw<gfxCoreFamily>::estimateStateBaseAddressCmdSize() {
NEO::Device *neoDevice = device->getNEODevice();
auto &hwInfo = neoDevice->getHardwareInfo();
auto &productHelper = *NEO::ProductHelper::get(hwInfo.platform.eProductFamily);
auto &productHelper = neoDevice->getProductHelper();
size_t size = 0;
if (NEO::ApiSpecificConfig::getBindlessConfiguration()) {

View File

@@ -94,6 +94,7 @@ struct Device : _ze_device_handle_t {
virtual uint32_t getMaxNumHwThreads() const = 0;
virtual const NEO::GfxCoreHelper &getGfxCoreHelper() = 0;
virtual const NEO::ProductHelper &getProductHelper() = 0;
bool isImplicitScalingCapable() const {
return implicitScalingCapable;
}

View File

@@ -552,7 +552,7 @@ ze_result_t DeviceImp::getMemoryProperties(uint32_t *pCount, ze_device_memory_pr
const auto &deviceInfo = this->neoDevice->getDeviceInfo();
auto &hwInfo = this->getHwInfo();
auto &productHelper = *NEO::ProductHelper::get(hwInfo.platform.eProductFamily);
auto &productHelper = this->getProductHelper();
strcpy_s(pMemProperties->name, ZE_MAX_DEVICE_NAME, productHelper.getDeviceMemoryName().c_str());
auto osInterface = neoDevice->getRootDeviceEnvironment().osInterface.get();
pMemProperties->maxClockRate = productHelper.getDeviceMemoryMaxClkRate(hwInfo, osInterface, 0);
@@ -1053,6 +1053,10 @@ const NEO::GfxCoreHelper &DeviceImp::getGfxCoreHelper() {
return this->neoDevice->getGfxCoreHelper();
}
const NEO::ProductHelper &DeviceImp::getProductHelper() {
return this->neoDevice->getProductHelper();
}
NEO::OSInterface &DeviceImp::getOsInterface() { return *neoDevice->getRootDeviceEnvironment().osInterface; }
uint32_t DeviceImp::getPlatformInfo() const {

View File

@@ -73,6 +73,7 @@ struct DeviceImp : public Device {
BuiltinFunctionsLib *getBuiltinFunctionsLib() override;
uint32_t getMOCS(bool l3enabled, bool l1enabled) override;
const NEO::GfxCoreHelper &getGfxCoreHelper() override;
const NEO::ProductHelper &getProductHelper() override;
const NEO::HardwareInfo &getHwInfo() const override;
NEO::OSInterface &getOsInterface() override;
uint32_t getPlatformInfo() const override;

View File

@@ -58,6 +58,7 @@ struct Mock<Device> : public Device {
// Runtime internal methods
ADDMETHOD_NOBASE(getExecEnvironment, void *, nullptr, ());
ADDMETHOD_NOBASE_REFRETURN(getGfxCoreHelper, NEO::GfxCoreHelper &, ());
ADDMETHOD_NOBASE_REFRETURN(getProductHelper, NEO::ProductHelper &, ());
ADDMETHOD_NOBASE(getBuiltinFunctionsLib, BuiltinFunctionsLib *, nullptr, ());
ADDMETHOD_CONST_NOBASE(getMaxNumHwThreads, uint32_t, 16u, ());
ADDMETHOD_NOBASE(activateMetricGroupsDeferred, ze_result_t, ZE_RESULT_SUCCESS, (uint32_t count, zet_metric_group_handle_t *phMetricGroups));