Published in

Elsevier, Computer Physics Communications, 4(182), p. 1093-1099

DOI: 10.1016/j.cpc.2010.12.052

Links

Tools

Export citation

Search in Google Scholar

Swan: A tool for porting CUDA programs to OpenCL

Journal article published in 2011 by M. J. Harvey ORCID, G. De Fabritiis ORCID
This paper is available in a repository.
This paper is available in a repository.

Full text: Download

Green circle
Preprint: archiving allowed
Red circle
Postprint: archiving forbidden
Red circle
Published version: archiving forbidden
Data provided by SHERPA/RoMEO

Abstract

The use of modern, high-performance graphical processing units (GPUs) for acceleration of scientific com-putation has been widely reported. The majority of this work has used the CUDA programming model sup-ported exclusively by GPUs manufactured by NVIDIA. An industry standardisation effort has recently pro-duced the OpenCL specification for GPU programming. This offers the benefits of hardware-independence and reduced dependence on proprietary tool-chains. Here we describe a source-to-source translation tool, "Swan" for facilitating the conversion of an existing CUDA code to use the OpenCL model, as a means to aid programmers experienced with CUDA in evaluating OpenCL and alternative hardware. While the performance of equivalent OpenCL and CUDA code on fixed hardware should be comparable, we find that a real-world CUDA application ported to OpenCL exhibits an overall slow-down of ≈ 50%, a reduction attributable to the immaturity of contemporary compilers. The ported application is shown have plat-form independence, running on both NVIDIA and AMD GPUs without modification. We conclude that OpenCL is a viable platform for developing portable GPU applications but that the more mature CUDA tools continue to provide best performance.