From 2a570e113a336bed371601f8cd49df0f84abc7c1 Mon Sep 17 00:00:00 2001 From: Samaresh Kumar Singh Date: Fri, 3 Apr 2026 19:41:40 -0500 Subject: [PATCH 1/3] Fix kernel argument definition for named function objects The old text said only member variables referenced by operator() become kernel parameters, which is wrong when SYCL_EXTERNAL calls cross TU boundaries. All member variables are now stated as kernel arguments, with implementations allowed to drop unused ones via dead argument elimination. --- adoc/chapters/programming_interface.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/adoc/chapters/programming_interface.adoc b/adoc/chapters/programming_interface.adoc index 6a00a8de5..f2619d716 100644 --- a/adoc/chapters/programming_interface.adoc +++ b/adoc/chapters/programming_interface.adoc @@ -17667,10 +17667,10 @@ a device copyable type in that case and the specialization is ignored. A SYCL application passes parameters to a kernel in different ways depending on whether the kernel is a named function object or a lambda expression. -If the kernel is a named function object, the [code]#operator()# member function -(or other member functions that it calls) may reference member variables inside -the same named function object. -Any such member variables become parameters to the kernel. +If the kernel is a named function object, all member variables of the named +function object become parameters to the kernel. +An implementation may omit passing a member variable that it can prove is not +used by the kernel, which is a form of dead argument elimination. If the kernel is a lambda expression, any variables captured by the lambda become parameters to the kernel. From 9530dde954a45caca5c1d23cc13cf11ba11b56fd Mon Sep 17 00:00:00 2001 From: Samaresh Kumar Singh Date: Tue, 7 Apr 2026 08:16:45 -0500 Subject: [PATCH 2/3] Address review: use non-static member variables, drop dead arg elimination note --- adoc/chapters/programming_interface.adoc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/adoc/chapters/programming_interface.adoc b/adoc/chapters/programming_interface.adoc index f2619d716..878188897 100644 --- a/adoc/chapters/programming_interface.adoc +++ b/adoc/chapters/programming_interface.adoc @@ -17667,10 +17667,8 @@ a device copyable type in that case and the specialization is ignored. A SYCL application passes parameters to a kernel in different ways depending on whether the kernel is a named function object or a lambda expression. -If the kernel is a named function object, all member variables of the named +If the kernel is a named function object, all non-static member variables of the named function object become parameters to the kernel. -An implementation may omit passing a member variable that it can prove is not -used by the kernel, which is a form of dead argument elimination. If the kernel is a lambda expression, any variables captured by the lambda become parameters to the kernel. From 1d1eb25f232cf17680572858a4e0d3106426f2d9 Mon Sep 17 00:00:00 2001 From: Samaresh Kumar Singh Date: Mon, 13 Apr 2026 14:15:25 -0500 Subject: [PATCH 3/3] Fix reflow: wrap long line in kernel argument description --- adoc/chapters/programming_interface.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adoc/chapters/programming_interface.adoc b/adoc/chapters/programming_interface.adoc index 878188897..7615d315a 100644 --- a/adoc/chapters/programming_interface.adoc +++ b/adoc/chapters/programming_interface.adoc @@ -17667,8 +17667,8 @@ a device copyable type in that case and the specialization is ignored. A SYCL application passes parameters to a kernel in different ways depending on whether the kernel is a named function object or a lambda expression. -If the kernel is a named function object, all non-static member variables of the named -function object become parameters to the kernel. +If the kernel is a named function object, all non-static member variables of the +named function object become parameters to the kernel. If the kernel is a lambda expression, any variables captured by the lambda become parameters to the kernel.