Skip to main content
QUICK REVIEW

[Paper Review] OCCA: A unified approach to multi-threading languages

David Medina, St-Cyr, Amik|arXiv (Cornell University)|Mar 4, 2014
Parallel Computing and Optimization TechniquesComputer Science34 references84 citations
TL;DR

OCCA is a C++ library that enables portable, high-performance parallel computing by using runtime compilation and macro expansions to unify OpenMP, OpenCL, and CUDA into a single kernel language. It allows developers to write portable kernels that compile to multiple target threading languages, achieving high performance across diverse architectures like CPUs, GPUs, and Intel Xeon Phi.

ABSTRACT

The inability to predict lasting languages and architectures led us to develop OCCA, a C++ library focused on host-device interaction. Using run-time compilation and macro expansions, the result is a novel single kernel language that expands to multiple threading languages. Currently, OCCA supports device kernel expansions for the OpenMP, OpenCL, and CUDA platforms. Computational results using finite difference, spectral element and discontinuous Galerkin methods show OCCA delivers portable high performance in different architectures and platforms.

Motivation & Objective

  • To address the challenge of architectural and language fragmentation in heterogeneous parallel computing.
  • To eliminate vendor lock-in by enabling portable code across multiple accelerators such as NVIDIA GPUs, AMD GPUs, and Intel Xeon Phi.
  • To provide a unified programming model that abstracts low-level threading differences while preserving performance.
  • To support high-performance numerical methods like finite difference, spectral element, and discontinuous Galerkin through portable kernel generation.

Proposed method

  • OCCA uses runtime compilation and C++ macro expansions to generate platform-specific kernels from a single source kernel.
  • It introduces a unified kernel language with keywords that map to equivalent constructs in OpenMP, OpenCL, and CUDA.
  • The library provides platform-agnostic abstractions for thread and block indexing, memory attributes, and synchronization primitives.
  • It supports kernel compilation and execution on CPU, GPU, and Xeon Phi via platform-specific macro expansions.
  • OCCA includes keywords for shared, global, constant, and private memory, as well as barriers and memory fences.
  • It enables automatic code generation for different threading models through a consistent interface, reducing porting effort.

Experimental results

Research questions

  • RQ1How can a single kernel language be unified across multiple parallel programming models such as OpenMP, OpenCL, and CUDA?
  • RQ2What mechanisms enable high-performance, portable code generation across diverse hardware architectures including CPUs, GPUs, and Xeon Phi?
  • RQ3To what extent can macro-based runtime compilation reduce the maintenance burden of supporting multiple parallel back-ends?
  • RQ4How does OCCA’s abstraction layer preserve performance compared to hand-optimized kernels in CUDA or OpenCL?
  • RQ5Can OCCA effectively support complex numerical methods like discontinuous Galerkin and spectral element methods across heterogeneous platforms?

Key findings

  • OCCA successfully generates portable kernels that compile to OpenMP, OpenCL, and CUDA, enabling cross-architecture deployment.
  • The library achieves high performance in finite difference, spectral element, and discontinuous Galerkin methods across multiple platforms.
  • Runtime compilation and macro expansion allow a single kernel source to target multiple threading back-ends without code duplication.
  • Platform-specific optimizations are supported through OCCA keywords that map to native constructs in OpenMP, OpenCL, and CUDA.
  • The use of unified keywords for thread indexing, memory attributes, and synchronization reduces porting complexity.
  • OCCA enables performance-portable scientific computing by abstracting low-level threading differences while maintaining low-level control over memory and execution.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.