Skip to content

Fix kernel argument definition for named function objects#996

Open
ssam18 wants to merge 3 commits intoKhronosGroup:mainfrom
ssam18:fix/issue-915-kernel-arg-definition
Open

Fix kernel argument definition for named function objects#996
ssam18 wants to merge 3 commits intoKhronosGroup:mainfrom
ssam18:fix/issue-915-kernel-arg-definition

Conversation

@ssam18
Copy link
Copy Markdown

@ssam18 ssam18 commented Apr 4, 2026

Fixes #915.

The previous wording implied that only member variables referenced by operator() become kernel parameters, which breaks down when operator() calls a SYCL_EXTERNAL function defined in another translation unit — the compiler has no way to know which members are used there. The corrected text states that all member variables of the named function object are kernel parameters, and that an implementation may drop any it can prove are unused (dead argument elimination). This also aligns with how DPC++ already handles type checking for kernel 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.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 4, 2026

CLA assistant check
All committers have signed the CLA.

@ssam18
Copy link
Copy Markdown
Author

ssam18 commented Apr 4, 2026

I have signed the Contribution License Agreement, Still CI/CD workflow is pending on that. When I click, it shows you already have signed. Not sure how to fix it.

@ssam18 ssam18 closed this Apr 4, 2026
@ssam18 ssam18 reopened this Apr 4, 2026
@TApplencourt
Copy link
Copy Markdown
Contributor

@gmlueck said "I volunteered to draft a PR for this." Why are you not consulting with him before writing a PR? It's kind of rude... We are all human with feeling.

Comment thread adoc/chapters/programming_interface.adoc Outdated
Comment thread adoc/chapters/programming_interface.adoc Outdated
@gmlueck
Copy link
Copy Markdown
Contributor

gmlueck commented Apr 6, 2026

@gmlueck said "I volunteered to draft a PR for this." Why are you not consulting with him before writing a PR? It's kind of rude... We are all human with feeling.

No worries. Glad for the help!

@ssam18
Copy link
Copy Markdown
Author

ssam18 commented Apr 7, 2026

@gmlueck said "I volunteered to draft a PR for this." Why are you not consulting with him before writing a PR? It's kind of rude... We are all human with feeling.

My intension is to not hurt your feeling. I am here to help and expedite the work for this group. You can collaborate here in this PR and take the credit, I don't mind.

@TApplencourt
Copy link
Copy Markdown
Contributor

  • Just need to reflow, and agree to merge.

@TApplencourt
Copy link
Copy Markdown
Contributor

Maybe add a note to said that user can always by pass by specialization the trait to true? (to behave like cuda, jsut opt-out of the diagnostic)

Copy link
Copy Markdown
Contributor

@gmlueck gmlueck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix reflow failure.

@ssam18
Copy link
Copy Markdown
Author

ssam18 commented Apr 13, 2026

Please fix reflow failure.

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Definition of "kernel argument" is wrong for named kernel object

5 participants