From f356497c91dde033b71142f1faaac48df20c43eb Mon Sep 17 00:00:00 2001 From: Denis Bakhvalov Date: Wed, 14 Apr 2021 17:40:43 -0700 Subject: [PATCH] [ESIMD] Always preserve -vc-codegen option for ESIMD kernels --- .../detail/program_manager/program_manager.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sycl/source/detail/program_manager/program_manager.cpp b/sycl/source/detail/program_manager/program_manager.cpp index d85815789bc82..3935b897a769b 100644 --- a/sycl/source/detail/program_manager/program_manager.cpp +++ b/sycl/source/detail/program_manager/program_manager.cpp @@ -406,13 +406,15 @@ RT::PiProgram ProgramManager::getBuiltPIProgram(OSModuleHandle M, // variable if (!CompileOptsEnv) { CompileOpts += Img.getCompileOptions(); - pi_device_binary_property isEsimdImage = Img.getProperty("isEsimdImage"); + } - if (isEsimdImage && pi::DeviceBinaryProperty(isEsimdImage).asUint32()) { - if (!CompileOpts.empty()) - CompileOpts += " "; - CompileOpts += "-vc-codegen"; - } + // The -vc-codegen option is always preserved for ESIMD kernels, regardless + // of the contents SYCL_PROGRAM_COMPILE_OPTIONS environment variable. + pi_device_binary_property isEsimdImage = Img.getProperty("isEsimdImage"); + if (isEsimdImage && pi::DeviceBinaryProperty(isEsimdImage).asUint32()) { + if (!CompileOpts.empty()) + CompileOpts += " "; + CompileOpts += "-vc-codegen"; } // Update only if link options are not overwritten by environment variable