Fork me on GitHub

Overview

Tiramisu is a compiler for expressing fast, portable and composable data parallel computations. It provides a simple C++ API for expressing algorithms (Tiramisu expressions) and how these algorithms should be optimized by the compiler. Tiramisu can be used in areas such as linear and tensor algebra, deep learning, image processing, stencil computations and machine learning.

The Tiramisu compiler is based on the polyhedral model thus it can express a large set of loop optimizations and data layout transformations. Currently it targets (1) multicore X86 CPUs, (2) Nvidia GPUs, (3) Xilinx FPGAs (Vivado HLS) and (4) distributed machines (using MPI). It is designed to enable easy integration of code generators for new architectures.

Example

The following is an example of a Tiramisu program specified using the C++ API.

// C++ code with a Tiramisu expression.
#include "tiramisu/tiramisu.h"

void foo(int N, int array_a[N], int array_b[N], int array_c[N])
{
    // Specify the name of the function that you want to create.
    tiramisu::init("foo");

    // Declare two iterator variables (i and j) and two inputs (A and B)
    tiramisu::var i("i"), j("j");
    tiramisu::in A(i,j), B(i,j);

    // Declare the Tiramisu expression (algorithm)
    tiramisu::comp C(i,j) = A(i,j) + B(i,j);
    
    // Specify optimizations
    C.parallelize(i).vectorize(j, 4);

    // Realize and compile the Tiramisu expression
    C.realize(tiramisu::int32_t, {N});
    C.codegen({(A, array_a), (B, array_b), (C, array_c)}, "generated_code.o");
}

Getting Started

Publications