Skip to content

Commit

Permalink
Enable no-LUT transcendentals by default on newer platforms.
Browse files Browse the repository at this point in the history
This patch enables by default new transcendentals implementations newer
platforms. The new implementations are expeced to be both more
performant and more accurate.
  • Loading branch information
mbelicki authored and igcbot committed Jun 20, 2023
1 parent 895f1d4 commit fb6d508
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions IGC/Compiler/Optimizer/BuiltInFuncImport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,11 @@ void BIImport::InitializeBIFlags(Module& M)
initializeVarWithValue("__APIRS", false);
}

bool useHighAccuracyMathFuncs = false;
// High accuracy implementations are also more performant on newer cores,
// select them by default.
bool useHighAccuracyMathFuncs =
pCtx->platform.isProductChildOf(IGFX_PVC);

if (pCtx->type == ShaderType::OPENCL_SHADER)
{
OpenCLProgramContext *OCLContext = static_cast<OpenCLProgramContext*>(pCtx);
Expand All @@ -1123,7 +1127,7 @@ void BIImport::InitializeBIFlags(Module& M)
float profilingTimerResolution = OCLContext->getProfilingTimerResolution();
initializeVarWithValue("__ProfilingTimerResolution", *reinterpret_cast<int*>(&profilingTimerResolution));

useHighAccuracyMathFuncs = OCLContext->m_InternalOptions.UseHighAccuracyMathFuncs;
useHighAccuracyMathFuncs = useHighAccuracyMathFuncs || OCLContext->m_InternalOptions.UseHighAccuracyMathFuncs;

initializeVarWithValue("__UseLSC", pCtx->platform.hasLSC());
initializeVarWithValue("__ForceL1Prefetch", IGC_IS_FLAG_ENABLED(ForcePrefetchToL1Cache) ? 1 : 0);
Expand Down

0 comments on commit fb6d508

Please sign in to comment.