-
Notifications
You must be signed in to change notification settings - Fork 740
2019 03 18 meeting notes
Alexey Bader, Oleg Maslov, Michael Kinsner, Anastasia Stulova, Ronan Keryell, Andrew Gozillon
None.
Lowering of OpenCL/SPIR/SPIR-V built-ins to LLVM IR: https://github.com/intel/llvm/issues/44.
Discussion summary
Problem statement: for targets which do not support SPIR-V format, but do support SPIR 1.2 or SPIR-df, we need resolve "SPIR-V" built-ins produced by SYCL front-end compiler.
Solutions proposed in the options #1 and #2 from the issue #44 seem to be difficult to upstream as they require "re-flower" pass, which renames functions/types declared in the SYCL headers to SPIR-V built-ins.
Something similar to the option #3 should allow us to achieve the same results w/o massive compiler modifications. User can link built-ins implementation with -mlink-builtin-bitcode
option. We can use SPIR-V built-ins in SYCL headers and define them in device specific library. For instance, Xilinx tool-chain can implement SPIR-V built-ins as SPIR-df built-ins in device specific library, although it's might be better to use something else to avoid name collision between user defined functions and OpenCL built-ins (e.g. __xilinx_sqrt
).
This approach is used for lowering AMDGPU/NVidia specific built-ins. Here is recent patch adding tool-chain support for linking with device library.
https://reviews.llvm.org/D59321 - AMDGPU: Teach toolchain to link ROCm device libs. Take a look at the driver test: test/Driver/rocm-device-libs.cl.
ROCm device library: https://github.com/RadeonOpenCompute/ROCm-Device-Libs.
Do we need SYCL specific attributes to mark "device side" symbols or existing OpenCL attributes can be re-used? E.g. __attribute__((sycl_kernel)) vs __kernel?
Alexey to prototype using OpenCL keywords instead of new attributes to check if there is a need for SYCL specific attributes.
To be discussed next time.