Tiramisu Compiler
Main Page
Namespaces
Classes
Files
File List
File Members
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
*/
27
enum
primitive_t
28
{
29
p_uint8
,
30
p_uint16
,
31
p_uint32
,
32
p_uint64
,
33
p_int8
,
34
p_int16
,
35
p_int32
,
36
p_int64
,
37
p_float32
,
38
p_float64
,
39
p_boolean
,
40
p_async
,
41
p_wait_ptr
,
42
p_none
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.
57
o_minus
,
58
o_floor
,
59
o_sin
,
60
o_cos
,
61
o_tan
,
62
o_asin
,
63
o_acos
,
64
o_atan
,
65
o_sinh
,
66
o_cosh
,
67
o_tanh
,
68
o_asinh
,
69
o_acosh
,
70
o_atanh
,
71
o_abs
,
72
o_sqrt
,
73
o_expo
,
// exponential
74
o_log
,
75
o_ceil
,
76
o_round
,
77
o_trunc
,
78
// The argument of the following operators is a string representing
79
// the name of the buffer to allocate.
80
o_allocate
,
81
o_free
,
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.
89
o_add
,
90
o_sub
,
91
o_mul
,
92
o_div
,
93
o_mod
,
94
o_logical_and
,
95
o_logical_or
,
96
o_logical_not
,
97
o_eq
,
98
o_ne
,
99
o_le
,
100
o_lt
,
101
o_ge
,
102
o_gt
,
103
o_max
,
104
o_min
,
105
o_right_shift
,
106
o_left_shift
,
107
o_memcpy
,
108
109
110
// Ternary operators
111
// The arguments are tiramisu::expr.
112
o_select
,
113
o_cond
,
114
o_lerp
,
115
116
// Operators taking a name and a vector of expressions.
117
o_call
,
118
o_access
,
119
o_address_of
,
120
o_lin_index
,
121
o_type
,
122
o_dummy
,
123
// just pass in the buffer
124
o_buffer
,
125
126
o_none
,
127
};
128
129
/**
130
* Types of function arguments.
131
* "a_" stands for argument.
132
*/
133
enum
argument_t
134
{
135
a_input
,
136
a_output
,
137
a_temporary
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
*/
144
Halide::Type
halide_type_from_tiramisu_type
(
tiramisu::primitive_t
type);
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
*/
150
tiramisu::primitive_t
halide_type_to_tiramisu_type
(Halide::Type type);
151
}
152
153
#endif
tiramisu::argument_t
argument_t
Types of function arguments.
Definition:
type.h:133
tiramisu::o_logical_or
Definition:
type.h:95
tiramisu::o_floor
Definition:
type.h:58
tiramisu::o_expo
Definition:
type.h:73
tiramisu::o_lt
Definition:
type.h:100
tiramisu::a_temporary
Definition:
type.h:137
tiramisu::p_int16
Definition:
type.h:34
tiramisu::p_float64
Definition:
type.h:38
tiramisu::expr_t
expr_t
The possible types of an expression.
Definition:
type.h:14
tiramisu::o_ne
Definition:
type.h:98
tiramisu::p_uint16
Definition:
type.h:30
tiramisu::p_float32
Definition:
type.h:37
tiramisu::o_mod
Definition:
type.h:93
tiramisu::primitive_t
primitive_t
tiramisu data types.
Definition:
type.h:27
tiramisu::o_round
Definition:
type.h:76
tiramisu::o_sin
Definition:
type.h:59
tiramisu::e_val
Definition:
type.h:16
tiramisu::o_asinh
Definition:
type.h:68
tiramisu::o_address
Definition:
type.h:84
tiramisu::p_boolean
Definition:
type.h:39
tiramisu::o_type
Definition:
type.h:121
tiramisu::p_wait_ptr
Definition:
type.h:41
tiramisu::o_cast
Definition:
type.h:83
tiramisu::o_atanh
Definition:
type.h:70
tiramisu::o_abs
Definition:
type.h:71
tiramisu::o_call
Definition:
type.h:117
tiramisu::p_async
Definition:
type.h:40
tiramisu::o_cond
Definition:
type.h:113
tiramisu::o_select
Definition:
type.h:112
tiramisu::p_int8
Definition:
type.h:33
tiramisu::o_allocate
Definition:
type.h:80
tiramisu::e_none
Definition:
type.h:20
tiramisu::o_min
Definition:
type.h:104
tiramisu::p_int32
Definition:
type.h:35
tiramisu::o_logical_not
Definition:
type.h:96
tiramisu::p_int64
Definition:
type.h:36
tiramisu::o_minus
Definition:
type.h:57
tiramisu::o_lerp
Definition:
type.h:114
tiramisu::o_buffer
Definition:
type.h:124
tiramisu::p_uint8
Definition:
type.h:29
tiramisu::o_logical_and
Definition:
type.h:94
tiramisu::o_dummy
Definition:
type.h:122
tiramisu::o_sub
Definition:
type.h:90
tiramisu::o_div
Definition:
type.h:92
tiramisu::p_uint64
Definition:
type.h:32
tiramisu::o_asin
Definition:
type.h:62
tiramisu::o_ceil
Definition:
type.h:75
tiramisu::halide_type_from_tiramisu_type
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::o_trunc
Definition:
type.h:77
tiramisu::p_uint32
Definition:
type.h:31
tiramisu::o_access
Definition:
type.h:118
tiramisu::o_cos
Definition:
type.h:60
tiramisu::o_memcpy
Definition:
type.h:107
tiramisu::a_output
Definition:
type.h:136
tiramisu::o_add
Definition:
type.h:89
tiramisu::o_none
Definition:
type.h:126
tiramisu::o_ge
Definition:
type.h:101
tiramisu::halide_type_to_tiramisu_type
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...
tiramisu::o_gt
Definition:
type.h:102
tiramisu::o_max
Definition:
type.h:103
tiramisu::op_t
op_t
Types of tiramisu operators.
Definition:
type.h:53
tiramisu::o_lin_index
Definition:
type.h:120
tiramisu::o_acos
Definition:
type.h:63
tiramisu::e_var
Definition:
type.h:17
tiramisu::o_acosh
Definition:
type.h:69
tiramisu::e_op
Definition:
type.h:19
tiramisu::o_cosh
Definition:
type.h:66
tiramisu::o_sqrt
Definition:
type.h:72
tiramisu::o_free
Definition:
type.h:81
tiramisu::o_log
Definition:
type.h:74
tiramisu::o_tanh
Definition:
type.h:67
tiramisu::p_none
Definition:
type.h:42
tiramisu
Definition:
core.h:27
tiramisu::o_mul
Definition:
type.h:91
tiramisu::o_atan
Definition:
type.h:64
tiramisu::o_eq
Definition:
type.h:97
tiramisu::o_le
Definition:
type.h:99
tiramisu::e_sync
Definition:
type.h:18
tiramisu::o_tan
Definition:
type.h:61
tiramisu::a_input
Definition:
type.h:135
tiramisu::o_right_shift
Definition:
type.h:105
tiramisu::o_sinh
Definition:
type.h:65
tiramisu::o_address_of
Definition:
type.h:119
tiramisu::o_left_shift
Definition:
type.h:106
include
tiramisu
type.h
Generated by
1.8.11