Source-to-Source Code Translator: OpenMP C to CUDA

  • Authors:
  • Gabriel Noaje;Christophe Jaillet;Michaël Krajecki

  • Affiliations:
  • -;-;-

  • Venue:
  • HPCC '11 Proceedings of the 2011 IEEE International Conference on High Performance Computing and Communications
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

In recent years hardware accelerators have become a full part of the HPC domain as their peak performance has increased steadily. Although their programmability has greatly improved and different tools have been developed to smooth down their learning curve, porting legacy code to the new programming models could reveal itself a cumbersome and time-consuming process. However a large amount of code benefits from the multicore architectures using either a shared memory model or a distributed model. Our goal was to allow developers to benefit from the simplicity of OpenMP code and at the same time permitting their code to be executed on GPUs many core architectures. Thus we propose a source-to-source compiler able to automatically transform an OpenMP C code into a CUDA code, while maintaining a human readable version of the code that can be further analyzed or optimized. Using the OMPi compiler as a base ground, we implemented the "pragma omp parallel for" transformation along with data visibility clauses. The generated code is fully NVIDIA CUDA compliant and can be compiled using the nvcc compiler. In this paper we present the entire transformation process, starting from the pragma split-up and kernel generation, passing through the data visibility clauses management and ending with the device memory management and kernel launch system.