18181

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

Adam G.M. Lewis, Harald P. Pfeiffer
Canadian Institute for Theoretical Astrophysics, 60 St George St, Toronto, M5S 3H8, Ontario, Canada
arXiv:1804.10120 [cs.MS], (24 Apr 2018)

@article{lewis2018automatic,

   title={Automatic generation of CUDA code performing tensor manipulations using C++ expression templates},

   author={Lewis, Adam G.M. and Pfeiffer, Harald P.},

   year={2018},

   month={apr},

   archivePrefix={"arXiv"},

   primaryClass={cs.MS}

}

Download Download (PDF)   View View   Source Source   

2668

views

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.
Rating: 2.5/5. From 2 votes.
Please wait...

* * *

* * *

HGPU group © 2010-2024 hgpu.org

All rights belong to the respective authors

Contact us: