Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion from Tiramisu DSL to C Language For-loop Code #400

Open
WQR53 opened this issue Jun 19, 2023 · 1 comment
Open

Conversion from Tiramisu DSL to C Language For-loop Code #400

WQR53 opened this issue Jun 19, 2023 · 1 comment

Comments

@WQR53
Copy link

WQR53 commented Jun 19, 2023

Hello,

I'm currently working with Tiramisu DSL and code_generator, and I would like to know if it's possible to convert Tiramisu DSL code into equivalent C language for-loop code.

Here is an example of the Tiramisu DSL code:

computation comp1("comp1", {i3, i4, i5}, (comp0(i3, i4, i5) + comp0(i3, i4, i5 + 1) - comp0(i3, i4, i5 + 2)));

I would like to convert the above Tiramisu DSL code into a C language for-loop code structure similar to the following:

for (i3 = 2; i3 < 8; i3++) {
    for (i4 = 2; i4 < 8; i4++) {
        for (i5 = 2; i5 < 8; i5++) {
            buf1[i3][i4][i5] = buf0[i3][i4][i5] + buf0[i3][i4][i5 + 1] - buf0[i3][i4][i5 + 2];
        }
    }
}

Are there any existing tools or methods available that can convert Tiramisu DSL code into C language for-loop code?

I would appreciate any guidance or information you can provide regarding existing tools, libraries, or approaches that could assist in this conversion process. Thank you for your time and assistance.

@rbaghdadi
Copy link
Collaborator

Hi

Tiramisu does not have a ready-to-use C backend, you can add one very easily.

There are two ways for doing this:

  • Tiramisu generates Halide IR. You can translate Halide IR to C very easily.
  • Tiramisu generates an ISL AST before generating the Halide IR. ISL has a C code generator from ISL AST, you can use that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants