Polyhedral Compilation Support for C++ Features: A Case Study with CPPTRAJ
This paper reveals challenges in migrating C++ codes to GPUs using polyhedral compiler technology. We point to instances where reasoning about C++ constructs in a polyhedral model is feasible. We describe a case study using CPPTRAJ, an analysis code for molecular dynamics trajectory data. An initial experiment applied the CUDA-CHiLL compiler to key computations in CPPTRAJ to migrate them to the GPUs of NCSA’s Blue Waters supercomputer. We found three aspects of this code made program analysis difficult: (1) STL C++ vectors; (2) structures of vectors; and, (3) iterators over these structures. We show how we can rewrite the computation to affine form suitable for CUDA-CHiLL, and also describe how to support the original C++ code in a polyhedral framework. The result of this effort yielded speedups over serial ranging from 3\(\times \) to 278\(\times \) on the six optimized kernels, and up to 100\(\times \) over serial and 10\(\times \) speedup over OpenMP.
This research is part of the Blue Waters sustained-petascale computing project, which is supported by the National Science Foundation (awards OCI-0725070 and ACI-1238993) and the state of Illinois. Blue Waters is a joint effort of the University of Illinois at Urbana-Champaign and its National Center for Supercomputing Applications.
- 4.Rudy, G., Khan, M.M., Hall, M., Chen, C., Chame, J.: A programming language interface to describe transformations and code generation. In: Cooper, K., Mellor-Crummey, J., Sarkar, V. (eds.) LCPC 2010. LNCS, vol. 6548, pp. 136–150. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-19595-2_10CrossRefGoogle Scholar
- 7.Allen, R., Kennedy, K.: Optimizing Compilers for Modern Architectures: A Dependence-Based Approach. Morgan Kaufmann Publishers, Burlington (2002)Google Scholar
- 8.Ancourt, C., Irigoin, F.: Scanning polyhedra with DO loops. In: Symposium on Principles and Practice of Parallel Programming, April 1991Google Scholar
- 9.Kelly, W.A.: Optimization within a unified transformation framework. Ph.D. dissertation, University of Maryland, December 1996Google Scholar
- 12.Chen, C.: Polyhedra scanning revisited. In: Proceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation, ser. PLDI 2012, pp. 499–508, June 2012Google Scholar
- 13.Adamski, D., Jablonski, G., Perek, P., Napieralski, A.: Polyhedral source-to-source compiler. In: 2016 MIXDES - 23rd International Conference Mixed Design of Integrated Circuits and Systems, pp. 458–463, June 2016Google Scholar
- 15.Baskaran, M.M., Ramanujam, J., Sadayappan, P.: Automatic C-to-CUDA code generation for affine programs. In: Proceedings of the International Conference on Compiler Construction, March 2010Google Scholar
- 16.Leung, A.: A mapping path for multi-GPGPU accelerated computers from a portable high level programming abstraction. In: Workshop on General-Purpose Processing using GPUs, September 2010Google Scholar