-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL][NATIVECPU] Support multiple SYCL targets in the same compiler invocation #10495
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
Conversation
This reverts commit d15e825d02adfc03373c3ed71834f2bdf47c57f4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
esimd lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments, but overall LGTM
Hello @intel/dpcpp-l0-pi-reviewers, please could you review this PR? Thank you! |
sycl/plugins/unified_runtime/ur/adapters/native_cpu/program.cpp
Outdated
Show resolved
Hide resolved
…-core/intel-llvm-mirror into pietro/subhandler_ir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@intel/llvm-gatekeepers this looks ready to be merged thank you :) |
…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 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:-fsycl-targets
(before we were just looking fornative_cpu
, ignoring the others). The Driver now also callssycl-post-link
andclang-offload-wrapper
, performing a compilation flow more similar to the one used for other targets.llvm/lib/SYCLLowerIR/RenameKernelSYCLNativeCPU.cpp
)._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.sycl/doc/design/SYCLNativeCPU.md
for more information.