Native Offload of Haskell Repa Programs to GPGPU

Hangjin Liu, Laurence E. Day, Neal Glew, Todd A. Anderson, Rajkishore Barik · 2014

In light of recent hardware advances, General Purpose Graph-ics Processing Units (GPGPUs) are becoming increasingly com-monplace, and demand novel programming models to account for their radically different architecture. For the most part, existing ap-proaches to programming GPGPUs within a high-level program-ming language choose to embed a domain specific language (DSL) within a host metalanguage and implement a compiler mapping programs written within said DSL to code in low-level languages such as OpenCL or CUDA. We question this design choice, and argue that by directly implementing a GPGPU offload primitive as part of a general-purpose language compiler, we gain access to a substantial number of existing optimization techniques with-out having to reimplement them in a DSL compiler. In this paper we describe the structure of our prototypical treatment of this re-search direction, demonstrating the applicability of our approach by showing how to bridge between APIs by extending the Repa library of Haskell with an offload primitive, and detailing an ex-perimental implementation of our approach within the Intel Labs Haskell Research Compiler. We also provide a detailed study of a set of nine benchmarks, by compiling them to both GPU and two distinct CPUs and comparing their performance.

Read the paper · More papers on PaperTik