Abstract
To simultaneously provide rapid application development and high performance, developers of scientific and multimedia applications often mix languages, using scripting languages to glue together high-performance components written in compiled languages. While this can be a useful development strategy, it distances application developers from the optimization process while adding complexity to the development tool chain. Recently, we introduced the Synthetic Programming Environment (SPE) for Python, a library for generating and executing machine instructions at run-time. The SPE is an effective platform for optimizing serial and parallel applications without relying on intermediate languages. In this paper, we use the SPE to develop two code generation libraries, one for scalar and vector (SIMD) expression evaluation and another for parallel and high-performance loop generation. Using these libraries, we implement two high performance kernels and demonstrate how to achieve high levels of performance by providing the appropriate abstractions to users. Our results show that scripting languages can be used to generate high-performance code and suggest that providing optimizations as user-level libraries is an effective strategy for managing the complexity of high-performance applications.
This is a preview of subscription content, log in via an 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
Beckmann, O., et al.: Runtime code generation in C++ as a foundation for domain-specific optimisation. In: Lengauer, C., et al. (eds.) Domain-Specific Program Generation. LNCS, vol. 3016, Springer, Heidelberg (2004)
Buck, I., et al.: Brook for GPUs: stream computing on graphics hardware. ACM Trans. Graph. 23(3), 777–786 (2004), doi:10.1145/1015706.1015800
Chandra, R., et al.: Parallel programming in OpenMP. Morgan Kaufmann Publishers Inc., San Francisco (2001)
High Performance Fortran Forum. High performance fortran language specification. version 2.0. Technical report, Rice University (1992)
Gamma, E., et al.: Design Patterns: Elements of Reusable Object-Oriented Software, chapter 4-5, pp. 207–219, 243–257. Addison Wesley Longman, Inc. (1995)
Grant, B., et al.: DyC: an expressive annotation-directed dynamic compiler for C. Theoretical Computer Science 248(1–2), 147–199 (2000)
Jones, E.: Weave User’s Guide. Enthought (Accessed May 2006)
McCool, M.D., Qin, Z., Popa, T.S.: Shader metaprogramming. In: SIGGRAPH/Eurographics Graphics Hardware Workshop, September, pp. 57–68 (2002)
Mueller, C., Lumsdaine, A.: Runtime synthesis of high-performance code from scripting languages. In: Dynamic Language Symposium (DLS2006), Portland, Orgeon, October (2006)
Grant Olson. PyASM User’s Guide V.0.2 (Accessed May 2006)
Poletto, M., et al.: ‘C and tcc: A language and compiler for dynamic code generation. ACM Trans. on Programming Languages and Systems 21(2), 324–369 (1999)
Quinlan, D.: ROSE: Compiler support for object-oriented frameworks. Parallel Processing Letters 10(2-3), 215–226 (2000)
Rigo, A.: The Ultimate Psyco Guide, 1.5.1 edn. (February 2005)
Veldhuizen, T.L.: Expression templates (Reprinted in C++ Gems, ed. Lippman, S.). C++ Report 7(5), 26–31 (1995)
Yee, K.-P., van Rossum, G.: Pep 234: Iterators. Technical report, Python Software Foundation (2001)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2007 Springer Berlin Heidelberg
About this paper
Cite this paper
Mueller, C., Lumsdaine, A. (2007). Expression and Loop Libraries for High-Performance Code Synthesis. In: Almási, G., Caşcaval, C., Wu, P. (eds) Languages and Compilers for Parallel Computing. LCPC 2006. Lecture Notes in Computer Science, vol 4382. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-72521-3_7
Download citation
DOI: https://doi.org/10.1007/978-3-540-72521-3_7
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-72520-6
Online ISBN: 978-3-540-72521-3
eBook Packages: Computer ScienceComputer Science (R0)