# Towards a Semantics-Aware Code Transformation Toolchain for   Heterogeneous Systems

**Authors:** Salvador Tamarit (Universidad Polit\`ecnica de Madrid), Julio Mari\~no, (Universidad Polit\`ecnica de Madrid), Guillermo Vigueras (IMDEA Software, Institute), Manuel Carro (IMDEA Software Institute)

arXiv: 1701.03319 · 2017-01-13

## TL;DR

This paper introduces a flexible, semantics-aware code transformation environment in Haskell that optimizes scientific C code for heterogeneous systems by allowing user-defined transformation rules based on semantic annotations.

## Contribution

It presents a novel, architecture-agnostic transformation toolchain that enables customizable, semantic-driven code optimization for heterogeneous computing platforms.

## Key findings

- Supports user-defined transformation rules
- Transforms architecture-agnostic C code effectively
- Enhances performance portability across platforms

## Abstract

Obtaining good performance when programming heterogeneous computing platforms poses significant challenges. We present a program transformation environment, implemented in Haskell, where architecture-agnostic scientific C code with semantic annotations is transformed into functionally equivalent code better suited for a given platform. The transformation steps are represented as rules that can be fired when certain syntactic and semantic conditions are fulfilled. These rules are not hard-wired into the rewriting engine: they are written in a C-like language and are automatically processed and incorporated into the rewriting engine. That makes it possible for end-users to add their own rules or to provide sets of rules that are adapted to certain specific domains or purposes.

---
Source: https://tomesphere.com/paper/1701.03319