-
Notifications
You must be signed in to change notification settings - Fork 37
Description
Hi this is the task we have discussed at length in the last few meetings. @nscottnichols can you start to have a look? (I added you to the project so that it can be "assigned" even in github). CC @jtchilders @oliviermattelaer @roiser for info.
The idea is to add support for Intel GPUs via SYCL in cudacpp (using the same #ifdef approach as for HIP and CUDA), rather than in a separate plugin.
This is essentially the analog of what Jorgen did for AMD GPUs with HIP in PR #774 (superseded by PR #801). More details are provided in issue #311. Very briefly the task will probably be: easier/shorter, in the sense that replacing CUDACC by MGONGPUCPP_GPUIMPL in all ifdefs has been done by Jorgen already; more complex, because it is not as easy as replacing cudaMalloc by hipMalloc.
I guess the main points will be
- In GpuAbstraction.h, add the appropriate defines for things like malloc, free, memcpy and also gpulaunchkernel, assuming that this is possible so easily, which is not obvious.
- If something more complex is needed for data handling, I hope that the encapsulation I had tried to add in MemoryBuffers and the various MemoryAccess functions should be enough. In general the idea was to have data buffers accessible as a single pointer, and then provide accessors to decode those single pointers into data values. I think this is similar to what the future C++ parallel with mdspan etc will do, and also similar to what kokkos does IIUC. I am not sure how easily that translates to SYCL (maybe kokkos is closer?).
- If something more complex is needed for kernel launching, I hope that a slightly longer define can be written in GpuAsbtraction? Or maybe this can become a real class/method if needed if a preprocessor define is just too complex.
- The cudacpp.mk and cudacpp_src.mk also needs the relevant build commands, like Jorgen added for HIP.
Thanks, Andrea