Title
Automatic Offloading C++ Expression Templates to CUDA Enabled GPUs
Abstract
In the last few years, many scientific applications have been developed for powerful graphics processing units (GPUs) and have achieved remarkable speedups. This success can be partially attributed to high performance host callable GPU library routines that are offloaded to GPUs at runtime. These library routines are based on C/C++-like programming toolkits such as CUDA from NVIDIA and have the same calling signatures as their CPU counterparts. Recently, with the sufficient support of C++ templates from CUDA, the emergence of template libraries have enabled further advancement in code reusability and rapid software development for GPUs. However, Expression Templates (ET), which have been very popular for implementing data parallel scientific software for host CPUs because of their intuitive and mathematics-like syntax, have been underutilized by GPU development libraries. The lack of ET usage is caused by the difficulty of offloading expression templates from hosts to GPUs due to the inability to pass instantiated expressions to GPU kernels as well as the absence of the exact form of the expressions for the templates at the time of coding. This paper presents a general approach that enables automatic offloading of C++ expression templates to CUDA enabled GPUs by using the C++ metaprogramming technique and Just-In-Time (JIT) compilation methodology to generate and compile CUDA kernels for corresponding expression templates followed by executing the kernels with appropriate arguments. This approach allows developers to port applications to run on GPUs with virtually no code modifications. More specifically, this paper uses a large ET based data parallel physics library called QDP++ as an example to illustrate many aspects of the approach to offload expression templates automatically and to demonstrate very good speedups for typical QDP++ applications running on GPUs against running on CPUs using this method of offloading. In addition, this approach of automatic offlo- ding expression templates could be applied to other many-core accelerators that provide C++ programming toolkits with the support of C++ template.
Year
DOI
Venue
2012
10.1109/IPDPSW.2012.293
IPDPS Workshops
Keywords
Field
DocType
gpu development libraries,just-in-time compilation methodology,qdp++,c++ metaprogramming technique,enabled gpus,gpu,template libraries,et based data parallel physics library,automatic offloading,automatic offloading expression template,parallel architectures,code reusability,graphics processing units,natural sciences computing,automatic offloading c++ expression templates,gpu kernels,cuda,automatic offloading c,software development,corresponding expression,multiprocessing systems,expression templates,gpu library routines,cuda kernel,c-c++-like programming toolkits,c++ language,offloading expression template,et usage,jit compilation methodology,general approach,jit,c++,gpu development library,cpu,instantiated expression,data parallel scientific software,many-core accelerators,nvidia,software engineering,scientific applications,program compilers,expression template,vectors,kernel,lattices,c
Metaprogramming,CUDA,Computer science,Expression templates,Parallel computing,Compiler,Template,Graphics processing unit,Software development,Reusability
Conference
ISSN
ISBN
Citations 
2164-7062
978-1-4673-0974-5
4
PageRank 
References 
Authors
0.59
5
4
Name
Order
Citations
PageRank
Jie Chen12487353.65
Balint Joo2173.59
William Watson III3193.12
Robert Edwards440.59