Swan is a small tool that aids the reversible conversion of existing CUDA codebases to OpenCL. Its main features are the translation of CUDA kernel source-code to OpenCL, and a common API that abstracts both CUDA and OpenCL runtimes. Swan preserves the convenience of the CUDA <<< grid, block >>> kernel launch syntax by generating C source-code for kernel entry-point functions. Possible uses include:
- Evaluating OpenCL performance of an existing CUDA code
- Maintaining a dual-target OpenCL and CUDA code
- Reducing dependence on NVCC when compiling host code
- Support multiple CUDA compute capabilities in a single binary
Swan is developed by the MultiscaleLab, Barcelona, and is available under the GPL2 license.