triSYCL / sycl

SYCL for Vitis: Experimental fusion of triSYCL with Intel SYCL oneAPI DPC++ up-streaming effort into Clang/LLVM
Other
107 stars 19 forks source link

[SYCL] Add POCL support #52

Open agozillon opened 5 years ago

agozillon commented 5 years ago

It should be very simple to add support for POCL. Our kernels are already SPIR-df when we feed our FPGA target through. We just have some slight strangeness that we need to deal with for our HLS backend that's mixed in with some of the things we need for our SPIR-df transformations (mainly the kernel name hashing we do, we probably don't want or need that for POCL, but this is tied into the SYCL program_manager.cpp and the inSPIRation pass).

So briefly at a high level what should be done:

And that should be it, but there may be one or two things that need some minor tweaking in the SYCL runtime as the XILINX_* specific flags are turned off.

Removing weird kernel name modifications:

However if you don't really care about one step compilation using a driver, I think all you'd probably need to do to get a SPIR-df kernel working with POCL using 2 step compilation is to compile the device side kernel with the __SYCL_SPIRDEVICE__ macro defined and run the ASfixer and InSPIRation pass over them. There may have to be 1 or 2 other tweaks in the runtime as the XILINX related macros aren't defined and it's not likely to be a Xilinx device that's targeted but they shouldn't be too big of a problem.

If someone intends to implement this and there's any more questions on it, feel free to ping me in a comment and I'll get back to you ASAP I'm aware it's not incredibly detailed and I'm happy to ping people to the right segments of code if I still can...

agozillon commented 5 years ago

https://github.com/triSYCL/sycl/issues/10 is also worth considering adding a fix for if the POCL related issue hasn't been closed before this task is being worked on...