A C++ Programming Model for Heterogeneous System Architecture

  • Ralph PotterEmail author
  • Russell Bradford
  • Alastair Murray
  • Uwe Dolinsky
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9945)


This paper describes a shared-source programming model and compiler for Heterogeneous System Architecture, based on C++14.

Heterogeneous System Architecture provides hardware specifications, a runtime API and a virtual instruction set to enable heterogeneous processors to interoperate through a unified virtual address space. However, it does not define a high-level kernel language such as OpenCL C or CUDA. This lack of a high-level kernel language presents a barrier to the exploitation of the capabilities of these heterogeneous systems.

Through the use of automatic call-graph duplication in the compiler, we enable code reuse and sharing of data structures between host processor and accelerator devices with fewer annotations than CUDA or C++AMP. We utilize the unified virtual address space to enable sharing data between devices via pointers, rather than requiring copies. We show that through the use of address space inference, existing standard C++ code such as the standard template library can be utilized with minimal modifications on accelerators.


C++ Programming models Heterogeneous system architecture GPU 


  1. 1.
    HSA Foundation: HSA Platform System Architecture Specification. HSA (2015a)Google Scholar
  2. 2.
    HSA Foundation: HSA Runtime Programmers Reference Manual. HSA (2015c)Google Scholar
  3. 3.
    HSA Foundation: HSA Programmers Reference Manual. HSA (2015b)Google Scholar
  4. 4.
    Khronos OpenCL Working Group: The OpenCL Specification. Khronos (2015b)Google Scholar
  5. 5.
    NVIDIA Corporation: CUDA Programming Guide. NVIDIA (2008)Google Scholar
  6. 6.
    Microsoft: C++ AMP: Language and Programming Model. Microsoft (2013)Google Scholar
  7. 7.
    Khronos OpenCL Working Group – SYCL subgroup: SYCL Specification. Khronos (2015)Google Scholar
  8. 8.
    Cooper, P., Dolinsky, U., Donaldson, A.F., Richards, A., Riley, C., Russell, G.: Offload – automating code migration to heterogeneous multicore systems. In: Patt, Y.N., Foglia, P., Duesterwald, E., Faraboschi, P., Martorell, X. (eds.) HiPEAC 2010. LNCS, vol. 5952, pp. 337–352. Springer, Heidelberg (2010). doi: 10.1007/978-3-642-11515-8_25 CrossRefGoogle Scholar
  9. 9.
    Clang: a C language family frontend for LLVM (2015). Accessed 24 Nov 2015
  10. 10.
    Lattner, C., Adve, V.S.: LLVM: a compilation framework for lifelong program analysis & transformation. In: 2nd IEEE/ACM International Symposium on Code Generation and Optimization, pp. 75–88. IEEE Computer Society (2004)Google Scholar
  11. 11.
    McCalpin, J.D.: Memory bandwidth and machine balance in current high performance computers. In: IEEE Computer Society Technical Committee on Computer Architecture Newsletter (1995)Google Scholar
  12. 12.
    Batcher, K.E.: Sorting networks and their applications. In: AFIPS Conference Proceedings: 1968 Spring Joint Computer Conference. AFIPS Conference Proceedings, vol. 32, pp. 307–314. Thomson Book Company, Washington, D.C. (1968)Google Scholar
  13. 13.
    Rodgers, G.: CLOC compiler and sample SDK (2015). Accessed 29 Nov 2015
  14. 14.
    Jääskeläinen, P., de La Lama, C.S., Schnetter, E., Raiskila, K., Takala, J., Berg, H.: pocl: a performance-portable opencl implementation. Int. J. Parallel Prog. 43(5), 752–785 (2015)CrossRefGoogle Scholar
  15. 15.
    Yang, C.C., Wang, S.C., Chen, C.C., Lee, J.K.: The support of an experimental OpenCL compiler on HSA environments. In: Proceedings of the 21st International Conference on Parallel and Distributed Processing Techniques and Applications, pp. 184–190 (2015)Google Scholar
  16. 16.
    Sander, B., Stoner, G., chi Chan, S., Chung, W.H.: HCC: a C++ compiler for heterogeneous computing. Technical report, ISO/IEC JTC1 SC22 WG21 (2015)Google Scholar
  17. 17.
    Gaster, B.R., Howes, L.W.: OpenCL C++. In: Cavazos, J., Gong, X., Kaeli, D.R. (eds.) Proceedings of the 6th Workshop on General Purpose Processor Using Graphics Processing Units, GPGPU-6, pp. 86–95. ACM (2013)Google Scholar
  18. 18.
    Khronos OpenCL Working Group: The OpenCL C++ Specification. Khronos (2015a)Google Scholar
  19. 19.
    Hoberock, J.: Technical specification for C++ extensions for parallelism. Technical report, ISO/IEC JTC1 SC22 WG21 (2015)Google Scholar
  20. 20.
    Lutz, K.: Boost. Compute (2015). Accessed 29 Nov 2015

Copyright information

© Springer International Publishing AG 2016

Authors and Affiliations

  • Ralph Potter
    • 1
    Email author
  • Russell Bradford
    • 1
  • Alastair Murray
    • 2
  • Uwe Dolinsky
    • 2
  1. 1.Department of Computer ScienceUniversity of BathBathUK
  2. 2.Codeplay Software Ltd.EdinburghUK

Personalised recommendations