Skip to main navigation Skip to search Skip to main content

Direct GPU Compilation and Execution for Host Applications with OpenMP Parallelism

  • Shilei Tian
  • , Joseph Huber
  • , Konstantinos Parasyris
  • , Barbara Chapman
  • , Johannes Doerfert
  • Stony Brook University
  • Advanced Micro Devices
  • Lawrence Livermore National Laboratory

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

5 Scopus citations

Abstract

Currently, offloading to accelerators requires users to identify which regions are to be executed on the device, what memory needs to be transferred, and how synchronization is to be resolved. On top of these manual tasks, many standard (C/C++ library) functions, such as file I/O or memory manipulation, cannot be directly executed on the device and need to be worked around by the user explicitly. This makes it challenging to port programs in the first place and hinders developers from testing features on the GPU and within the GPU compilation pipeline. Existing tests and test suites for the host are effectively unusable for accelerators and need to be manually ported to provide the same benefits for the devices as they do on the host. In this paper, we propose a direct GPU compilation scheme that leverages the portable target offloading interface provided by LLVM/OpenMP. Utilizing this infrastructure allows us to compile an existing host application for the GPU and execute it there with only a minimal wrapper layer for the user code, command line arguments, and a compiler provided GPU implementation of C/C++ standard library functions. The C/C++ library functions are partially implemented for direct device execution and otherwise fallback to remote procedure call (RPC) to call host functions transparently. Our proposed prototype will allow users to quickly compile for, and test on, the GPU without explicitly handling kernel launches, data mapping, or host-device synchronization. We evaluate our implementation using three proxy applications with host OpenMP parallelism and three microbenchmarks to test the correctness of our prototype GPU compilation.

Original languageEnglish
Title of host publicationProceedings of LLVM-HPC 2022
Subtitle of host publication8th Annual Workshop on the LLVM Compiler Infrastructure in HPC, Held in conjunction with SC 2022: The International Conference for High Performance Computing, Networking, Storage and Analysis
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages43-51
Number of pages9
ISBN (Electronic)9781665475587
DOIs
StatePublished - 2022
Event8th IEEE/ACM Annual Workshop on the LLVM Compiler Infrastructure in HPC, LLVM-HPC 2022 - Dallas, United States
Duration: Nov 13 2022Nov 18 2022

Publication series

NameProceedings of LLVM-HPC 2022: 8th Annual Workshop on the LLVM Compiler Infrastructure in HPC, Held in conjunction with SC 2022: The International Conference for High Performance Computing, Networking, Storage and Analysis

Conference

Conference8th IEEE/ACM Annual Workshop on the LLVM Compiler Infrastructure in HPC, LLVM-HPC 2022
Country/TerritoryUnited States
CityDallas
Period11/13/2211/18/22

Keywords

  • compilation
  • GPU
  • OpenMP
  • portability

Fingerprint

Dive into the research topics of 'Direct GPU Compilation and Execution for Host Applications with OpenMP Parallelism'. Together they form a unique fingerprint.

Cite this