Abstract
In this paper we discuss the interaction of expression templates with OpenCL devices. We show how the expression tree of expression templates can be used to generate problem specific OpenCL kernels. In a second approach we use expression templates to optimize the data transfer between the host and the device which leads to a measurable performance increase in a domain specific language approach. We tested the functionality, correctness and performance for both implementations in a case study for vector and matrix operations.
Keywords
- GPGPU
- OpenCL
- C++
- Expression templates
- Domain specific language
- Code generation
This is a preview of subscription content, access via your institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Alexandrescu, A.: Modern C++ design: generic programming and design patterns applied. Addison-Wesley Longman Publishing Co., Inc., Boston (2001)
AMD: AMD accelerated parallel processing OpenCL programming guide, version 1.2c (April 2011)
Brodtkorb, A.R., Dyken, C., Hagen, T.R., Hjelmervik, J.M., Storaasli, O.O.: State-of-the-art in heterogeneous computing. Sci. Program. 18, 1–33 (2010)
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design patterns: elements of reusable object-oriented software. Addison-Wesley Longman Publishing Co., Inc., Boston (1995)
Härdtlein, J.: Moderne Expression Templates Programmierung. Ph.D. thesis, Universität Erlangen-Nürnberg (2007) (in German)
Intel: Intel OpenCL SDK user’s guide, document number 323626-001US (2011)
Khronos OpenCL Working Group: The OpenCL Specification, version 1.1.44 (June 2011)
Lerch, M., Wolff v. Gudenberg, J.: Expression templates for dot product expressions. Reliable Computing 5(1), 69–80 (1999)
Lippman, S.B. (ed.): C++ Gems. SIGS Publications, Inc., New York (1996)
Nehmeier, M.: Interval arithmetic using expression templates, template meta programming and the upcoming C++ standard. Computing 94(2), 215–228 (2012), http://dx.doi.org/10.1007/s00607-011-0176-6
Nehmeier, M., Wolff von Gudenberg, J.: filib++, Expression Templates and the Coming Interval Standard. Reliable Computing 15(4), 312–320 (2011)
NVIDIA: NVIDIA CUDA C best practices guide, version 3.2 (August 2010)
NVIDIA: NVIDIA CUDA C programming guide, version 3.2 (November 2010)
NVIDIA: NVIDIA CUDA reference manual, version 3.2 Beta (August 2010)
NVIDIA: OpenCL Best Practices Guide (May 2010)
NVIDIA: OpenCL programming guide for the CUDA architecture, version 3.2 (August 2010)
SGI: Standard Template Library Programmer’s Guide, April 20 (2011), http://www.sgi.com/tech/stl/
The Portland Group: CUDA Fortran programming guide and reference, version 11.0 (November 2010)
Veldhuizen, T.: Expression templates. C++ Report 7(5), 26–31 (June 1995), reprinted in [9]
Veldhuizen, T.: Using C++ template metaprograms. C++ Report 7(4), 36–43 (1995), reprinted in [9]
Veldhuizen, T.: Techniques for scientific C++. Tech. Rep. 542, Indiana University Computer Science, version 0.4 (August 2000)
Wiemann, P., Wenger, S., Magnor, M.: CUDA expression templates. In: Proceedings of WSCG Communication Papers 2011, pp. 185–192 (2011)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Bawidamann, U., Nehmeier, M. (2012). Expression Templates and OpenCL. In: Wyrzykowski, R., Dongarra, J., Karczewski, K., Waśniewski, J. (eds) Parallel Processing and Applied Mathematics. PPAM 2011. Lecture Notes in Computer Science, vol 7204. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-31500-8_8
Download citation
DOI: https://doi.org/10.1007/978-3-642-31500-8_8
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-31499-5
Online ISBN: 978-3-642-31500-8
eBook Packages: Computer ScienceComputer Science (R0)
