[SYCL][NATIVECPU] Support multiple SYCL targets in the same compiler invocation#10495
Merged
Conversation
This reverts commit d15e825d02adfc03373c3ed71834f2bdf47c57f4.
bso-intel
approved these changes
Jul 31, 2023
AlexeySachkov
approved these changes
Aug 1, 2023
Contributor
AlexeySachkov
left a comment
There was a problem hiding this comment.
A few comments, but overall LGTM
Contributor
|
Hello @intel/dpcpp-l0-pi-reviewers, please could you review this PR? Thank you! |
…-core/intel-llvm-mirror into pietro/subhandler_ir
Contributor
Author
|
@intel/llvm-gatekeepers this looks ready to be merged thank you :) |
mdtoguchi
pushed a commit
to mdtoguchi/llvm
that referenced
this pull request
Oct 18, 2023
…invocation (intel#10495) This PR adds support to multiple SYCL targets alongside `native_cpu` in the same compiler invocation (e.g. `clang++ -fsycl -fsycl-targets=native_cpu,spir64 input.cpp`). In order to implement this we had to make changes to multiple components, here is a quick overview: * Driver: changes in the Driver allow to correctly parse all the targets passed to `-fsycl-targets` (before we were just looking for `native_cpu`, ignoring the others). The Driver now also calls `sycl-post-link` and `clang-offload-wrapper`, performing a compilation flow more similar to the one used for other targets. * Sema: since the kernel name needs to be the same for all the SYCL targets, the change to the kernel name in Sema has been removed, and replaced with an LLVM Pass that gets run when lowering the device module (`llvm/lib/SYCLLowerIR/RenameKernelSYCLNativeCPU.cpp`). * Runtime: The definition for `_pi_program` in the Native CPU Plug-In now supports multiple kernels in one program, and the `__SYCL_PI_DEVICE_BINARY_TARGET_NATIVE_CPU` binary type has been added in order to identify kernels compiled for Native CPU. * clang-offload-wrapper: for Native CPU, the offload-wrapper doesn't bundle the device code in the host module, but instead produces an array containing function declarations that are resolved by the linker, see `sycl/doc/design/SYCLNativeCPU.md` for more information. --------- Co-authored-by: Uwe Dolinsky <uwe@codeplay.com> Co-authored-by: Alexey Sachkov <alexey.sachkov@intel.com> Co-authored-by: Steffen Larsen <steffen.larsen@intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support to multiple SYCL targets alongside
native_cpuin the same compiler invocation (e.g.clang++ -fsycl -fsycl-targets=native_cpu,spir64 input.cpp). In order to implement this we had to make changes to multiple components, here is a quick overview:-fsycl-targets(before we were just looking fornative_cpu, ignoring the others). The Driver now also callssycl-post-linkandclang-offload-wrapper, performing a compilation flow more similar to the one used for other targets.llvm/lib/SYCLLowerIR/RenameKernelSYCLNativeCPU.cpp)._pi_programin the Native CPU Plug-In now supports multiple kernels in one program, and the__SYCL_PI_DEVICE_BINARY_TARGET_NATIVE_CPUbinary type has been added in order to identify kernels compiled for Native CPU.sycl/doc/design/SYCLNativeCPU.mdfor more information.