Abstract
Portable SIMD code generation is an open problem in modern High Performance Computing systems. Performance portability can already be achieved, however it might fail when user-framework interaction is required.
Of all portable vectorization techniques, explicit vectorization, using wrapper-class libraries, is proven to achieve the fastest performance, however it does not exploit optimization opportunities outside the simplest algebraic primitives. A more advanced language is therefore required, but the design of a new independent language is not feasible due to its high costs.
This work describes an Embedded Domain Specific Language for solving generalized 1-D vectorization problems. The language is implemented using C++ as a host language and published as a lightweight library. By decoupling expression creation from evaluation a wider range of problems can be solved, without sacrificing runtime efficiency.
In this paper we discuss design patterns necessary, but not limited, to efficient EDSL implementation. We also study specific scenarios in which a language-based interface can surpass procedural interfaces in both efficiency, portability and ease of use. In particular we demonstrate higher performance when compared with equivalent BLAS Level 1 routines.
References
Apostolakis, J., Bandieremonte, M., Bitzes, G., Brun, R., Canal, P., Carminati, F., Cosmo, G., De Fine Licht, J.C., Duchem, L., Elviera, V., Gheatea, A., Jun, S.Y., Lima, G., Nikitina, T., Novak, M., Sehgal, R., Shadura, O., Wenzel, S.: Towards a high performance geometry library for particle-detector simulations. J. Phys. Conf. Ser. 608(1) (2015). IOP Publishing
Falcou, J., Sérot, J., Pech, L., Lapresté, J.-T.: Meta-programming applied to automatic SMP parallelization of linear algebra code. In: Luque, E., Margalef, T., Benítez, D. (eds.) Euro-Par 2008. LNCS, vol. 5168, pp. 729–738. Springer, Heidelberg (2008). doi:10.1007/978-3-540-85451-7_78
Free Software Foundation: GNU GCC reference: Semantics of Floating Point Math in GCC. https://gcc.gnu.org/wiki/FloatingPointMath. Accessed 27 Mar 2016
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley Longman, Reading (1995). ISBN:0-201-63361-2
Gunnabaus, G., Jacob, B., et al.: Eigen benchmarks website: http://eigen.tuxfamily.org/index.php?title=Benchmark. Accessed 27 Mar 2016
Gunnabaus, G., Jacob, B., et al.: Eigen v3. http://eigen.tuxfamily.org. Accessed 27 Mar 2016
Härdtlein, J., Pflaum, C., Linke, A., Wolters, C.H.: Advanced expression templates programming. Comput. Vis. Sci. 13, 59–68 (2010). ISBN:1432-9360
Hudak, P.: Building Domain-Specific Embedded Languages. ACM Comput. Surv. 28 (1996)
Intel Corporation: Intel®64 and IA-32 Architectures Software Developer’s Manual. https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf. Accessed 27 Mar 2016
Kaiser, H., et al.: HPX V0.9.99: A general purpose C++ runtime system for parallel and distributed applications of any scale, July 2016. https://zenodo.org/record/58027
Karpiński, P.: UME:: VECTOR: Vectorization EDSL library. https://github.com/edanor/umevector. Accessed 27 Mar 2016
Karpiński, P.: UME: Unified Multi/Many-Core Environment. https://github.com/edanor/ume. Accessed 27 Mar 2016
Karpinski, P., McDonald, J.: A high-performance portable abstract interface for explicit SIMD vectorization. In: PMAM 2017 (2017). ISBN: 978-1-4503-4883-6
Kretz, M., Lindenstruth, V.: VC: A C++ library for explicit vectorization. Softw. Pract. Experience 42(11), 1409–1430 (2012). Wiley
Niebler, E.: Proto: A compiler Construction Toolkit for DSELs. In: LCSD 2007. ACM, October 2007. ISBN 978-1-60558-086-9
Petrogalli, F.: A sneak peak into SVE and VLA programming. https://developer.arm.com/hpc/a-sneak-peek-into-sve-and-vla-programming. Accessed 27 Mar 2016
Pohl, A., Cosenza, B., Mesa, M., Chi, C., Juurlink, B.: An evaluation of current SIMD programming models for C++. In: WPMVP 2016. ACM, March 2016. ISBN 978-1-4503-4060-1
Vandevoorde, D., Josuttis, N.: C++ Templates: The Complete Guide. Addison-Wesley, Boston (2002). ISBN:0-201-73484-2
Veldhuizen, T.: Blitz++: The library that thinks it is a compiler. In: Langtangen, H.P., Bruaset, A.M., Quak, E. (eds.) Advances in Software Tools for Scientific Computing. Lecture Notes in Computational Science and Engineering, vol. 10, pp. 57–87. Springer, Heidelberg (2000)
Veldhuizen, T.: Expression Templates. C++ Mag., June 1995. ISSN:1040–6042
Veldhuizen, T., Ponnambalam, K.: Linear algebra with C++ template metaprograms. Dr. Dobb’s J. Softw. Tools (1996)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2017 Springer International Publishing AG
About this paper
Cite this paper
Karpiński, P., McDonald, J. (2017). An Embedded Domain Specific Language for General Purpose Vectorization. In: Kunkel, J., Yokota, R., Taufer, M., Shalf, J. (eds) High Performance Computing. ISC High Performance 2017. Lecture Notes in Computer Science(), vol 10524. Springer, Cham. https://doi.org/10.1007/978-3-319-67630-2_37
Download citation
DOI: https://doi.org/10.1007/978-3-319-67630-2_37
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-67629-6
Online ISBN: 978-3-319-67630-2
eBook Packages: Computer ScienceComputer Science (R0)