Skip to content

Commit 2ddbbab

Browse files
matborzyszkowskiigcbot
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.
1 parent cc2ea2a commit 2ddbbab

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
@@ -438,7 +438,7 @@ static void CommonOCLBasedPasses(
438438

439439
// Check after GlobalDCE in case of doubles in dead functions
440440
mpm.add(new ErrorCheck());
441-
if (pContext->m_InternalOptions.EnableUnsupportedFP64Poisoning) {
441+
if (pContext->m_Options.EnableUnsupportedFP64Poisoning) {
442442
mpm.add(new PoisonFP64Kernels());
443443
}
444444

@@ -563,7 +563,7 @@ static void CommonOCLBasedPasses(
563563

564564
// check for unsupported intrinsics
565565
mpm.add(new ErrorCheck());
566-
if (pContext->m_InternalOptions.EnableUnsupportedFP64Poisoning) {
566+
if (pContext->m_Options.EnableUnsupportedFP64Poisoning) {
567567
mpm.add(new PoisonFP64Kernels());
568568
}
569569

IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -513,13 +513,6 @@ namespace IGC
513513
}
514514
}
515515

516-
if (internalOptions.hasArg(OPT_poison_unsupported_fp64_kernels_common))
517-
{
518-
// This option forces IGC to poison kernels using fp64
519-
// operations on platforms without HW support for fp64.
520-
EnableUnsupportedFP64Poisoning = true;
521-
}
522-
523516
if (internalOptions.hasArg(OPT_fp64_gen_emu_common))
524517
{
525518
// This option enables FP64 emulation for platforms that
@@ -710,6 +703,13 @@ namespace IGC
710703
{
711704
Intel256GRFPerThread = true;
712705
}
706+
707+
if (apiOptions.hasArg(OPT_poison_unsupported_fp64_kernels_common))
708+
{
709+
// This option forces IGC to poison kernels using fp64
710+
// operations on platforms without HW support for fp64.
711+
EnableUnsupportedFP64Poisoning = true;
712+
}
713713
};
714714

715715
unsigned OpenCLProgramContext::GetSlmSizePerSubslice()

IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@ namespace IGC
9393
int FunctionControl = -1;
9494
// Fail comilation if spills are present in compiled kernel
9595
bool FailOnSpill = false;
96-
// This option forces IGC to poison kernels using fp64
97-
// operations on platforms without HW support for fp64.
98-
bool EnableUnsupportedFP64Poisoning = false;
9996
// This option enables FP64 emulation for platforms that
10097
// cannot HW support for double operations
10198
bool EnableFP64GenEmu = false;
@@ -171,6 +168,10 @@ namespace IGC
171168
// Generic address related
172169
bool NoLocalToGeneric = false;
173170

171+
// This option forces IGC to poison kernels using fp64
172+
// operations on platforms without HW support for fp64.
173+
bool EnableUnsupportedFP64Poisoning = false;
174+
174175
private:
175176
void parseOptions(const char* opts);
176177
};

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
@@ -49,6 +49,9 @@ defm 256_grf_per_thread : CommonFlag<"256-GRF-per-thread">;
4949
// -cl-intel-greater-than-4GB-buffer-required, -ze-opt-greater-than-4GB-buffer-required
5050
defm greater_than_4GB_buffer_required : CommonFlag<"greater-than-4GB-buffer-required">;
5151

52+
// -cl-poison-unsupported-fp64-kernels -ze-poison-unsupported-fp64-kernels
53+
defm poison_unsupported_fp64_kernels : CommonFlag<"poison-unsupported-fp64-kernels">;
54+
5255
// }} Backend API options
5356

5457
// 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
@@ -136,9 +136,6 @@ defm : CommonJoined<"load-cache-default=">, Alias<load_cache_default_common>;
136136
defm store_cache_default : CommonSeparate<"store-cache-default">;
137137
defm : CommonJoined<"store-cache-default=">, Alias<store_cache_default_common>;
138138

139-
// -cl-poison-unsupported-fp64-kernels -ze-poison-unsupported-fp64-kernels
140-
defm poison_unsupported_fp64_kernels : CommonFlag<"poison-unsupported-fp64-kernels">;
141-
142139
// -cl-fp64-gen-emu -ze-fp64-gen-emu
143140
defm fp64_gen_emu : CommonFlag<"fp64-gen-emu">;
144141

0 commit comments

Comments
 (0)