Abstract
While OpenCL was originally designed as an application programming interface (API) for human developers, it can also serve as an implementation platform for higher-level object-oriented programming languages such as C++. Targeting OpenCL rather than vendor-specific platforms allows high-level language compiler developers to focus on language implementation issues rather than the vendor-specific intricacies across different types of devices in a heterogeneous computing system. In this chapter, we show that OpenCL 2.0 provides a strong foundation for implementing C++ Accelerated Massive Parallelism (AMP), a parallel extension to C++. We show a mapping of C++ AMP constructs to OpenCL. We also demonstrate that the OpenCL kernels generated from C++ AMP parallel_for_all and related constructs with automatically generated data transfer API calls can achieve a performance level that is comparable to that of hand-coded OpenCL kernels. We expect that compiler developers who need to target other high-level languages to heterogeneous computing systems will benefit from the techniques and experience presented in this chapter.
Original language | English (US) |
---|---|
Title of host publication | Heterogeneous Computing with OpenCL 2.0 |
Subtitle of host publication | Third Edition |
Publisher | Elsevier Inc. |
Pages | 249-272 |
Number of pages | 24 |
ISBN (Electronic) | 9780128016497 |
ISBN (Print) | 9780128014141 |
DOIs | |
State | Published - May 18 2015 |
Externally published | Yes |
Keywords
- C++ AMP
- Compiler target
- Functor
- Heterogeneous computing
- Lambda
- Object-oriented language
- OpenCL
- Variable capturing
ASJC Scopus subject areas
- General Computer Science