Skip to content

Commit a89a198

Browse files
DianaChenigcbot
authored andcommitted
Add enviroment variable for OCL debugging options
1 parent cd03568 commit a89a198

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

IGC/AdaptorOCL/ocl_igc_interface/impl/igc_ocl_translation_ctx_impl.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ CIF_DECLARE_INTERFACE_PIMPL(IgcOclTranslationCtx) : CIF::PimplBase
226226

227227
IGC::CPlatform igcPlatform = this->globalState.GetIgcCPlatform();
228228

229+
// extra ocl options set from regkey
229230
const char *extraOptions = IGC_GET_REGKEYSTRING(ExtraOCLOptions);
230231
std::string combinedOptions;
231232
if (extraOptions[0] != '\0')
@@ -239,6 +240,20 @@ CIF_DECLARE_INTERFACE_PIMPL(IgcOclTranslationCtx) : CIF::PimplBase
239240
inputArgs.OptionsSize = combinedOptions.size();
240241
}
241242

243+
// extra ocl internal options set from regkey
244+
const char *extraInternlOptions = IGC_GET_REGKEYSTRING(ExtraOCLInternalOptions);
245+
std::string combinedInternalOptions;
246+
if (extraInternlOptions[0] != '\0')
247+
{
248+
if (inputArgs.pInternalOptions != nullptr)
249+
{
250+
combinedInternalOptions = std::string(inputArgs.pInternalOptions) + ' ';
251+
}
252+
combinedInternalOptions += extraInternlOptions;
253+
inputArgs.pInternalOptions = combinedInternalOptions.c_str();
254+
inputArgs.InternalOptionsSize = combinedInternalOptions.size();
255+
}
256+
242257
bool success = false;
243258
if (this->inType == CodeType::elf)
244259
{

IGC/common/igc_flags.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ DECLARE_IGC_REGKEY(bool, EnableGTLocationDebugging, false, "Setting this to
268268
DECLARE_IGC_REGKEY(bool, EnableRelocations, false, "Setting this to 1 (true) makes IGC emit relocatable ELF with debug info", true)
269269
DECLARE_IGC_REGKEY(bool, EnableWriteOldFPToStack, true, "Setting this to 1 (true) writes the caller frame's frame-pointer to the start of callee's frame on stack, to support stack walk", false)
270270
DECLARE_IGC_REGKEY(debugString, ExtraOCLOptions, 0, "Extra options for OpenCL", true)
271+
DECLARE_IGC_REGKEY(debugString, ExtraOCLInternalOptions, 0, "Extra internal options for OpenCL", true)
271272

272273
DECLARE_IGC_GROUP("IGC Features")
273274
DECLARE_IGC_REGKEY(bool, EnableOCLSIMD16, true, "Enable OCL SIMD16 mode", true)

0 commit comments

Comments
 (0)