Haidl, M., Steuwer, M. , Humernbrum, T. and Gorlatch, S. (2016) Multi-Stage Programming for GPUs in C++ using PACXX. GPGPU '16 Proceedings of the 9th Annual Workshop on General Purpose Processing using Graphics Processing Unit, Barcelona, Spain, 12 Mar 2016. pp. 32-41. ISBN 9781450341950 (doi: 10.1145/2884045.2884049)
|
Text
146601.pdf - Accepted Version 522kB |
Abstract
Writing and optimizing programs for high performance on systems with GPUs remains a challenging task even for expert programmers. One promising optimization technique is to evaluate parts of the program upfront on the CPU and embed the computed results in the GPU code allowing for more aggressive compiler optimizations. This technique is known as multi-stage programming and has proven to allow for significant performance benefits. Unfortunately, to achieve such optimizations in current GPU programming models like OpenCL, programmers are forced to manipulate the GPU source code as plain strings, which is error-prone and type-unsafe. In this paper we describe PACXX - a GPU programming approach using modern C++ standards, with the convenient features like type deduction, lambda expressions, and algorithms from the standard template library (STL). Using PACXX, a GPU program is written as a single C++ program, rather than two distinct host and kernel programs. We extend PACXX with an easy-to-use and type-safe API for multi-stage programming avoiding the pitfalls of string manipulation. Using just-in-time compilation techniques, PACXX generates efficient GPU code at runtime. Our evaluation shows that using PACXX allows for writing multi-stage code easier and safer than currently possible. Using two detailed application studies we show that multi-stage programming can significantly outperform equivalent non-staged programs. Furthermore, we show that PACXX generates code with performance comparable to industrial-strength OpenCL compilers.
Item Type: | Conference or Workshop Item |
---|---|
Status: | Published |
Refereed: | Yes |
Glasgow Author(s) Enlighten ID: | Steuwer, Dr Michel |
Authors: | Haidl, M., Steuwer, M., Humernbrum, T., and Gorlatch, S. |
Subjects: | Q Science > QA Mathematics > QA75 Electronic computers. Computer science |
College/School: | College of Science and Engineering > School of Computing Science |
ISBN: | 9781450341950 |
Copyright Holders: | Copyright © 2016 ACM |
First Published: | First published in GPGPU '16 Proceedings of the 9th Annual Workshop on General Purpose Processing using Graphics Processing Unit: 32-41 |
Publisher Policy: | Reproduced in accordance with the publisher copyright policy |
University Staff: Request a correction | Enlighten Editors: Update this record