Skip to content

Commit 77bd259

Browse files
matborzyszkowskipszymich
authored andcommitted
Add support for poison_unsupported_fp64_kernels in API options
The `poison_unsupported_fp64_kernels` option should be represented as API option. So far the compiler has treated it as Internal option. (cherry picked from commit 2ddbbab)
1 parent 8b9cc63 commit 77bd259

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

IGC/AdaptorOCL/UnifyIROCL.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ static void CommonOCLBasedPasses(
442442

443443
// Check after GlobalDCE in case of doubles in dead functions
444444
mpm.add(new ErrorCheck());
445-
if (pContext->m_InternalOptions.EnableUnsupportedFP64Poisoning) {
445+
if (pContext->m_Options.EnableUnsupportedFP64Poisoning) {
446446
mpm.add(new PoisonFP64Kernels());
447447
}
448448

@@ -567,7 +567,7 @@ static void CommonOCLBasedPasses(
567567

568568
// check for unsupported intrinsics
569569
mpm.add(new ErrorCheck());
570-
if (pContext->m_InternalOptions.EnableUnsupportedFP64Poisoning) {
570+
if (pContext->m_Options.EnableUnsupportedFP64Poisoning) {
571571
mpm.add(new PoisonFP64Kernels());
572572
}
573573

IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -506,13 +506,6 @@ namespace IGC
506506
}
507507
}
508508

509-
if (internalOptions.hasArg(OPT_poison_unsupported_fp64_kernels_common))
510-
{
511-
// This option forces IGC to poison kernels using fp64
512-
// operations on platforms without HW support for fp64.
513-
EnableUnsupportedFP64Poisoning = true;
514-
}
515-
516509
if (internalOptions.hasArg(OPT_fp64_gen_emu_common))
517510
{
518511
// This option enables FP64 emulation for platforms that
@@ -688,6 +681,13 @@ namespace IGC
688681
{
689682
NoLocalToGeneric = true;
690683
}
684+
685+
if (apiOptions.hasArg(OPT_poison_unsupported_fp64_kernels_common))
686+
{
687+
// This option forces IGC to poison kernels using fp64
688+
// operations on platforms without HW support for fp64.
689+
EnableUnsupportedFP64Poisoning = true;
690+
}
691691
};
692692

693693
unsigned OpenCLProgramContext::GetSlmSizePerSubslice()

IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ namespace IGC
8989
int FunctionControl = -1;
9090
// Fail comilation if spills are present in compiled kernel
9191
bool FailOnSpill = false;
92-
// This option forces IGC to poison kernels using fp64
93-
// operations on platforms without HW support for fp64.
94-
bool EnableUnsupportedFP64Poisoning = false;
9592
// This option enables FP64 emulation for platforms that
9693
// cannot HW support for double operations
9794
bool EnableFP64GenEmu = false;
@@ -163,6 +160,10 @@ namespace IGC
163160
// Generic address related
164161
bool NoLocalToGeneric = false;
165162

163+
// This option forces IGC to poison kernels using fp64
164+
// operations on platforms without HW support for fp64.
165+
bool EnableUnsupportedFP64Poisoning = false;
166+
166167
private:
167168
void parseOptions(const char* opts);
168169
};

IGC/Compiler/Optimizer/OpenCLPasses/ErrorCheckPass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ void ErrorCheck::visitInstruction(llvm::Instruction& I)
111111
if (ctx->type == ShaderType::OPENCL_SHADER)
112112
{
113113
OpenCLProgramContext *OCLContext = static_cast<OpenCLProgramContext*>(ctx);
114-
poisonFP64KernelsEnabled = OCLContext->m_InternalOptions.EnableUnsupportedFP64Poisoning;
114+
poisonFP64KernelsEnabled = OCLContext->m_Options.EnableUnsupportedFP64Poisoning;
115115
}
116116

117117
// chcek that has HW DP support and DP emu is disabled

IGC/Options/include/igc/Options/IGCApiOptions.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ defm regular_grf_kernel : CommonSeparate<"regular-grf-kernel">;
4040
// -cl-intel-no-local-to-generic, -ze-opt-no-local-to-generic
4141
defm no_local_to_generic : CommonFlag<"no-local-to-generic">;
4242

43+
// -cl-poison-unsupported-fp64-kernels -ze-poison-unsupported-fp64-kernels
44+
defm poison_unsupported_fp64_kernels : CommonFlag<"poison-unsupported-fp64-kernels">;
45+
4346
// }} Backend API options
4447

4548
// API options from source translation {{

IGC/Options/include/igc/Options/IGCInternalOptions.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,6 @@ defm : CommonJoined<"load-cache-default=">, Alias<load_cache_default_common>;
133133
defm store_cache_default : CommonSeparate<"store-cache-default">;
134134
defm : CommonJoined<"store-cache-default=">, Alias<store_cache_default_common>;
135135

136-
// -cl-poison-unsupported-fp64-kernels -ze-poison-unsupported-fp64-kernels
137-
defm poison_unsupported_fp64_kernels : CommonFlag<"poison-unsupported-fp64-kernels">;
138-
139136
// -cl-fp64-gen-emu -ze-fp64-gen-emu
140137
defm fp64_gen_emu : CommonFlag<"fp64-gen-emu">;
141138

0 commit comments

Comments
 (0)