Abstract
Obtaining good performance when programming heterogeneous computing platforms poses significant challenges for the programmer. We present a program transformation environment, implemented in Haskell, where architecture-agnostic scientific C code is transformed into a functionally equivalent one better suited for a given platform. The transformation rules are formalized in a domain-specific language (STML) that takes care of the syntactic and semantic conditions required to apply a given transformation. STML rules are compiled into Haskell function definitions that operate at AST level. Program properties, to be matched with rule conditions, can be automatically inferred or, alternatively, stated as annotations in the source code. Early experimental results are described.
Keywords
Work partially funded by EU FP7-ICT-2013.3.4 project 610686 POLCA, Comunidad de Madrid project S2013/ICE-2731 N-Greens Software and MINECO Projects TIN2012-39391-C04-03 and TIN2012-39391-C04-04 (StrongSoft) and TIN2013-44742-C4-1-R (CAVI-ROSE).
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
Bagge, O.S., Kalleberg, K.T., Visser, E., Haveraaen, M.: Design of the codeboost transformation system for domain-specific optimisation of C++ programs. In: 3rd. Intl. Workshop on Source Code Analysis and Manipulation (SCAM2003), pp. 65–75. IEEE (2003)
Boekhold, M., Karkowski, I., Corporaal, H.: High-performance computing and networking. In: Sloot, P.M.A., Hoekstra, A.G., Bubak, M., Hertzberger, B. (eds.) HPCN-Europe 1999. LNCS, vol. 1593, pp. 673–682. Springer, Heidelberg (1999)
Brown, A., Luk, W., Kelly, P.: Optimising Transformations for Hardware Compilation. Tech. rep, Imperial College London (2005)
Danalis, A., Marin, G., McCurdy, C., Meredith, J.S., Roth, P.C., Spafford, K., Tipparaju, V., Vetter, J.S.: The scalable heterogeneous computing (SHOC) benchmark suite. In: Proc. of the 3rd Workshop on General-Purpose Computation on GPUs, pp. 63–74. ACM (2010)
Huber, B.: The language-c Package (2014). https://hackage.haskell.org/package/language-c
Lammel, R., Jones, S.P., Magalhaes, J.P.: The syb Package (2009). https://hackage.haskell.org/package/syb
Lindtjorn, O., Clapp, R.G., Pell, O., Fu, H., Flynn, M.J., Mencer, O.: Beyond Traditional Microprocessors for Geoscience High-Performance Computing Applications. IEEE Micro 31(2), 41–49 (2011)
Schupp, S., Gregor, D., Musser, D., Liu, S.M.: Semantic and Behavioral Library Transformations. Information and Software Technology 44(13), 797–810 (2002)
The POLCA Consortium: Specific Use Case Requirements. POLCA Project (#610686) Deliverable D-5.1, February 2014
Visser, E.: Program transformation with Stratego/XT. In: Lengauer, C., Batory, D., Blum, A., Odersky, M. (eds.) Domain-Specific Program Generation. LNCS, vol. 3016, pp. 216–238. Springer, Heidelberg (2004)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2015 Springer International Publishing Switzerland
About this paper
Cite this paper
Tamarit, S., Vigueras, G., Carro, M., Mariño, J. (2015). A Haskell Implementation of a Rule-Based Program Transformation for C Programs. In: Pontelli, E., Son, T. (eds) Practical Aspects of Declarative Languages. PADL 2015. Lecture Notes in Computer Science(), vol 9131. Springer, Cham. https://doi.org/10.1007/978-3-319-19686-2_8
Download citation
DOI: https://doi.org/10.1007/978-3-319-19686-2_8
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-19685-5
Online ISBN: 978-3-319-19686-2
eBook Packages: Computer ScienceComputer Science (R0)