Tiramisu Compiler
type.h
Go to the documentation of this file.
1 #ifndef _H_TIRAMISU_TYPE_
2 #define _H_TIRAMISU_TYPE_
3 
4 #include <string.h>
5 #include <stdint.h>
6 
7 namespace tiramisu
8 {
9 
10 /**
11  * The possible types of an expression.
12  * "e_" stands for expression.
13  */
14 enum expr_t
15 {
16  e_val, // literal value, like 1, 2.4, 10, ...
17  e_var, // a variable of a primitive type (i.e., an identifier holding one value),
18  e_sync, // syncs parallel computations. Currently used in the context of GPUs.
19  e_op, // an operation: add, mul, div, ...
20  e_none // undefined expression. The existence of an expression of e_none type means an error.
21 };
22 
23 /**
24  * tiramisu data types.
25  * "p_" stands for primitive.
26  */
28 {
43 };
44 
45 
46 /**
47  * Types of tiramisu operators.
48  * If the expression is of type e_op then it should
49  * have an operator type. This is the operator type.
50  *
51  * "o_" stands for operator.
52  */
53 enum op_t
54 {
55  // Unary operators
56  // The argument of the following operators is a tiramisu::expr.
73  o_expo, // exponential
78  // The argument of the following operators is a string representing
79  // the name of the buffer to allocate.
82  // Other arguments
83  o_cast, // The argument is an expression and a type.
84  o_address, // The argument is a tiramisu::var() that represents a buffer.
85 
86 
87  // Binary operator
88  // The arguments are tiramisu::expr.
108 
109 
110  // Ternary operators
111  // The arguments are tiramisu::expr.
115 
116  // Operators taking a name and a vector of expressions.
123  // just pass in the buffer
125 
127 };
128 
129 /**
130  * Types of function arguments.
131  * "a_" stands for argument.
132  */
134 {
138 };
139 
140 /**
141  * Convert a Tiramisu type into the equivalent Halide type (if it exists),
142  * otherwise show an error message (no automatic type conversion is performed).
143  */
145 
146 /**
147  * Convert a Halide type into the equivalent Tiramisu type (if it exists),
148  * otherwise show an error message (no automatic type conversion is performed).
149  */
151 }
152 
153 #endif
argument_t
Types of function arguments.
Definition: type.h:133
expr_t
The possible types of an expression.
Definition: type.h:14
primitive_t
tiramisu data types.
Definition: type.h:27
Halide::Type halide_type_from_tiramisu_type(tiramisu::primitive_t type)
Convert a Tiramisu type into the equivalent Halide type (if it exists), otherwise show an error messa...
tiramisu::primitive_t halide_type_to_tiramisu_type(Halide::Type type)
Convert a Halide type into the equivalent Tiramisu type (if it exists), otherwise show an error messa...
op_t
Types of tiramisu operators.
Definition: type.h:53
Definition: core.h:27