Skip to content

[SYCL][CUDA][HIP AMD] Correct cuda/hip spirv libclc .bc and module triple.#7245

Merged
pvchupin merged 6 commits intointel:syclfrom
JackAKirk:remove-nvptx-triple-warn
Nov 2, 2022
Merged

[SYCL][CUDA][HIP AMD] Correct cuda/hip spirv libclc .bc and module triple.#7245
pvchupin merged 6 commits intointel:syclfrom
JackAKirk:remove-nvptx-triple-warn

Conversation

@JackAKirk
Copy link
Contributor

People have been getting confused, see e.g. #6922, due to warnings of mismatching triples in the HIP AMD and CUDA backends during linking. This warning occurs because the bitcode compiled from spirv libclc does not use the same triples as those passed to clang to compile SYCL in the CUDA, "nvptx64-nvidia-cuda", and HIP "amdgcn-amd-amdhsa" backends.
However these modules are created only to be linked with clang compiled SYCL code and the modules are always compatible.
Therefore in this patch we update the triples of the final remangled spirv modules and update the names of the final remangled .bcs that are built/installed/linked with the clang built .bcs.

Fixes #6922

JackAKirk added 4 commits October 31, 2022 10:32
Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
@JackAKirk JackAKirk requested review from a team as code owners November 1, 2022 10:58
@JackAKirk JackAKirk requested a review from romanovvlad November 1, 2022 10:58
@JackAKirk
Copy link
Contributor Author

By the way, we would like to have this cherry-picked for the 2023.0 release.

Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
@JackAKirk JackAKirk marked this pull request as draft November 1, 2022 12:46
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.

OK for driver

Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
@JackAKirk
Copy link
Contributor Author

Thanks for reviewing. I've put it as draft since I may refactor it a bit before merging. Will get back to it shortly.

@JackAKirk JackAKirk marked this pull request as ready for review November 2, 2022 21:03
@JackAKirk
Copy link
Contributor Author

Thanks for reviewing. I've put it as draft since I may refactor it a bit before merging. Will get back to it shortly.

cc @AerialMantis @romanovvlad @steffenlarsen @pvchupin

I've moved it from draft so it can be merged for the 2023.0 cherry pick. We were thinking of refactoring to avoid retyping the lib name everywhere but since it now needs to be in ASAP for the cherry pick we will leave it as it is for this PR. Correcting the lib names and triples has removed the red herring warning.

Test failure is known unrelated issue:
#7222

@pvchupin pvchupin merged commit ff49710 into intel:sycl Nov 2, 2022
codeplay-sycl pushed a commit to codeplaysoftware/intel-llvm-mirror that referenced this pull request Nov 14, 2022
…iple. (intel#7245)

People have been getting confused, see e.g.
intel#6922, due to warnings of
mismatching triples in the HIP AMD and CUDA backends during linking.
This warning occurs because the bitcode compiled from spirv libclc does
not use the same triples as those passed to clang to compile SYCL in the
CUDA, "nvptx64-nvidia-cuda", and HIP "amdgcn-amd-amdhsa" backends.
However these modules are created only to be linked with clang compiled
SYCL code and the modules are always compatible.
Therefore in this patch we update the triples of the final remangled
spirv modules and update the names of the final remangled .bcs that are
built/installed/linked with the clang built .bcs.


Fixes intel#6922

Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
Co-authored-by: JackAKirk <chezjakirk@gmail.com>
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.

[PI][HIP] warning: Linking two modules of different target triples: amdgcn-unknown-amdhsa and amdgcn-amd-amdhsa

4 participants

Comments