PyCUDA and PyOpenCL: A scripting-based approach to GPU run-time code generation

Andreas Klöckner, Nicolas Pinto, Yunsup Lee, Bryan Catanzaro, Paul Ivanov, Ahmed Fasih

Research output: Contribution to journalArticlepeer-review

Abstract

High-performance computing has recently seen a surge of interest in heterogeneous systems, with an emphasis on modern Graphics Processing Units (GPUs). These devices offer tremendous potential for performance and efficiency in important large-scale applications of computational science. However, exploiting this potential can be challenging, as one must adapt to the specialized and rapidly evolving computing environment currently exhibited by GPUs. One way of addressing this challenge is to embrace better techniques and develop tools tailored to their needs. This article presents one simple technique, GPU run-time code generation (RTCG), along with PyCUDA and PyOpenCL, two open-source toolkits that supports this technique. In introducing PyCUDA and PyOpenCL, this article proposes the combination of a dynamic, high-level scripting language with the massive performance of a GPU as a compelling two-tiered computing platform, potentially offering significant performance and productivity advantages over conventional single-tier, static systems. The concept of RTCG is simple and easily implemented using existing, robust infrastructure. Nonetheless it is powerful enough to support (and encourage) the creation of custom application-specific tools by its users. The premise of the paper is illustrated by a wide range of examples where the technique has been applied with considerable success.

Original languageEnglish (US)
Pages (from-to)157-174
Number of pages18
JournalParallel Computing
Volume38
Issue number3
DOIs
StatePublished - Mar 2012
Externally publishedYes

Keywords

  • Automated tuning
  • CUDA
  • Code generation
  • GPU
  • High-level languages
  • Many-core
  • Massive parallelism
  • OpenCL
  • Single-instruction multiple-data
  • Software engineering

ASJC Scopus subject areas

  • Software
  • Theoretical Computer Science
  • Hardware and Architecture
  • Computer Networks and Communications
  • Computer Graphics and Computer-Aided Design
  • Artificial Intelligence

Fingerprint

Dive into the research topics of 'PyCUDA and PyOpenCL: A scripting-based approach to GPU run-time code generation'. Together they form a unique fingerprint.

Cite this