Skip to content

[SYCL][FE] Attributes from any function are propagated to the kernel contrary to the intent #1811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kbobrovs opened this issue Jun 4, 2020 · 0 comments
Assignees

Comments

@kbobrovs
Copy link
Contributor

kbobrovs commented Jun 4, 2020

// Allow the following kernel attributes only on lambda functions and
:

      // Allow the following kernel attributes only on lambda functions and
      // function objects that are called directly from a kernel (i.e. the one
      // passed to the parallel_for function). For all other cases,
      // emit a warning and ignore.

In fact attributes are propagated from any function called from within a kernel, and are other functions called in some cases.

To see the issue, compile this source
attr-prop.txt
clang++ -fsycl -fsycl-device-only -Xclang -emit-llvm -o - -c attr-prop.cpp
and note the line:
define dso_local spir_kernel void @_ZTSZ11invoke_foo2vE10KernelName() #0 !kernel_arg_addr_space !4 !kernel_arg_access_qual !4 !kernel_arg_type !4 !kernel_arg_base_type !4 !kernel_arg_type_qual !4 !no_global_work_offset !4 {

no_global_work_offset got propagated from unrelated function w/o warning.

@schittir schittir self-assigned this Jun 12, 2020
kbenzie pushed a commit to kbenzie/intel-llvm that referenced this issue Feb 17, 2025
Chenyang-L pushed a commit that referenced this issue Feb 18, 2025
Chenyang-L pushed a commit that referenced this issue Feb 18, 2025
This reverts commit 1851eff, reversing
changes made to 5f4a5a2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants