fix: move getProductConfigFromHwInfo to CompilerProductHelper

add tests for default PVC configs

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-04-18 08:54:04 +00:00
committed by Compute-Runtime-Automation
parent dd575008bc
commit c544004b8e
125 changed files with 456 additions and 479 deletions

View File

@@ -96,6 +96,7 @@ struct Device : _ze_device_handle_t {
virtual const NEO::GfxCoreHelper &getGfxCoreHelper() = 0;
virtual const L0GfxCoreHelper &getL0GfxCoreHelper() = 0;
virtual const NEO::ProductHelper &getProductHelper() = 0;
virtual const NEO::CompilerProductHelper &getCompilerProductHelper() = 0;
bool isImplicitScalingCapable() const {
return implicitScalingCapable;

View File

@@ -867,8 +867,8 @@ ze_result_t DeviceImp::getProperties(ze_device_properties_t *pDeviceProperties)
} else if (extendedProperties->stype == ZE_STRUCTURE_TYPE_DEVICE_IP_VERSION_EXT) {
ze_device_ip_version_ext_t *zeDeviceIpVersion = reinterpret_cast<ze_device_ip_version_ext_t *>(extendedProperties);
NEO::Device *activeDevice = getActiveDevice();
auto &productHelper = activeDevice->getProductHelper();
zeDeviceIpVersion->ipVersion = productHelper.getHwIpVersion(hardwareInfo);
auto &compilerProductHelper = activeDevice->getCompilerProductHelper();
zeDeviceIpVersion->ipVersion = compilerProductHelper.getHwIpVersion(hardwareInfo);
}
extendedProperties = static_cast<ze_base_properties_t *>(extendedProperties->pNext);
}
@@ -1079,6 +1079,10 @@ const NEO::ProductHelper &DeviceImp::getProductHelper() {
return this->neoDevice->getProductHelper();
}
const NEO::CompilerProductHelper &DeviceImp::getCompilerProductHelper() {
return this->neoDevice->getCompilerProductHelper();
}
NEO::OSInterface &DeviceImp::getOsInterface() { return *neoDevice->getRootDeviceEnvironment().osInterface; }
uint32_t DeviceImp::getPlatformInfo() const {

View File

@@ -74,6 +74,7 @@ struct DeviceImp : public Device {
const NEO::GfxCoreHelper &getGfxCoreHelper() override;
const L0GfxCoreHelper &getL0GfxCoreHelper() override;
const NEO::ProductHelper &getProductHelper() override;
const NEO::CompilerProductHelper &getCompilerProductHelper() override;
const NEO::HardwareInfo &getHwInfo() const override;
NEO::OSInterface &getOsInterface() override;
uint32_t getPlatformInfo() const override;

View File

@@ -60,6 +60,7 @@ struct Mock<Device> : public Device {
ADDMETHOD_NOBASE_REFRETURN(getGfxCoreHelper, NEO::GfxCoreHelper &, ());
ADDMETHOD_NOBASE_REFRETURN(getL0GfxCoreHelper, L0GfxCoreHelper &, ());
ADDMETHOD_NOBASE_REFRETURN(getProductHelper, NEO::ProductHelper &, ());
ADDMETHOD_NOBASE_REFRETURN(getCompilerProductHelper, NEO::CompilerProductHelper &, ());
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));

View File

@@ -1254,8 +1254,8 @@ TEST_F(DeviceTest, givenDeviceIpVersionWhenGetDevicePropertiesThenCorrectResultI
zeDeviceIpVersion.ipVersion = std::numeric_limits<uint32_t>::max();
deviceProperties.pNext = &zeDeviceIpVersion;
auto &productHelper = device->getProductHelper();
auto expectedIpVersion = productHelper.getHwIpVersion(device->getHwInfo());
auto &compilerProductHelper = device->getCompilerProductHelper();
auto expectedIpVersion = compilerProductHelper.getHwIpVersion(device->getHwInfo());
device->getProperties(&deviceProperties);
EXPECT_NE(std::numeric_limits<uint32_t>::max(), zeDeviceIpVersion.ipVersion);

View File

@@ -2290,10 +2290,10 @@ HWTEST_F(ModuleTranslationUnitTest, WhenCreatingFromNativeBinaryThenSetsUpRequir
HWTEST_F(ModuleTranslationUnitTest, WhenCreatingFromNativeBinaryThenSetsUpPackedTargetDeviceBinary) {
PatchTokensTestData::ValidEmptyProgram programTokens;
auto &productHelper = device->getProductHelper();
auto &compilerProductHelper = device->getCompilerProductHelper();
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
HardwareIpVersion aotConfig = {0};
aotConfig.value = productHelper.getHwIpVersion(hwInfo);
aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo);
NEO::Ar::ArEncoder encoder;
std::string requiredProduct = NEO::hardwarePrefix[productFamily];
@@ -2308,7 +2308,7 @@ HWTEST_F(ModuleTranslationUnitTest, WhenCreatingFromNativeBinaryThenSetsUpPacked
NEO::TargetDevice target;
target.coreFamily = static_cast<GFXCORE_FAMILY>(programTokens.header->Device);
target.aotConfig.value = productHelper.getHwIpVersion(hwInfo);
target.aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo);
target.stepping = programTokens.header->SteppingId;
target.maxPointerSizeInBytes = programTokens.header->GPUPointerSizeInBytes;