|
11 | 11 | #include <CL/sycl/detail/pi.h>
|
12 | 12 | #include <CL/sycl/kernel.hpp>
|
13 | 13 | #include <CL/sycl/property_list.hpp>
|
| 14 | +#include <detail/config.hpp> |
14 | 15 | #include <detail/kernel_impl.hpp>
|
15 | 16 | #include <detail/program_impl.hpp>
|
16 | 17 | #include <detail/spec_constant_impl.hpp>
|
@@ -291,9 +292,13 @@ void program_impl::link(string_class LinkOptions) {
|
291 | 292 | check_device_feature_support<info::device::is_linker_available>(MDevices);
|
292 | 293 | vector_class<RT::PiDevice> Devices(get_pi_devices());
|
293 | 294 | const detail::plugin &Plugin = getPlugin();
|
| 295 | + const char *LinkOpts = SYCLConfig<SYCL_PROGRAM_LINK_OPTIONS>::get(); |
| 296 | + if (!LinkOpts) { |
| 297 | + LinkOpts = LinkOptions.c_str(); |
| 298 | + } |
294 | 299 | RT::PiResult Err = Plugin.call_nocheck<PiApiKind::piProgramLink>(
|
295 |
| - MContext->getHandleRef(), Devices.size(), Devices.data(), |
296 |
| - LinkOptions.c_str(), 1, &MProgram, nullptr, nullptr, &MProgram); |
| 300 | + MContext->getHandleRef(), Devices.size(), Devices.data(), LinkOpts, |
| 301 | + /*num_input_programs*/ 1, &MProgram, nullptr, nullptr, &MProgram); |
297 | 302 | Plugin.checkPiResult<compile_program_error>(Err);
|
298 | 303 | MLinkOptions = LinkOptions;
|
299 | 304 | MBuildOptions = LinkOptions;
|
@@ -363,8 +368,12 @@ void program_impl::compile(const string_class &Options) {
|
363 | 368 | check_device_feature_support<info::device::is_compiler_available>(MDevices);
|
364 | 369 | vector_class<RT::PiDevice> Devices(get_pi_devices());
|
365 | 370 | const detail::plugin &Plugin = getPlugin();
|
| 371 | + const char *CompileOpts = SYCLConfig<SYCL_PROGRAM_COMPILE_OPTIONS>::get(); |
| 372 | + if (!CompileOpts) { |
| 373 | + CompileOpts = Options.c_str(); |
| 374 | + } |
366 | 375 | RT::PiResult Err = Plugin.call_nocheck<PiApiKind::piProgramCompile>(
|
367 |
| - MProgram, Devices.size(), Devices.data(), Options.c_str(), 0, nullptr, |
| 376 | + MProgram, Devices.size(), Devices.data(), CompileOpts, 0, nullptr, |
368 | 377 | nullptr, nullptr, nullptr);
|
369 | 378 |
|
370 | 379 | if (Err != PI_SUCCESS) {
|
|
0 commit comments