mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-12 00:59:38 +08:00
Add FP64 emulation support for ATS-M
This patch adds FP64 emulation support for ATS-M. Introducing new environment variable - NEO_FP64_EMULATION - which provides an option to allow the opt-in emulation of FP64. When emulation is enabled, we pass -cl-fp64-gen-emu (ocl) / -ze-fp64-gen-emu (L0) as an internal option to IGC. Related-To: NEO-7611 Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
8a55d9b517
commit
6c59953072
@@ -688,6 +688,11 @@ ze_result_t DeviceImp::getKernelProperties(ze_device_module_properties_t *pKerne
|
||||
pKernelProperties->fp64flags |= ZE_DEVICE_FP_FLAG_ROUNDED_DIVIDE_SQRT;
|
||||
pKernelProperties->fp32flags |= ZE_DEVICE_FP_FLAG_ROUNDED_DIVIDE_SQRT;
|
||||
}
|
||||
} else if (hardwareInfo.capabilityTable.ftrSupportsFP64Emulation) {
|
||||
if (neoDevice->getExecutionEnvironment()->isFP64EmulationEnabled()) {
|
||||
pKernelProperties->flags |= ZE_DEVICE_MODULE_FLAG_FP64;
|
||||
pKernelProperties->fp64flags = defaultFpFlags | ZE_DEVICE_FP_FLAG_SOFT_FLOAT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@ void DriverImp::initialize(ze_result_t *result) {
|
||||
envReader.getSetting("ZES_ENABLE_SYSMAN", false);
|
||||
envVariables.pciIdDeviceOrder =
|
||||
envReader.getSetting("ZE_ENABLE_PCI_ID_DEVICE_ORDER", false);
|
||||
envVariables.fp64Emulation =
|
||||
envReader.getSetting("NEO_FP64_EMULATION", false);
|
||||
|
||||
auto executionEnvironment = new NEO::ExecutionEnvironment();
|
||||
UNRECOVERABLE_IF(nullptr == executionEnvironment);
|
||||
@@ -53,6 +55,10 @@ void DriverImp::initialize(ze_result_t *result) {
|
||||
}
|
||||
}
|
||||
|
||||
if (envVariables.fp64Emulation) {
|
||||
executionEnvironment->setFP64EmulationEnabled();
|
||||
}
|
||||
|
||||
executionEnvironment->setMetricsEnabled(envVariables.metrics);
|
||||
|
||||
executionEnvironment->incRefInternal();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -32,6 +32,7 @@ struct L0EnvVariables {
|
||||
bool pin;
|
||||
bool sysman;
|
||||
bool pciIdDeviceOrder;
|
||||
bool fp64Emulation;
|
||||
};
|
||||
|
||||
} // namespace L0
|
||||
|
||||
@@ -63,6 +63,7 @@ NEO::ConstStringRef optLargeRegisterFile = "-ze-opt-large-register-file";
|
||||
NEO::ConstStringRef optAutoGrf = "-ze-intel-enable-auto-large-GRF-mode";
|
||||
NEO::ConstStringRef enableLibraryCompile = "-library-compilation";
|
||||
NEO::ConstStringRef enableGlobalVariableSymbols = "-ze-take-global-address";
|
||||
NEO::ConstStringRef enableFP64GenEmu = "-ze-fp64-gen-emu";
|
||||
} // namespace BuildOptions
|
||||
|
||||
ModuleTranslationUnit::ModuleTranslationUnit(L0::Device *device)
|
||||
@@ -143,6 +144,10 @@ std::string ModuleTranslationUnit::generateCompilerOptions(const char *buildOpti
|
||||
internalOptions = NEO::CompilerOptions::concatenate(internalOptions, BuildOptions::debugKernelEnable);
|
||||
}
|
||||
|
||||
if (neoDevice.getExecutionEnvironment()->isFP64EmulationEnabled()) {
|
||||
internalOptions = NEO::CompilerOptions::concatenate(internalOptions, BuildOptions::enableFP64GenEmu);
|
||||
}
|
||||
|
||||
const auto &compilerProductHelper = neoDevice.getRootDeviceEnvironment().getHelper<NEO::CompilerProductHelper>();
|
||||
auto forceToStatelessRequired = compilerProductHelper.isForceToStatelessRequired();
|
||||
auto statelessToStatefulOptimizationDisabled = NEO::DebugManager.flags.DisableStatelessToStatefulOptimization.get();
|
||||
|
||||
@@ -40,6 +40,7 @@ extern NEO::ConstStringRef optLargeRegisterFile;
|
||||
extern NEO::ConstStringRef optAutoGrf;
|
||||
extern NEO::ConstStringRef enableLibraryCompile;
|
||||
extern NEO::ConstStringRef enableGlobalVariableSymbols;
|
||||
extern NEO::ConstStringRef enableFP64GenEmu;
|
||||
|
||||
} // namespace BuildOptions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user