OpenCL C++

  • Authors:
  • Benedict R. Gaster;Lee Howes

  • Affiliations:
  • Advanced Micro Devices, Sunnyvale, CA;Advanced Micro Devices, Sunnyvale, CA

  • Venue:
  • Proceedings of the 6th Workshop on General Purpose Processor Using Graphics Processing Units
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

With the success of programming models such as Khronos' OpenCL, heterogeneous computing is going mainstream. However, these models are low-level, even when considering them as systems programming models. For example, OpenCL is effectively an extended subset of C99, limited to the type unsafe procedural abstraction that C has provided for more than 30 years. Computer systems programming has for more than two decades been able to do a lot better. One successful case in point is the systems programming language C++, known for its strong(er) type system, templates, and object-oriented abstraction features. In this paper we introduce OpenCL C++, an object-oriented programming model (based on C++11) for heterogeneous computing and an alternative for developers targeting OpenCL enabled devices. We show that OpenCL C's address space qualifiers, and by implication Embedded C's, can be lifted into C++'s type system. A novel application of C++11's new type inference features (auto/decltype) with respect to address space qualifiers allows natural and generic use of the this pointer. We qualitatively show that OpenCL C++ is a simpler and a more expressive development platform than its OpenCL C counter part.