Automatic generation of CUDA code performing tensor manipulations using C++ expression templates

04/24/2018
by   Adam G. M. Lewis, et al.
0

We present a C++ library, TLoops, which uses a hierarchy of expression templates to represent operations upon tensorial quantities in single lines of C++ code that resemble analytic equations. These expressions may be run as-is, but may also be used to emit equivalent low-level C or CUDA code, which either performs the operations more quickly on the CPU, or allows them to be rapidly ported to run on NVIDIA GPUs. We detail the expression template and C++-class hierarchy that represents the expressions and which makes automatic code-generation possible. We then present benchmarks of the expression-template code, the automatically generated C code, and the automatically generated CUDA code running on several generations of NVIDIA GPU.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/04/2017

Compile-Time Symbolic Differentiation Using C++ Expression Templates

Template metaprogramming is a popular technique for implementing compile...
research
11/15/2019

Role-Oriented Code Generation in an Engine for Solving Hyperbolic PDE Systems

The development of a high performance PDE solver requires the combined e...
research
10/25/2017

Performance Portability Strategies for Grid C++ Expression Templates

One of the key requirements for the Lattice QCD Application Development ...
research
02/06/2021

FastAD: Expression Template-Based C++ Library for Fast and Memory-Efficient Automatic Differentiation

Automatic differentiation is a set of techniques to efficiently and accu...
research
11/01/2022

Expression Acceleration: Seamless Parallelization of Typed High-Level Languages

Efficient parallelization of algorithms on general-purpose GPUs is today...
research
05/02/2023

LatentAvatar: Learning Latent Expression Code for Expressive Neural Head Avatar

Existing approaches to animatable NeRF-based head avatars are either bui...
research
01/25/2019

Not So Fast: Analyzing the Performance of WebAssembly vs. Native Code

All major web browsers now support WebAssembly, a low-level bytecode int...

Please sign up or login with your details

Forgot password? Click here to reset