taco
taco copied to clipboard
Is it possible to generate OpenCL kernels with TACO?
Could TACO be used to generate OpenCL kernels? If not, what should be modified to allow OpenCL kernel generation?
In theory TACO could be used to generate OpenCL kernels, but cannot currently. If you were interested in such a thing, looking at codegen_cuda.cpp
would be the place to start. It lowers a loop-based intermediate representation into CUDA code. If your goal is to target AMD GPUs, targeting HIP would be the easiest thing instead, as you could just replace all of the CUDA calls with the corresponding HIP calls.
Thanks a lot for answering,
The goal that I have in mind is to use FPGAs for which I think that the code generation shall target OpenCL-C.
Targeting different kinds of hardware will likely be more work than just adjusting the code generator. @weiya711 has been working on mapping TACO down to CGRA's and other accelerators and can comment more.
Yes, I agree with you @rohany. However, initially being able to generate kernels in OpenCL-C will suffice. Will a sensible modification of codegen_cuda.cpp
be enough to accomplish this task?
I've never written OpenCL targeting FPGA's before, so I cannot say for certain. The farther away this programming model moves from the threaded style of GPU programming the harder it will be to accomplish your task with just a change to the code generator. As Olivia has done in her work, for different programming models, and entirely different compilation workflow is needed to effectively target them.
Please allow me to insist. It will be sufficient to modify codegen_cuda.cpp
in order to generate OpenCL-C code, The OpenCL-C standard is fully supported by OneAPI, which allows running a program on an FPGA in emulation mode for debugging and also allows for hardware compilation.