Skip to content
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

[SYCL] Add POCL support #52

Open
agozillon opened this issue Jul 18, 2019 · 1 comment
Open

[SYCL] Add POCL support #52

agozillon opened this issue Jul 18, 2019 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@agozillon
Copy link
Contributor

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:

  • Create a new Clang driver flag or someway to notify the Clang driver to use a different ToolChain or Tool
  • This flag should also set up at least the define __SYCL_SPIR_DEVICE__, this is already done for the Xilinx FPGA target, you can grep over the Clang and SYCL directories for it.
  • Create a new Tool or ToolChain for POCL
  • Create a new script for POCL, this script will be much simpler than the sycl-xocc script. All it needs to do is run some Opt passes, mainly the ASFixer (this may change in the future) and the InSPIRation pass

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:

  • Remove kernel name hashing from the InSPIRation pass and put it into it's own separate pass
  • This new pass should be added to the list of Opt passes ran in sycl-xocc or you'll probably break FPGA compilation
  • Alter the SYCL runtimes program_manager.cpp to only check for weird hashed names for kernels when it's a Xilinx device (perhaps even just a Xilinx FPGA device if that's possible).

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_SPIR_DEVICE__ 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 agozillon added enhancement New feature or request good first issue Good for newcomers labels Jul 18, 2019
@agozillon
Copy link
Contributor Author

#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...

Ralender pushed a commit to Ralender/sycl that referenced this issue Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant