Coriander Project: Compile CUDA Codes To OpenCL, Run Everywhere
AMD's GPUOpen has been working on the HIP compiler to allow NVIDIA CUDA code to be executed on AMD GPUs, but now there's a separate and more universal effort: Coriander.
The Coriander project, formerly known as the CUDA-On-CL effort, is allowing NVIDIA CUDA code to be compiled into OpenCL 1.2 kernels. With targeting generic OpenCL 1.2 code, this automatically ported code from CUDA can run on all GPUs having a CL 1.2 implementation. This effort uses LLVM's Clang to compile the CUDA kernels into bytecode and then from there is an OpenCL generator to take the bytecode into OpenCL 1.2 compliant code. There's also work on implementing portions of the CUDA API in OpenCL.
The generated OpenCL code is slower for full reductions and large batch sizes but is comparable for other operations. This project is at a stage where "CUDA-on-CL actually works, on some fairly complex kernels." Coriander is working with both Intel and Radeon graphics hardware as well as running back on NVIDIA GPUs over OpenCL, which makes for useful performance comparisons.
Those wanting to learn more can see these IWOCL slides while the code is hosted on GitHub under the Apache 2.0 license.
The Coriander project, formerly known as the CUDA-On-CL effort, is allowing NVIDIA CUDA code to be compiled into OpenCL 1.2 kernels. With targeting generic OpenCL 1.2 code, this automatically ported code from CUDA can run on all GPUs having a CL 1.2 implementation. This effort uses LLVM's Clang to compile the CUDA kernels into bytecode and then from there is an OpenCL generator to take the bytecode into OpenCL 1.2 compliant code. There's also work on implementing portions of the CUDA API in OpenCL.
The generated OpenCL code is slower for full reductions and large batch sizes but is comparable for other operations. This project is at a stage where "CUDA-on-CL actually works, on some fairly complex kernels." Coriander is working with both Intel and Radeon graphics hardware as well as running back on NVIDIA GPUs over OpenCL, which makes for useful performance comparisons.
Those wanting to learn more can see these IWOCL slides while the code is hosted on GitHub under the Apache 2.0 license.
11 Comments