Add support for ze_device_memory_ext_properties_t

Related-To: LOCI-3099

Signed-off-by: Joshua Santosh Ranjan <joshua.santosh.ranjan@intel.com>
This commit is contained in:
Joshua Santosh Ranjan
2022-06-30 08:04:45 +00:00
committed by Compute-Runtime-Automation
parent 16047fa26b
commit e8494abbe8
17 changed files with 498 additions and 41 deletions

View File

@@ -18,6 +18,8 @@ struct MockHwInfoConfigHw : NEO::HwInfoConfigHw<productFamily> {
bool getUuid(Device *device, std::array<uint8_t, HwInfoConfig::uuidSize> &uuid) const override;
uint32_t getSteppingFromHwRevId(const HardwareInfo &hwInfo) const override;
int configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) override;
uint64_t getDeviceMemoryPhysicalSizeInBytes(const OSInterface *osIface, uint32_t subDeviceIndex) override;
uint32_t getDeviceMemoryMaxClkRate(const HardwareInfo &hwInfo, const OSInterface *osIface, uint32_t subDeviceIndex) override;
bool use128MbEdram = false;
bool enableMidThreadPreemption = false;

View File

@@ -45,4 +45,14 @@ int MockHwInfoConfigHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo
featureTable->flags.ftrGpGpuMidBatchPreempt = 1;
}
return (failOnConfigureHardwareCustom) ? -1 : 0;
}
}
template <>
uint64_t MockHwInfoConfigHw<gfxProduct>::getDeviceMemoryPhysicalSizeInBytes(const OSInterface *osIface, uint32_t subDeviceIndex) {
return 1024u;
}
template <>
uint32_t MockHwInfoConfigHw<gfxProduct>::getDeviceMemoryMaxClkRate(const HardwareInfo &hwInfo, const OSInterface *osIface, uint32_t subDeviceIndex) {
return 800u;
}

View File

@@ -262,6 +262,33 @@ class DrmMock : public Drm {
uint16_t flags;
};
StackVec<WaitUserFenceParams, 1> waitUserFenceParams;
bool storedGetDeviceMemoryMaxClockRateInMhzStatus = true;
bool useBaseGetDeviceMemoryMaxClockRateInMhz = true;
bool getDeviceMemoryMaxClockRateInMhz(uint32_t tileId, uint32_t &clkRate) override {
if (useBaseGetDeviceMemoryMaxClockRateInMhz == true) {
return Drm::getDeviceMemoryMaxClockRateInMhz(tileId, clkRate);
}
if (storedGetDeviceMemoryMaxClockRateInMhzStatus == true) {
clkRate = 800;
}
return storedGetDeviceMemoryMaxClockRateInMhzStatus;
}
bool storedGetDeviceMemoryPhysicalSizeInBytesStatus = true;
bool useBaseGetDeviceMemoryPhysicalSizeInBytes = true;
bool getDeviceMemoryPhysicalSizeInBytes(uint32_t tileId, uint64_t &physicalSize) override {
if (useBaseGetDeviceMemoryPhysicalSizeInBytes == true) {
return Drm::getDeviceMemoryPhysicalSizeInBytes(tileId, physicalSize);
}
if (storedGetDeviceMemoryPhysicalSizeInBytesStatus == true) {
physicalSize = 1024;
}
return storedGetDeviceMemoryPhysicalSizeInBytesStatus;
}
};
class DrmMockNonFailing : public DrmMock {

View File

@@ -74,7 +74,17 @@ bool HwInfoConfigHw<IGFX_UNKNOWN>::overrideGfxPartitionLayoutForWsl() const {
}
template <>
uint32_t HwInfoConfigHw<IGFX_UNKNOWN>::getDeviceMemoryMaxClkRate(const HardwareInfo &hwInfo) {
uint32_t HwInfoConfigHw<IGFX_UNKNOWN>::getDeviceMemoryMaxClkRate(const HardwareInfo &hwInfo, const OSInterface *osIface, uint32_t subDeviceIndex) {
return 0;
}
template <>
uint64_t HwInfoConfigHw<IGFX_UNKNOWN>::getDeviceMemoryPhysicalSizeInBytes(const OSInterface *osIface, uint32_t subDeviceIndex) {
return 0;
}
template <>
uint64_t HwInfoConfigHw<IGFX_UNKNOWN>::getDeviceMemoryMaxBandWidthInBytesPerSecond(const HardwareInfo &hwInfo, const OSInterface *osIface, uint32_t subDeviceIndex) {
return 0;
}