Abstract
In order to help programs exploit the power of systems compatible with the HSA, compilers and runtimes of high-level programming languages or domain-specific languages should target HSA for portable code generation and runtime management. In this chapter, we use C++ AMP, a parallel programming extension to C++, to show how efficient HSAIL code can be generated from a higher-level programming model. We discuss important translation techniques, such as mapping between C++ constructs and HSA features, compilation processes for GPU and CPU codes, tiling support, memory segment annotation. In addition, we explain how to access HSA-specific features such as shared virtual memory and platform atomics from C++, and we cover how they are mapped to HSAIL. These techniques can be useful for compiler writers interested in mapping other programming models to HSA. The implementation, Kalmar, which consists of a compiler, a set of header files, and a runtime library, is publicly accessible as an open source project.
Original language | English (US) |
---|---|
Title of host publication | Heterogeneous System Architecture |
Subtitle of host publication | A New Compute Platform Infrastructure |
Publisher | Elsevier Inc. |
Pages | 97-129 |
Number of pages | 33 |
ISBN (Print) | 9780128003862 |
DOIs | |
State | Published - 2016 |
Keywords
- C++ AMP
- Code generation
- Compiler
- HSAIL
- Kalmar
- Parallel programming
- Platform atomics
- Programming model
- Shared virtual memory
ASJC Scopus subject areas
- General Computer Science