Skip to content

[SYCL][Driver] Move offload mismatch warning into SYCLActionBuilder #7434

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

Merged
merged 1 commit into from
Nov 21, 2022

Conversation

npmiller
Copy link
Contributor

@npmiller npmiller commented Nov 17, 2022

The SYCLActionBuilder handles the parsing of the arguments to determine the SYCL triples and architectures being used, so doing the check there means we can just re-use that rather than having to parse the triples and target arguments again.

This fixes the issue where for CUDA and HIP where the check failed to take into account the offload architecture and would just compare the section name that has the triple and the offload architecture against just the triple which would always fail even when the triples and offload architectures were otherwise matching.

The new binaries for the test where generated from a dummy.cpp C++ file containing just void foo() {}, and:

clang++ -fsycl -fsycl-targets=nvptx64-nvidia-cuda dummy.cpp -c -o objnvptx64-sm_50.o
llvm-ar cr libnvptx64-sm_50.a objnvptx64-sm_50.o 
clang++ -fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx908 dummy.cpp -c -o objamdgcn-gfx908.o -fno-sycl-libspirv
llvm-ar cr libamdgcn-gfx908.a objamdgcn-gfx908.o

This patch solves the incorrect warning issues reported in #6636 and #7300

The SYCLActionBuilder handles the parsing of the arguments to determine
the SYCL triples and architectures being used, so doing the check here
means we can just re-use that rather than having to parse the triples
and target arguments again.

This fixes the issue where for CUDA and HIP the specific architecture is
embedded in the offload binary section name but is passed as a different
argument and is not in the triple of `-fsycl-targets`.
@npmiller npmiller requested a review from a team as a code owner November 17, 2022 14:28
@npmiller
Copy link
Contributor Author

Failures are unrelated seems to be coming from a test change, see:

Copy link
Contributor

@mdtoguchi mdtoguchi left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks!

@mdtoguchi mdtoguchi changed the title [SYCL] Move offload mismatch warning into SYCLActionBuilder [SYCL][Driver] Move offload mismatch warning into SYCLActionBuilder Nov 17, 2022
@pvchupin
Copy link
Contributor

sort.cpp issue handled at intel/llvm-test-suite#1396

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.

3 participants