Skip to content

Commit

Permalink
Add support for fp64_gen_emu also in API options
Browse files Browse the repository at this point in the history
FP64 emulation should be supported in both the API and the Interanl options
  • Loading branch information
matborzyszkowski authored and igcbot committed Sep 22, 2023
1 parent 2b9e0d4 commit 29f439c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion IGC/AdaptorOCL/UnifyIROCL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ static void CommonOCLBasedPasses(
pContext->m_InternalOptions.EmitZeBinVISASections;

CompilerOpts.FP64GenEmulationEnabled =
pContext->m_InternalOptions.EnableFP64GenEmu;
pContext->m_InternalOptions.EnableFP64GenEmu ||
pContext->m_Options.EnableFP64GenEmu;

CompilerOpts.LoadCacheDefault =
pContext->m_InternalOptions.LoadCacheDefault;
Expand Down
7 changes: 7 additions & 0 deletions IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,13 @@ namespace IGC
// operations on platforms without HW support for fp64.
EnableUnsupportedFP64Poisoning = true;
}

if (apiOptions.hasArg(OPT_fp64_gen_emu_common))
{
// This option enables FP64 emulation for platforms that
// cannot HW support for double operations
EnableFP64GenEmu = true;
}
};

unsigned OpenCLProgramContext::GetSlmSizePerSubslice()
Expand Down
3 changes: 3 additions & 0 deletions IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ namespace IGC
// This option forces IGC to poison kernels using fp64
// operations on platforms without HW support for fp64.
bool EnableUnsupportedFP64Poisoning = false;
// This option enables FP64 emulation for platforms that
// cannot HW support for double operations
bool EnableFP64GenEmu = false;

private:
void parseOptions(const char* opts);
Expand Down
3 changes: 3 additions & 0 deletions IGC/Options/include/igc/Options/IGCApiOptions.td
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ defm greater_than_4GB_buffer_required : CommonFlag<"greater-than-4GB-buffer-requ
// -cl-poison-unsupported-fp64-kernels -ze-poison-unsupported-fp64-kernels
defm poison_unsupported_fp64_kernels : CommonFlag<"poison-unsupported-fp64-kernels">;

// -cl-fp64-gen-emu -ze-fp64-gen-emu
defm fp64_gen_emu : CommonFlag<"fp64-gen-emu">;

// }} Backend API options

// API options from source translation {{
Expand Down

0 comments on commit 29f439c

Please sign in to comment.