Mapping high-level programming languages to OpenCL 2.0: A compiler writer's perspective

I. Jui Sung, Wen Heng Chung, Yun Wei Lee, Wen-Mei W Hwu

Research output: Chapter in Book/Report/Conference proceedingChapter

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 languageEnglish (US)
Title of host publicationHeterogeneous Computing with OpenCL 2.0
Subtitle of host publicationThird Edition
PublisherElsevier Inc.
Pages249-272
Number of pages24
ISBN (Electronic)9780128016497
ISBN (Print)9780128014141
DOIs
StatePublished - May 18 2015
Externally publishedYes

Fingerprint

High level languages
Application programming interfaces (API)
Computer programming languages
Object oriented programming
Data transfer

Keywords

  • C++ AMP
  • Compiler target
  • Functor
  • Heterogeneous computing
  • Lambda
  • Object-oriented language
  • OpenCL
  • Variable capturing

ASJC Scopus subject areas

  • Computer Science(all)

Cite this

Sung, I. J., Chung, W. H., Lee, Y. W., & Hwu, W-M. W. (2015). Mapping high-level programming languages to OpenCL 2.0: A compiler writer's perspective. In Heterogeneous Computing with OpenCL 2.0: Third Edition (pp. 249-272). Elsevier Inc.. https://doi.org/10.1016/B978-0-12-801414-1.00011-9

Mapping high-level programming languages to OpenCL 2.0 : A compiler writer's perspective. / Sung, I. Jui; Chung, Wen Heng; Lee, Yun Wei; Hwu, Wen-Mei W.

Heterogeneous Computing with OpenCL 2.0: Third Edition. Elsevier Inc., 2015. p. 249-272.

Research output: Chapter in Book/Report/Conference proceedingChapter

Sung, IJ, Chung, WH, Lee, YW & Hwu, W-MW 2015, Mapping high-level programming languages to OpenCL 2.0: A compiler writer's perspective. in Heterogeneous Computing with OpenCL 2.0: Third Edition. Elsevier Inc., pp. 249-272. https://doi.org/10.1016/B978-0-12-801414-1.00011-9
Sung IJ, Chung WH, Lee YW, Hwu W-MW. Mapping high-level programming languages to OpenCL 2.0: A compiler writer's perspective. In Heterogeneous Computing with OpenCL 2.0: Third Edition. Elsevier Inc. 2015. p. 249-272 https://doi.org/10.1016/B978-0-12-801414-1.00011-9
Sung, I. Jui ; Chung, Wen Heng ; Lee, Yun Wei ; Hwu, Wen-Mei W. / Mapping high-level programming languages to OpenCL 2.0 : A compiler writer's perspective. Heterogeneous Computing with OpenCL 2.0: Third Edition. Elsevier Inc., 2015. pp. 249-272
@inbook{2720df15899c4ed691414eeccde85a5c,
title = "Mapping high-level programming languages to OpenCL 2.0: A compiler writer's perspective",
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.",
keywords = "C++ AMP, Compiler target, Functor, Heterogeneous computing, Lambda, Object-oriented language, OpenCL, Variable capturing",
author = "Sung, {I. Jui} and Chung, {Wen Heng} and Lee, {Yun Wei} and Hwu, {Wen-Mei W}",
year = "2015",
month = "5",
day = "18",
doi = "10.1016/B978-0-12-801414-1.00011-9",
language = "English (US)",
isbn = "9780128014141",
pages = "249--272",
booktitle = "Heterogeneous Computing with OpenCL 2.0",
publisher = "Elsevier Inc.",

}

TY - CHAP

T1 - Mapping high-level programming languages to OpenCL 2.0

T2 - A compiler writer's perspective

AU - Sung, I. Jui

AU - Chung, Wen Heng

AU - Lee, Yun Wei

AU - Hwu, Wen-Mei W

PY - 2015/5/18

Y1 - 2015/5/18

N2 - 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.

AB - 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.

KW - C++ AMP

KW - Compiler target

KW - Functor

KW - Heterogeneous computing

KW - Lambda

KW - Object-oriented language

KW - OpenCL

KW - Variable capturing

UR - http://www.scopus.com/inward/record.url?scp=84940015821&partnerID=8YFLogxK

UR - http://www.scopus.com/inward/citedby.url?scp=84940015821&partnerID=8YFLogxK

U2 - 10.1016/B978-0-12-801414-1.00011-9

DO - 10.1016/B978-0-12-801414-1.00011-9

M3 - Chapter

AN - SCOPUS:84940015821

SN - 9780128014141

SP - 249

EP - 272

BT - Heterogeneous Computing with OpenCL 2.0

PB - Elsevier Inc.

ER -