Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions sycl-jit/jit-compiler/lib/rtc/DeviceCompilation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ jit_compiler::compileDeviceCode(InMemoryFile SourceFile,
DerivedArgList DAL{UserArgList};
const auto &OptTable = getDriverOptTable();
DAL.AddFlagArg(nullptr, OptTable.getOption(OPT_fsycl_device_only));
DAL.AddFlagArg(nullptr,
OptTable.getOption(OPT_fno_sycl_dead_args_optimization));
DAL.AddJoinedArg(
nullptr, OptTable.getOption(OPT_resource_dir_EQ),
(DPCPPRoot + "/lib/clang/" + Twine(CLANG_VERSION_MAJOR)).str());
Expand Down Expand Up @@ -410,5 +412,11 @@ jit_compiler::parseUserArgs(View<const char *> UserArgs) {
}
}

if (AL.hasFlag(OPT_fsycl_dead_args_optimization,
OPT_fno_sycl_dead_args_optimization, false)) {
return createStringError(
"Dead argument optimization must be disabled for runtime compilation");
}

return Expected<InputArgList>{std::move(AL)};
}
4 changes: 3 additions & 1 deletion sycl/test-e2e/KernelCompiler/kernel_compiler_sycl_jit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ auto constexpr SYCLSource = R"===(

// use extern "C" to avoid name mangling
extern "C" SYCL_EXTERNAL SYCL_EXT_ONEAPI_FUNCTION_PROPERTY((sycl::ext::oneapi::experimental::nd_range_kernel<1>))
void ff_cp(int *ptr) {
void ff_cp(int *ptr, int *unused) {

// intentionally using deprecated routine, as opposed to this_work_item::get_nd_item<1>()
sycl::nd_item<1> Item = sycl::ext::oneapi::experimental::this_nd_item<1>();
Expand All @@ -78,6 +78,7 @@ void test_1(sycl::queue &Queue, sycl::kernel &Kernel, int seed) {
memset(usmPtr, 0, Range * sizeof(int));
Queue.submit([&](sycl::handler &Handler) {
Handler.set_arg(0, usmPtr);
Handler.set_arg(1, usmPtr);
Handler.parallel_for(R1, Kernel);
});
Queue.wait();
Expand Down Expand Up @@ -179,6 +180,7 @@ int test_unsupported_options() {
CheckUnsupported({"-Xsycl-target-frontend", "-fsanitize=address"});
CheckUnsupported({"-Xsycl-target-frontend=spir64", "-fsanitize=address"});
CheckUnsupported({"-Xarch_device", "-fsanitize=address"});
CheckUnsupported({"-fsycl-dead-args-optimization"});

return 0;
}
Expand Down
Loading