Skip to content

Commit e987074

Browse files
committed
[SYCL] Accept kernel lambda as clang argument
1 parent 416405b commit e987074

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2942,7 +2942,7 @@ defm sycl_unnamed_lambda
29422942
" >= clang::LangOptions::SYCLMajorVersion::SYCL_2020")>,
29432943
PosFlag<SetTrue, [], "Allow">, NegFlag<SetFalse, [], "Disallow">,
29442944
BothFlags<[CC1Option, CoreOption], " unnamed SYCL lambda kernels">>;
2945-
defm sycl_inline_kernel_lambda
2945+
defm sycl_force_inline_kernel_lambda
29462946
: BoolFOption<
29472947
"sycl-force-inline-kernel-lambda", LangOpts<"SYCLForceInlineKernelLambda">,
29482948
DefaultTrue,

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5123,6 +5123,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
51235123
CmdArgs.push_back("-sycl-std=2020");
51245124
}
51255125

5126+
if (!Args.hasFlag(options::OPT_fsycl_force_inline_kernel_lambda,
5127+
options::OPT_fno_sycl_force_inline_kernel_lambda, true))
5128+
CmdArgs.push_back("-fno-sycl-force-inline-kernel-lambda");
5129+
51265130
if (!Args.hasFlag(options::OPT_fsycl_unnamed_lambda,
51275131
options::OPT_fno_sycl_unnamed_lambda, true))
51285132
CmdArgs.push_back("-fno-sycl-unnamed-lambda");

clang/test/CodeGenSYCL/debug-info-srcpos-kernel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang -Xclang -fno-sycl-force-inline-kernel-lambda -fsycl-device-only %s -S -emit-llvm -O0 -g -o - | FileCheck %s
1+
// RUN: %clang -fno-sycl-force-inline-kernel-lambda -fsycl-device-only %s -S -emit-llvm -O0 -g -o - | FileCheck %s
22
//
33
// Verify the SYCL kernel routine is marked artificial and has the
44
// expected source correlation.

sycl/doc/UsersManual.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ and not recommended to use in production environment.
107107
* nd_item class get_global_id()/get_global_linear_id() member functions
108108
Enabled by default.
109109

110-
**`-f[no]sycl-force-inline-kernel-lambda`**
110+
**`-f[no-]sycl-force-inline-kernel-lambda`**
111111

112112
Enables/Disables inlining of the kernel lambda operator into the compiler
113113
generated generated entry point function. This flag does not apply to ESIMD

0 commit comments

Comments
 (0)