Halide
IR.h
Go to the documentation of this file.
1 #ifndef HALIDE_IR_H
2 #define HALIDE_IR_H
3 
4 /** \file
5  * Subtypes for Halide expressions (\ref Halide::Expr) and statements (\ref Halide::Internal::Stmt)
6  */
7 
8 #include <string>
9 #include <vector>
10 
11 #include "Buffer.h"
12 #include "Expr.h"
13 #include "FunctionPtr.h"
14 #include "ModulusRemainder.h"
15 #include "Parameter.h"
16 #include "PrefetchDirective.h"
17 #include "Reduction.h"
18 #include "Type.h"
19 
20 namespace Halide {
21 namespace Internal {
22 
23 class Function;
24 
25 /** The actual IR nodes begin here. Remember that all the Expr
26  * nodes also have a public "type" property */
27 
28 /** Cast a node from one type to another. Can't change vector widths. */
29 struct Cast : public ExprNode<Cast> {
31 
32  static Expr make(Type t, Expr v);
33 
35 };
36 
37 /** The sum of two expressions */
38 struct Add : public ExprNode<Add> {
39  Expr a, b;
40 
41  static Expr make(Expr a, Expr b);
42 
44 };
45 
46 /** The difference of two expressions */
47 struct Sub : public ExprNode<Sub> {
48  Expr a, b;
49 
50  static Expr make(Expr a, Expr b);
51 
53 };
54 
55 /** The product of two expressions */
56 struct Mul : public ExprNode<Mul> {
57  Expr a, b;
58 
59  static Expr make(Expr a, Expr b);
60 
62 };
63 
64 /** The ratio of two expressions */
65 struct Div : public ExprNode<Div> {
66  Expr a, b;
67 
68  static Expr make(Expr a, Expr b);
69 
71 };
72 
73 /** The remainder of a / b. Mostly equivalent to '%' in C, except that
74  * the result here is always positive. For floats, this is equivalent
75  * to calling fmod. */
76 struct Mod : public ExprNode<Mod> {
77  Expr a, b;
78 
79  static Expr make(Expr a, Expr b);
80 
82 };
83 
84 /** The lesser of two values. */
85 struct Min : public ExprNode<Min> {
86  Expr a, b;
87 
88  static Expr make(Expr a, Expr b);
89 
91 };
92 
93 /** The greater of two values */
94 struct Max : public ExprNode<Max> {
95  Expr a, b;
96 
97  static Expr make(Expr a, Expr b);
98 
100 };
101 
102 /** Is the first expression equal to the second */
103 struct EQ : public ExprNode<EQ> {
104  Expr a, b;
105 
106  static Expr make(Expr a, Expr b);
107 
109 };
110 
111 /** Is the first expression not equal to the second */
112 struct NE : public ExprNode<NE> {
113  Expr a, b;
114 
115  static Expr make(Expr a, Expr b);
116 
118 };
119 
120 /** Is the first expression less than the second. */
121 struct LT : public ExprNode<LT> {
122  Expr a, b;
123 
124  static Expr make(Expr a, Expr b);
125 
127 };
128 
129 /** Is the first expression less than or equal to the second. */
130 struct LE : public ExprNode<LE> {
131  Expr a, b;
132 
133  static Expr make(Expr a, Expr b);
134 
136 };
137 
138 /** Is the first expression greater than the second. */
139 struct GT : public ExprNode<GT> {
140  Expr a, b;
141 
142  static Expr make(Expr a, Expr b);
143 
145 };
146 
147 /** Is the first expression greater than or equal to the second. */
148 struct GE : public ExprNode<GE> {
149  Expr a, b;
150 
151  static Expr make(Expr a, Expr b);
152 
154 };
155 
156 /** Logical and - are both expressions true */
157 struct And : public ExprNode<And> {
158  Expr a, b;
159 
160  static Expr make(Expr a, Expr b);
161 
163 };
164 
165 /** Logical or - is at least one of the expression true */
166 struct Or : public ExprNode<Or> {
167  Expr a, b;
168 
169  static Expr make(Expr a, Expr b);
170 
172 };
173 
174 /** Logical not - true if the expression false */
175 struct Not : public ExprNode<Not> {
177 
178  static Expr make(Expr a);
179 
181 };
182 
183 /** A ternary operator. Evalutes 'true_value' and 'false_value',
184  * then selects between them based on 'condition'. Equivalent to
185  * the ternary operator in C. */
186 struct Select : public ExprNode<Select> {
188 
190 
192 };
193 
194 /** Load a value from a named symbol if predicate is true. The buffer
195  * is treated as an array of the 'type' of this Load node. That is,
196  * the buffer has no inherent type. The name may be the name of an
197  * enclosing allocation, an input or output buffer, or any other
198  * symbol of type Handle(). */
199 struct Load : public ExprNode<Load> {
200  std::string name;
201 
203 
204  // If it's a load from an image argument or compiled-in constant
205  // image, this will point to that
207 
208  // If it's a load from an image parameter, this points to that
210 
211  // The alignment of the index. If the index is a vector, this is
212  // the alignment of the first lane.
214 
215  static Expr make(Type type, const std::string &name,
218  Expr predicate,
220 
222 };
223 
224 /** A linear ramp vector node. This is vector with 'lanes' elements,
225  * where element i is 'base' + i*'stride'. This is a convenient way to
226  * pass around vectors without busting them up into individual
227  * elements. E.g. a dense vector load from a buffer can use a ramp
228  * node with stride 1 as the index. */
229 struct Ramp : public ExprNode<Ramp> {
231  int lanes;
232 
233  static Expr make(Expr base, Expr stride, int lanes);
234 
236 };
237 
238 /** A vector with 'lanes' elements, in which every element is
239  * 'value'. This is a special case of the ramp node above, in which
240  * the stride is zero. */
241 struct Broadcast : public ExprNode<Broadcast> {
243  int lanes;
244 
245  static Expr make(Expr value, int lanes);
246 
248 };
249 
250 /** A let expression, like you might find in a functional
251  * language. Within the expression \ref Let::body, instances of the Var
252  * node \ref Let::name refer to \ref Let::value. */
253 struct Let : public ExprNode<Let> {
254  std::string name;
256 
257  static Expr make(const std::string &name, Expr value, Expr body);
258 
260 };
261 
262 /** The statement form of a let node. Within the statement 'body',
263  * instances of the Var named 'name' refer to 'value' */
264 struct LetStmt : public StmtNode<LetStmt> {
265  std::string name;
268 
269  static Stmt make(const std::string &name, Expr value, Stmt body);
270 
272 };
273 
274 /** If the 'condition' is false, then evaluate and return the message,
275  * which should be a call to an error function. */
276 struct AssertStmt : public StmtNode<AssertStmt> {
277  // if condition then val else error out with message
280 
281  static Stmt make(Expr condition, Expr message);
282 
284 };
285 
286 /** This node is a helpful annotation to do with permissions. If 'is_produce' is
287  * set to true, this represents a producer node which may also contain updates;
288  * otherwise, this represents a consumer node. If the producer node contains
289  * updates, the body of the node will be a block of 'produce' and 'update'
290  * in that order. In a producer node, the access is read-write only (or write
291  * only if it doesn't have updates). In a consumer node, the access is read-only.
292  * None of this is actually enforced, the node is purely for informative purposes
293  * to help out our analysis during lowering. For every unique ProducerConsumer,
294  * there is an associated Realize node with the same name that creates the buffer
295  * being read from or written to in the body of the ProducerConsumer.
296  */
297 struct ProducerConsumer : public StmtNode<ProducerConsumer> {
298  std::string name;
301 
302  static Stmt make(const std::string &name, bool is_producer, Stmt body);
303 
304  static Stmt make_produce(const std::string &name, Stmt body);
305  static Stmt make_consume(const std::string &name, Stmt body);
306 
308 };
309 
310 /** Store a 'value' to the buffer called 'name' at a given 'index' if
311  * 'predicate' is true. The buffer is interpreted as an array of the
312  * same type as 'value'. The name may be the name of an enclosing
313  * Allocate node, an output buffer, or any other symbol of type
314  * Handle(). */
315 struct Store : public StmtNode<Store> {
316  std::string name;
318  // If it's a store to an output buffer, then this parameter points to it.
320 
321  // The alignment of the index. If the index is a vector, this is
322  // the alignment of the first lane.
324 
325  static Stmt make(const std::string &name, Expr value, Expr index,
327 
329 };
330 
331 /** This defines the value of a function at a multi-dimensional
332  * location. You should think of it as a store to a multi-dimensional
333  * array. It gets lowered to a conventional Store node. The name must
334  * correspond to an output buffer or the name of an enclosing Realize
335  * node. */
336 struct Provide : public StmtNode<Provide> {
337  std::string name;
338  std::vector<Expr> values;
339  std::vector<Expr> args;
340 
341  static Stmt make(const std::string &name, const std::vector<Expr> &values, const std::vector<Expr> &args);
342 
344 };
345 
346 /** Allocate a scratch area called with the given name, type, and
347  * size. The buffer lives for at most the duration of the body
348  * statement, within which it may or may not be freed explicitly with
349  * a Free node with a matching name. Allocation only occurs if the
350  * condition evaluates to true. Within the body of the allocation,
351  * defines a symbol with the given name and the type Handle(). */
352 struct Allocate : public StmtNode<Allocate> {
353  std::string name;
356  std::vector<Expr> extents;
358 
359  // These override the code generator dependent malloc and free
360  // equivalents if provided. If the new_expr succeeds, that is it
361  // returns non-nullptr, the function named be free_function is
362  // guaranteed to be called. The free function signature must match
363  // that of the code generator dependent free (typically
364  // halide_free). If free_function is left empty, code generator
365  // default will be called.
367  std::string free_function;
368 
370 
371  static Stmt make(const std::string &name, Type type, MemoryType memory_type,
372  const std::vector<Expr> &extents,
374  Expr new_expr = Expr(), const std::string &free_function = std::string());
375 
376  /** A routine to check if the extents are all constants, and if so verify
377  * the total size is less than 2^31 - 1. If the result is constant, but
378  * overflows, this routine asserts. This returns 0 if the extents are
379  * not all constants; otherwise, it returns the total constant allocation
380  * size. */
381  static int32_t constant_allocation_size(const std::vector<Expr> &extents, const std::string &name);
383 
385 };
386 
387 /** Free the resources associated with the given buffer. */
388 struct Free : public StmtNode<Free> {
389  std::string name;
390 
391  static Stmt make(const std::string &name);
392 
394 };
395 
396 /** Allocate a multi-dimensional buffer of the given type and
397  * size. Create some scratch memory that will back the function 'name'
398  * over the range specified in 'bounds'. The bounds are a vector of
399  * (min, extent) pairs for each dimension. Allocation only occurs if
400  * the condition evaluates to true.
401  */
402 struct Realize : public StmtNode<Realize> {
403  std::string name;
404  std::vector<Type> types;
409 
410  static Stmt make(const std::string &name, const std::vector<Type> &types, MemoryType memory_type, const Region &bounds, Expr condition, Stmt body);
411 
413 };
414 
415 /** A sequence of statements to be executed in-order. 'rest' may be
416  * undefined. Used rest.defined() to find out. */
417 struct Block : public StmtNode<Block> {
419 
420  static Stmt make(Stmt first, Stmt rest);
421  /** Construct zero or more Blocks to invoke a list of statements in order.
422  * This method may not return a Block statement if stmts.size() <= 1. */
423  static Stmt make(const std::vector<Stmt> &stmts);
424 
426 };
427 
428 /** A pair of statements executed concurrently. Both statements are
429  * joined before the Stmt ends. This is the parallel equivalent to
430  * Block. */
431 struct Fork : public StmtNode<Fork> {
433 
434  static Stmt make(Stmt first, Stmt rest);
435 
437 };
438 
439 /** An if-then-else block. 'else' may be undefined. */
440 struct IfThenElse : public StmtNode<IfThenElse> {
443 
445 
447 };
448 
449 /** Evaluate and discard an expression, presumably because it has some side-effect. */
450 struct Evaluate : public StmtNode<Evaluate> {
452 
453  static Stmt make(Expr v);
454 
456 };
457 
458 /** A function call. This can represent a call to some extern function
459  * (like sin), but it's also our multi-dimensional version of a Load,
460  * so it can be a load from an input image, or a call to another
461  * halide function. These two types of call nodes don't survive all
462  * the way down to code generation - the lowering process converts
463  * them to Load nodes. */
464 struct Call : public ExprNode<Call> {
465  std::string name;
466  std::vector<Expr> args;
467  typedef enum { Image, ///< A load from an input image
468  Extern, ///< A call to an external C-ABI function, possibly with side-effects
469  ExternCPlusPlus, ///< A call to an external C-ABI function, possibly with side-effects
470  PureExtern, ///< A call to a guaranteed-side-effect-free external function
471  Halide, ///< A call to a Func
472  Intrinsic, ///< A possibly-side-effecty compiler intrinsic, which has special handling during codegen
473  PureIntrinsic ///< A side-effect-free version of the above.
474  } CallType;
476 
477  // Halide uses calls internally to represent certain operations
478  // (instead of IR nodes). These are matched by name. Note that
479  // these are deliberately char* (rather than std::string) so that
480  // they can be referenced at static-initialization time without
481  // risking ambiguous initalization order; we use a typedef to simplify
482  // declaration.
483  typedef const char *const ConstString;
484 
485  // enums for various well-known intrinsics. (It is not *required* that all
486  // intrinsics have an enum entry here, but as a matter of style, it is recommended.)
487  // Note that these are only used in the API; inside the node, they are translated
488  // into a name. (To recover the name, call get_intrinsic_name().)
489  //
490  // Please keep this list sorted alphabetically; the specific enum values
491  // are *not* guaranteed to be stable across time.
492  enum IntrinsicOp {
502  bundle, // Bundle multiple exprs together temporarily for analysis (e.g. CSE)
530  mulhi_shr, // Compute high_half(arg[0] * arg[1]) >> arg[3]. Note that this is a shift in addition to taking the upper half of multiply result. arg[3] must be an unsigned integer immediate.
546  sorted_avg, // Compute (arg[0] + arg[1]) / 2, assuming arg[0] < arg[1].
551  IntrinsicOpCount // Sentinel: keep last.
552  };
553 
554  static const char *get_intrinsic_name(IntrinsicOp op);
555 
556  // We also declare some symbolic names for some of the runtime
557  // functions that we want to construct Call nodes to here to avoid
558  // magic string constants and the potential risk of typos.
580 
581  // If it's a call to another halide function, this call node holds
582  // a possibly-weak reference to that function.
584 
585  // If that function has multiple values, which value does this
586  // call node refer to?
588 
589  // If it's a call to an image, this call nodes hold a
590  // pointer to that image's buffer
592 
593  // If it's a call to an image parameter, this call node holds a
594  // pointer to that
596 
597  static Expr make(Type type, IntrinsicOp op, const std::vector<Expr> &args, CallType call_type,
599  const Buffer<> &image = Buffer<>(), Parameter param = Parameter());
600 
601  static Expr make(Type type, const std::string &name, const std::vector<Expr> &args, CallType call_type,
604 
605  /** Convenience constructor for calls to other halide functions */
606  static Expr make(const Function &func, const std::vector<Expr> &args, int idx = 0);
607 
608  /** Convenience constructor for loads from concrete images */
609  static Expr make(const Buffer<> &image, const std::vector<Expr> &args) {
610  return make(image.type(), image.name(), args, Image, FunctionPtr(), 0, image, Parameter());
611  }
612 
613  /** Convenience constructor for loads from images parameters */
614  static Expr make(const Parameter &param, const std::vector<Expr> &args) {
615  return make(param.type(), param.name(), args, Image, FunctionPtr(), 0, Buffer<>(), param);
616  }
617 
618  /** Check if a call node is pure within a pipeline, meaning that
619  * the same args always give the same result, and the calls can be
620  * reordered, duplicated, unified, etc without changing the
621  * meaning of anything. Not transitive - doesn't guarantee the
622  * args themselves are pure. An example of a pure Call node is
623  * sqrt. If in doubt, don't mark a Call node as pure. */
624  bool is_pure() const {
625  return (call_type == PureExtern ||
626  call_type == Image ||
628  }
629 
630  bool is_intrinsic() const {
631  return (call_type == Intrinsic ||
633  }
634 
635  bool is_intrinsic(IntrinsicOp op) const {
636  return is_intrinsic() && this->name == get_intrinsic_name(op);
637  }
638 
639  bool is_extern() const {
640  return (call_type == Extern ||
642  call_type == PureExtern);
643  }
644 
646 };
647 
648 /** A named variable. Might be a loop variable, function argument,
649  * parameter, reduction variable, or something defined by a Let or
650  * LetStmt node. */
651 struct Variable : public ExprNode<Variable> {
652  std::string name;
653 
654  /** References to scalar parameters, or to the dimensions of buffer
655  * parameters hang onto those expressions. */
657 
658  /** References to properties of literal image parameters. */
660 
661  /** Reduction variables hang onto their domains */
663 
664  static Expr make(Type type, const std::string &name) {
665  return make(type, name, Buffer<>(), Parameter(), ReductionDomain());
666  }
667 
668  static Expr make(Type type, const std::string &name, Parameter param) {
669  return make(type, name, Buffer<>(), std::move(param), ReductionDomain());
670  }
671 
672  static Expr make(Type type, const std::string &name, const Buffer<> &image) {
673  return make(type, name, image, Parameter(), ReductionDomain());
674  }
675 
676  static Expr make(Type type, const std::string &name, ReductionDomain reduction_domain) {
677  return make(type, name, Buffer<>(), Parameter(), std::move(reduction_domain));
678  }
679 
680  static Expr make(Type type, const std::string &name, Buffer<> image,
682 
684 };
685 
686 /** A for loop. Execute the 'body' statement for all values of the
687  * variable 'name' from 'min' to 'min + extent'. There are four
688  * types of For nodes. A 'Serial' for loop is a conventional
689  * one. In a 'Parallel' for loop, each iteration of the loop
690  * happens in parallel or in some unspecified order. In a
691  * 'Vectorized' for loop, each iteration maps to one SIMD lane,
692  * and the whole loop is executed in one shot. For this case,
693  * 'extent' must be some small integer constant (probably 4, 8, or
694  * 16). An 'Unrolled' for loop compiles to a completely unrolled
695  * version of the loop. Each iteration becomes its own
696  * statement. Again in this case, 'extent' should be a small
697  * integer constant. */
698 struct For : public StmtNode<For> {
699  std::string name;
704 
705  static Stmt make(const std::string &name, Expr min, Expr extent, ForType for_type, DeviceAPI device_api, Stmt body);
706 
707  bool is_unordered_parallel() const {
709  }
710  bool is_parallel() const {
712  }
713 
715 };
716 
717 struct Acquire : public StmtNode<Acquire> {
721 
723 
725 };
726 
727 /** Construct a new vector by taking elements from another sequence of
728  * vectors. */
729 struct Shuffle : public ExprNode<Shuffle> {
730  std::vector<Expr> vectors;
731 
732  /** Indices indicating which vector element to place into the
733  * result. The elements are numbered by their position in the
734  * concatenation of the vector argumentss. */
735  std::vector<int> indices;
736 
737  static Expr make(const std::vector<Expr> &vectors,
738  const std::vector<int> &indices);
739 
740  /** Convenience constructor for making a shuffle representing an
741  * interleaving of vectors of the same length. */
742  static Expr make_interleave(const std::vector<Expr> &vectors);
743 
744  /** Convenience constructor for making a shuffle representing a
745  * concatenation of the vectors. */
746  static Expr make_concat(const std::vector<Expr> &vectors);
747 
748  /** Convenience constructor for making a shuffle representing a
749  * contiguous subset of a vector. */
750  static Expr make_slice(Expr vector, int begin, int stride, int size);
751 
752  /** Convenience constructor for making a shuffle representing
753  * extracting a single element. */
754  static Expr make_extract_element(Expr vector, int i);
755 
756  /** Check if this shuffle is an interleaving of the vector
757  * arguments. */
758  bool is_interleave() const;
759 
760  /** Check if this shuffle is a concatenation of the vector
761  * arguments. */
762  bool is_concat() const;
763 
764  /** Check if this shuffle is a contiguous strict subset of the
765  * vector arguments, and if so, the offset and stride of the
766  * slice. */
767  ///@{
768  bool is_slice() const;
769  int slice_begin() const {
770  return indices[0];
771  }
772  int slice_stride() const {
773  return indices.size() >= 2 ? indices[1] - indices[0] : 1;
774  }
775  ///@}
776 
777  /** Check if this shuffle is extracting a scalar from the vector
778  * arguments. */
779  bool is_extract_element() const;
780 
782 };
783 
784 /** Represent a multi-dimensional region of a Func or an ImageParam that
785  * needs to be prefetched. */
786 struct Prefetch : public StmtNode<Prefetch> {
787  std::string name;
788  std::vector<Type> types;
792 
794 
795  static Stmt make(const std::string &name, const std::vector<Type> &types,
796  const Region &bounds,
799 
801 };
802 
803 /** Lock all the Store nodes in the body statement.
804  * Typically the lock is implemented by an atomic operation
805  * (e.g. atomic add or atomic compare-and-swap).
806  * However, if necessary, the node can access a mutex buffer through
807  * mutex_name and mutex_args, by lowering this node into
808  * calls to acquire and release the lock. */
809 struct Atomic : public StmtNode<Atomic> {
810  std::string producer_name;
811  std::string mutex_name; // empty string if not using mutex
813 
814  static Stmt make(const std::string &producer_name,
815  const std::string &mutex_name,
816  Stmt body);
817 
819 };
820 
821 /** Horizontally reduce a vector to a scalar or narrower vector using
822  * the given commutative and associative binary operator. The reduction
823  * factor is dictated by the number of lanes in the input and output
824  * types. Groups of adjacent lanes are combined. The number of lanes
825  * in the input type must be a divisor of the number of lanes of the
826  * output type. */
827 struct VectorReduce : public ExprNode<VectorReduce> {
828  // 99.9% of the time people will use this for horizontal addition,
829  // but these are all of our commutative and associative primitive
830  // operators.
831  typedef enum {
837  Or,
838  } Operator;
839 
842 
843  static Expr make(Operator op, Expr vec, int lanes);
844 
846 };
847 
848 } // namespace Internal
849 } // namespace Halide
850 
851 #endif
int32_t
signed __INT32_TYPE__ int32_t
Definition: runtime_internal.h:20
Halide::Internal::Store::_node_type
static const IRNodeType _node_type
Definition: IR.h:328
Halide::Internal::Prefetch::make
static Stmt make(const std::string &name, const std::vector< Type > &types, const Region &bounds, const PrefetchDirective &prefetch, Expr condition, Stmt body)
Halide::Internal::Call::alloca
@ alloca
Definition: IR.h:496
Halide::Internal::Acquire
Definition: IR.h:717
Halide::Internal::Cast::make
static Expr make(Type t, Expr v)
Halide::Internal::Cast::value
Expr value
Definition: IR.h:30
Halide::Internal::Acquire::_node_type
static const IRNodeType _node_type
Definition: IR.h:724
Halide::Internal::Broadcast::value
Expr value
Definition: IR.h:242
Halide::Internal::Realize::_node_type
static const IRNodeType _node_type
Definition: IR.h:412
Halide::Internal::Allocate
Allocate a scratch area called with the given name, type, and size.
Definition: IR.h:352
Halide::Internal::Call::signed_integer_overflow
@ signed_integer_overflow
Definition: IR.h:544
Halide::Internal::Call::param
Parameter param
Definition: IR.h:595
Halide::Internal::Add
The sum of two expressions.
Definition: IR.h:38
Halide::Internal::IRNodeType::Cast
@ Cast
Halide::Internal::Shuffle::slice_stride
int slice_stride() const
Check if this shuffle is a contiguous strict subset of the vector arguments, and if so,...
Definition: IR.h:772
Halide::Internal::Call::if_then_else
@ if_then_else
Definition: IR.h:520
Halide::Internal::Shuffle::is_concat
bool is_concat() const
Check if this shuffle is a concatenation of the vector arguments.
Halide::Internal::Not::_node_type
static const IRNodeType _node_type
Definition: IR.h:180
Halide::Internal::ProducerConsumer::make_produce
static Stmt make_produce(const std::string &name, Stmt body)
Halide::Internal::AssertStmt::condition
Expr condition
Definition: IR.h:278
Halide::Internal::Allocate::_node_type
static const IRNodeType _node_type
Definition: IR.h:384
Halide::Internal::For::_node_type
static const IRNodeType _node_type
Definition: IR.h:714
Halide::Internal::Evaluate::_node_type
static const IRNodeType _node_type
Definition: IR.h:455
Halide::Internal::LetStmt::value
Expr value
Definition: IR.h:266
Halide::Internal::Call::extract_mask_element
@ extract_mask_element
Definition: IR.h:511
Halide::Internal::LetStmt::make
static Stmt make(const std::string &name, Expr value, Stmt body)
Halide::Region
std::vector< Range > Region
A multi-dimensional box.
Definition: Expr.h:343
Halide::Internal::VectorReduce::op
Operator op
Definition: IR.h:841
Halide::Internal::LE::a
Expr a
Definition: IR.h:131
Halide::Internal::Call::make
static Expr make(Type type, IntrinsicOp op, const std::vector< Expr > &args, CallType call_type, FunctionPtr func=FunctionPtr(), int value_index=0, const Buffer<> &image=Buffer<>(), Parameter param=Parameter())
Halide::Internal::Shuffle::vectors
std::vector< Expr > vectors
Definition: IR.h:730
Parameter.h
Halide::Internal::Shuffle::make_concat
static Expr make_concat(const std::vector< Expr > &vectors)
Convenience constructor for making a shuffle representing a concatenation of the vectors.
Halide::Internal::Call::func
FunctionPtr func
Definition: IR.h:583
Halide::Internal::Or::make
static Expr make(Expr a, Expr b)
Halide::Internal::ProducerConsumer::make
static Stmt make(const std::string &name, bool is_producer, Stmt body)
Halide::Internal::Mod::_node_type
static const IRNodeType _node_type
Definition: IR.h:81
Halide::Internal::IRNodeType::Not
@ Not
Halide::Internal::Call::lerp
@ lerp
Definition: IR.h:524
Halide::Internal::IRNodeType::Select
@ Select
Halide::Internal::Call::glsl_texture_load
@ glsl_texture_load
Definition: IR.h:512
Halide::Internal::Call::register_destructor
@ register_destructor
Definition: IR.h:535
Halide::Internal::Or::b
Expr b
Definition: IR.h:167
Halide::Internal::IRNodeType::Block
@ Block
Halide::Internal::VectorReduce
Horizontally reduce a vector to a scalar or narrower vector using the given commutative and associati...
Definition: IR.h:827
Halide::Internal::IRNodeType::LE
@ LE
Halide::Internal::Select::condition
Expr condition
Definition: IR.h:187
Halide::Internal::Parameter
A reference-counted handle to a parameter to a halide pipeline.
Definition: Parameter.h:28
Halide::Internal::IRNodeType::For
@ For
Halide::Internal::Call::buffer_crop
static HALIDE_EXPORT ConstString buffer_crop
Definition: IR.h:577
Halide::Internal::BaseExprNode::type
Type type
Definition: Expr.h:146
Halide::Internal::Call::require_mask
@ require_mask
Definition: IR.h:538
Halide::Internal::Block::_node_type
static const IRNodeType _node_type
Definition: IR.h:425
Halide::Internal::GT::make
static Expr make(Expr a, Expr b)
Halide::Internal::Call::Extern
@ Extern
A call to an external C-ABI function, possibly with side-effects.
Definition: IR.h:468
Halide::Internal::LetStmt::name
std::string name
Definition: IR.h:265
Halide::Internal::VectorReduce::value
Expr value
Definition: IR.h:840
Halide::Internal::GE
Is the first expression greater than or equal to the second.
Definition: IR.h:148
Halide::Internal::Call::bitwise_xor
@ bitwise_xor
Definition: IR.h:500
Halide::Internal::Allocate::new_expr
Expr new_expr
Definition: IR.h:366
Halide::Internal::For
A for loop.
Definition: IR.h:698
Halide::Internal::IRNodeType
IRNodeType
All our IR node types get unique IDs for the purposes of RTTI.
Definition: Expr.h:25
Halide::Internal::Load::make
static Expr make(Type type, const std::string &name, Expr index, Buffer<> image, Parameter param, Expr predicate, ModulusRemainder alignment)
Halide::Internal::IRNodeType::EQ
@ EQ
Halide::Internal::Allocate::body
Stmt body
Definition: IR.h:369
Halide::Internal::Call::return_second
@ return_second
Definition: IR.h:539
Halide::Internal::Min::make
static Expr make(Expr a, Expr b)
Halide::Internal::Let::_node_type
static const IRNodeType _node_type
Definition: IR.h:259
Halide::Internal::Call::make
static Expr make(const Parameter &param, const std::vector< Expr > &args)
Convenience constructor for loads from images parameters.
Definition: IR.h:614
Halide::Internal::EQ::a
Expr a
Definition: IR.h:104
Halide::Internal::Call::div_round_to_zero
@ div_round_to_zero
Definition: IR.h:509
Halide::Internal::Acquire::body
Stmt body
Definition: IR.h:720
Halide::Internal::Call::image_load
@ image_load
Definition: IR.h:522
Halide::Internal::Call::bitwise_and
@ bitwise_and
Definition: IR.h:497
Halide::Internal::Call::ConstString
const typedef char *const ConstString
Definition: IR.h:483
Halide::Internal::Call::is_extern
bool is_extern() const
Definition: IR.h:639
Halide::Internal::Provide::args
std::vector< Expr > args
Definition: IR.h:339
Halide::Internal::IRNodeType::Evaluate
@ Evaluate
Halide::Internal::IRNodeType::Or
@ Or
Halide::Internal::Prefetch::condition
Expr condition
Definition: IR.h:791
Halide::Internal::Load::image
Buffer image
Definition: IR.h:206
Halide::Internal::Broadcast
A vector with 'lanes' elements, in which every element is 'value'.
Definition: IR.h:241
Halide::Internal::Div
The ratio of two expressions.
Definition: IR.h:65
Halide::Internal::Call::CallType
CallType
Definition: IR.h:467
Halide::Internal::ForType
ForType
An enum describing a type of loop traversal.
Definition: Expr.h:391
Halide::Internal::IRNodeType::LetStmt
@ LetStmt
Halide::Internal::Call::IntrinsicOpCount
@ IntrinsicOpCount
Definition: IR.h:551
Halide::Internal::Call::buffer_set_device_dirty
static HALIDE_EXPORT ConstString buffer_set_device_dirty
Definition: IR.h:573
Halide::Internal::Call::glsl_varying
@ glsl_varying
Definition: IR.h:514
Halide::Internal::ExprNode
We use the "curiously recurring template pattern" to avoid duplicated code in the IR Nodes.
Definition: Expr.h:156
Halide::Internal::Call::buffer_get_type
static HALIDE_EXPORT ConstString buffer_get_type
Definition: IR.h:571
Halide::Internal::Call::buffer_get_host
static HALIDE_EXPORT ConstString buffer_get_host
Definition: IR.h:565
Halide::Internal::IRNodeType::LT
@ LT
Halide::Internal::Div::a
Expr a
Definition: IR.h:66
Halide::Internal::Call::hvx_gather
@ hvx_gather
Definition: IR.h:516
Halide::Internal::Prefetch::types
std::vector< Type > types
Definition: IR.h:788
Halide::Internal::AssertStmt::make
static Stmt make(Expr condition, Expr message)
Halide::Internal::IRNodeType::Provide
@ Provide
Halide::Internal::LetStmt
The statement form of a let node.
Definition: IR.h:264
Halide::Internal::Call::sorted_avg
@ sorted_avg
Definition: IR.h:546
Halide::Internal::Allocate::memory_type
MemoryType memory_type
Definition: IR.h:355
Halide::Internal::Prefetch::bounds
Region bounds
Definition: IR.h:789
Halide::Internal::LT::a
Expr a
Definition: IR.h:122
Halide::Internal::Call::call_cached_indirect_function
@ call_cached_indirect_function
Definition: IR.h:503
Halide::Internal::Store::param
Parameter param
Definition: IR.h:319
Halide::Internal::Call::dynamic_shuffle
@ dynamic_shuffle
Definition: IR.h:510
Halide::Internal::Let::name
std::string name
Definition: IR.h:254
Halide::Internal::IRNodeType::Min
@ Min
Halide::Internal::Call::buffer_set_bounds
static HALIDE_EXPORT ConstString buffer_set_bounds
Definition: IR.h:578
Halide::Internal::Shuffle::is_extract_element
bool is_extract_element() const
Check if this shuffle is extracting a scalar from the vector arguments.
Halide::Internal::Fork::_node_type
static const IRNodeType _node_type
Definition: IR.h:436
Halide::Internal::Call::buffer_get_device_dirty
static HALIDE_EXPORT ConstString buffer_get_device_dirty
Definition: IR.h:570
Halide::Internal::Call::value_index
int value_index
Definition: IR.h:587
Halide::Internal::Call::bundle
@ bundle
Definition: IR.h:502
Halide::Internal::Cast
The actual IR nodes begin here.
Definition: IR.h:29
Halide::Internal::LE
Is the first expression less than or equal to the second.
Definition: IR.h:130
Halide::Internal::Sub::_node_type
static const IRNodeType _node_type
Definition: IR.h:52
Halide::Internal::IRNodeType::GE
@ GE
Halide::Internal::NE
Is the first expression not equal to the second.
Definition: IR.h:112
Halide::Internal::Allocate::make
static Stmt make(const std::string &name, Type type, MemoryType memory_type, const std::vector< Expr > &extents, Expr condition, Stmt body, Expr new_expr=Expr(), const std::string &free_function=std::string())
Halide::Internal::Call::Halide
@ Halide
A call to a Func.
Definition: IR.h:471
Halide::Internal::Shuffle::is_slice
bool is_slice() const
Check if this shuffle is a contiguous strict subset of the vector arguments, and if so,...
Halide::Internal::For::device_api
DeviceAPI device_api
Definition: IR.h:702
Halide::Internal::NE::_node_type
static const IRNodeType _node_type
Definition: IR.h:117
Halide::Internal::Call::absd
@ absd
Definition: IR.h:494
Halide::Internal::Div::make
static Expr make(Expr a, Expr b)
Halide::Internal::is_unordered_parallel
bool is_unordered_parallel(ForType for_type)
Check if for_type executes for loop iterations in parallel and unordered.
Halide::Internal::Fork
A pair of statements executed concurrently.
Definition: IR.h:431
Halide::Internal::Provide::make
static Stmt make(const std::string &name, const std::vector< Expr > &values, const std::vector< Expr > &args)
Halide::Internal::LT::b
Expr b
Definition: IR.h:122
Halide::Internal::IfThenElse::_node_type
static const IRNodeType _node_type
Definition: IR.h:446
Halide::Internal::Call::require
@ require
Definition: IR.h:537
Halide::Internal::Call::buffer_get_stride
static HALIDE_EXPORT ConstString buffer_get_stride
Definition: IR.h:563
Halide::Internal::Load::_node_type
static const IRNodeType _node_type
Definition: IR.h:221
Halide::Internal::Stmt
A reference-counted handle to a statement node.
Definition: Expr.h:409
Halide::Internal::Evaluate::make
static Stmt make(Expr v)
Halide::Internal::Min::_node_type
static const IRNodeType _node_type
Definition: IR.h:90
Halide::Internal::Variable::reduction_domain
ReductionDomain reduction_domain
Reduction variables hang onto their domains.
Definition: IR.h:662
Halide::Internal::Shuffle::make
static Expr make(const std::vector< Expr > &vectors, const std::vector< int > &indices)
Halide::Internal::IRNodeType::Variable
@ Variable
Halide::Internal::Shuffle::slice_begin
int slice_begin() const
Check if this shuffle is a contiguous strict subset of the vector arguments, and if so,...
Definition: IR.h:769
Halide::Internal::For::make
static Stmt make(const std::string &name, Expr min, Expr extent, ForType for_type, DeviceAPI device_api, Stmt body)
Halide::Internal::ProducerConsumer::_node_type
static const IRNodeType _node_type
Definition: IR.h:307
Halide::Type
Types in the halide type system.
Definition: Type.h:269
Halide::Internal::IRNodeType::ProducerConsumer
@ ProducerConsumer
Halide::Internal::For::is_unordered_parallel
bool is_unordered_parallel() const
Definition: IR.h:707
Halide::Internal::Load::param
Parameter param
Definition: IR.h:209
Halide::Internal::Call::strict_float
@ strict_float
Definition: IR.h:547
Halide::Internal::Shuffle::_node_type
static const IRNodeType _node_type
Definition: IR.h:781
Halide::Internal::Broadcast::make
static Expr make(Expr value, int lanes)
Halide::Internal::Call::abs
@ abs
Definition: IR.h:493
Halide::Internal::Call::buffer_get_host_dirty
static HALIDE_EXPORT ConstString buffer_get_host_dirty
Definition: IR.h:569
Halide::Internal::Call::ExternCPlusPlus
@ ExternCPlusPlus
A call to an external C-ABI function, possibly with side-effects.
Definition: IR.h:469
Halide::Internal::GE::a
Expr a
Definition: IR.h:149
Halide::Internal::Call::likely
@ likely
Definition: IR.h:525
Halide::Internal::Call::buffer_init
static HALIDE_EXPORT ConstString buffer_init
Definition: IR.h:575
Halide::Internal::Load
Load a value from a named symbol if predicate is true.
Definition: IR.h:199
Halide::Internal::Free
Free the resources associated with the given buffer.
Definition: IR.h:388
Halide::Internal::Shuffle::make_slice
static Expr make_slice(Expr vector, int begin, int stride, int size)
Convenience constructor for making a shuffle representing a contiguous subset of a vector.
Halide::Internal::Realize
Allocate a multi-dimensional buffer of the given type and size.
Definition: IR.h:402
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition: AddAtomicMutex.h:21
Halide::Internal::Call::bitwise_not
@ bitwise_not
Definition: IR.h:498
Halide::Internal::Parameter::type
Type type() const
Get the type of this parameter.
Halide::Internal::Acquire::semaphore
Expr semaphore
Definition: IR.h:718
Halide::Internal::Or
Logical or - is at least one of the expression true.
Definition: IR.h:166
Halide::Internal::EQ
Is the first expression equal to the second.
Definition: IR.h:103
Halide::Internal::Call::Image
@ Image
A load from an input image.
Definition: IR.h:467
Halide::Internal::Call::hvx_scatter
@ hvx_scatter
Definition: IR.h:517
Halide::Internal::Store::index
Expr index
Definition: IR.h:317
Halide::Internal::Free::make
static Stmt make(const std::string &name)
Halide::Internal::Provide::values
std::vector< Expr > values
Definition: IR.h:338
Halide::Internal::Call::is_intrinsic
bool is_intrinsic(IntrinsicOp op) const
Definition: IR.h:635
Halide::Internal::Provide
This defines the value of a function at a multi-dimensional location.
Definition: IR.h:336
Halide::Internal::Realize::name
std::string name
Definition: IR.h:403
Halide::Internal::IRNodeType::Atomic
@ Atomic
Halide::Internal::Mul::make
static Expr make(Expr a, Expr b)
Halide::LinkageType::Internal
@ Internal
Not visible externally, similar to 'static' linkage in C.
Halide::Internal::Max
The greater of two values.
Definition: IR.h:94
Halide::Internal::IRNodeType::Fork
@ Fork
Halide::Internal::Atomic::body
Stmt body
Definition: IR.h:812
Halide::Internal::Atomic::producer_name
std::string producer_name
Definition: IR.h:810
Halide::Internal::Sub::a
Expr a
Definition: IR.h:48
Halide::Internal::Min::b
Expr b
Definition: IR.h:86
Halide::Internal::Realize::make
static Stmt make(const std::string &name, const std::vector< Type > &types, MemoryType memory_type, const Region &bounds, Expr condition, Stmt body)
Halide::Internal::VectorReduce::Min
@ Min
Definition: IR.h:834
Halide::Internal::Atomic::mutex_name
std::string mutex_name
Definition: IR.h:811
Halide::Internal::Call::size_of_halide_buffer_t
@ size_of_halide_buffer_t
Definition: IR.h:545
Halide::Internal::Mul::_node_type
static const IRNodeType _node_type
Definition: IR.h:61
Halide::Internal::IOKind::Function
@ Function
Halide::Internal::Call::reinterpret
@ reinterpret
Definition: IR.h:536
Halide::Internal::Call::buffer_is_bounds_query
static HALIDE_EXPORT ConstString buffer_is_bounds_query
Definition: IR.h:574
Halide::Internal::Call::gpu_thread_barrier
@ gpu_thread_barrier
Definition: IR.h:515
Halide::Internal::Call::buffer_get_max
static HALIDE_EXPORT ConstString buffer_get_max
Definition: IR.h:564
Halide::Internal::GE::b
Expr b
Definition: IR.h:149
Halide::Internal::For::name
std::string name
Definition: IR.h:699
Halide::Internal::IRNodeType::Broadcast
@ Broadcast
Halide::Internal::Call::undef
@ undef
Definition: IR.h:549
Halide::Internal::For::min
Expr min
Definition: IR.h:700
Halide::Internal::IRNodeType::Free
@ Free
Halide::Internal::IRNodeType::Add
@ Add
Halide::Buffer<>
Halide::Internal::Or::a
Expr a
Definition: IR.h:167
Halide::Internal::VectorReduce::make
static Expr make(Operator op, Expr vec, int lanes)
Halide::Internal::Mod::a
Expr a
Definition: IR.h:77
Halide::Internal::For::for_type
ForType for_type
Definition: IR.h:701
Halide::Internal::Let
A let expression, like you might find in a functional language.
Definition: IR.h:253
Halide::Internal::GE::make
static Expr make(Expr a, Expr b)
Buffer.h
Halide::Internal::VectorReduce::Mul
@ Mul
Definition: IR.h:833
Halide::Internal::AssertStmt::_node_type
static const IRNodeType _node_type
Definition: IR.h:283
Halide::Internal::Evaluate::value
Expr value
Definition: IR.h:451
Halide::Internal::Realize::memory_type
MemoryType memory_type
Definition: IR.h:405
Halide::Internal::IfThenElse::condition
Expr condition
Definition: IR.h:441
Halide::Internal::Add::make
static Expr make(Expr a, Expr b)
Halide::Internal::Select::make
static Expr make(Expr condition, Expr true_value, Expr false_value)
Halide::Internal::VectorReduce::Operator
Operator
Definition: IR.h:831
Halide::Internal::Block::make
static Stmt make(Stmt first, Stmt rest)
Halide::Internal::Call::Intrinsic
@ Intrinsic
A possibly-side-effecty compiler intrinsic, which has special handling during codegen.
Definition: IR.h:472
Halide::Internal::Block::first
Stmt first
Definition: IR.h:418
Reduction.h
Halide::Internal::Acquire::make
static Stmt make(Expr semaphore, Expr count, Stmt body)
Halide::Internal::Mod::make
static Expr make(Expr a, Expr b)
Halide::Internal::ProducerConsumer::is_producer
bool is_producer
Definition: IR.h:299
Halide::Internal::Call::rewrite_buffer
@ rewrite_buffer
Definition: IR.h:540
Halide::Internal::Call::hvx_scatter_release
@ hvx_scatter_release
Definition: IR.h:519
Halide::Internal::IRNodeType::Sub
@ Sub
Halide::Internal::Or::_node_type
static const IRNodeType _node_type
Definition: IR.h:171
Halide::Internal::Store::predicate
Expr predicate
Definition: IR.h:317
Halide::Internal::Call::buffer_get_dimensions
static HALIDE_EXPORT ConstString buffer_get_dimensions
Definition: IR.h:560
Halide::Internal::Prefetch::prefetch
PrefetchDirective prefetch
Definition: IR.h:790
Halide::Internal::Ramp::lanes
int lanes
Definition: IR.h:231
Halide::Internal::For::is_parallel
bool is_parallel() const
Definition: IR.h:710
Halide::Internal::VectorReduce::Max
@ Max
Definition: IR.h:835
Halide::Internal::Call::buffer_get_min
static HALIDE_EXPORT ConstString buffer_get_min
Definition: IR.h:561
Halide::Internal::Shuffle::is_interleave
bool is_interleave() const
Check if this shuffle is an interleaving of the vector arguments.
Halide::Internal::Ramp
A linear ramp vector node.
Definition: IR.h:229
Halide::Internal::Ramp::make
static Expr make(Expr base, Expr stride, int lanes)
Halide::Internal::NE::b
Expr b
Definition: IR.h:113
Halide::Internal::Max::_node_type
static const IRNodeType _node_type
Definition: IR.h:99
Halide::Internal::Let::body
Expr body
Definition: IR.h:255
Halide::Internal::Select::true_value
Expr true_value
Definition: IR.h:187
Halide::Internal::And::make
static Expr make(Expr a, Expr b)
Halide::Internal::Free::_node_type
static const IRNodeType _node_type
Definition: IR.h:393
Halide::Internal::IRNodeType::AssertStmt
@ AssertStmt
Halide::Internal::Broadcast::lanes
int lanes
Definition: IR.h:243
Halide::Internal::Call::popcount
@ popcount
Definition: IR.h:531
Halide::Internal::For::body
Stmt body
Definition: IR.h:703
Halide::Internal::ProducerConsumer::body
Stmt body
Definition: IR.h:300
Halide::Internal::Max::a
Expr a
Definition: IR.h:95
Halide::Internal::Evaluate
Evaluate and discard an expression, presumably because it has some side-effect.
Definition: IR.h:450
Halide::Internal::Acquire::count
Expr count
Definition: IR.h:719
Halide::Internal::Sub::b
Expr b
Definition: IR.h:48
Halide::Internal::Call::shift_left
@ shift_left
Definition: IR.h:542
Halide::Internal::IRNodeType::And
@ And
Halide::Internal::Call::random
@ random
Definition: IR.h:534
Halide::Internal::IRNodeType::Max
@ Max
Halide::Internal::Store
Store a 'value' to the buffer called 'name' at a given 'index' if 'predicate' is true.
Definition: IR.h:315
Halide::Internal::Min::a
Expr a
Definition: IR.h:86
Halide::Internal::Provide::name
std::string name
Definition: IR.h:337
Halide::Internal::Not::a
Expr a
Definition: IR.h:176
Halide::Internal::Max::b
Expr b
Definition: IR.h:95
Halide::Internal::Variable
A named variable.
Definition: IR.h:651
Halide::Internal::Mul::a
Expr a
Definition: IR.h:57
Halide::Internal::VectorReduce::And
@ And
Definition: IR.h:836
Type.h
Halide::Internal::Load::predicate
Expr predicate
Definition: IR.h:202
Halide::Internal::Add::a
Expr a
Definition: IR.h:39
Halide::Internal::Realize::body
Stmt body
Definition: IR.h:408
Expr.h
Halide::Internal::EQ::make
static Expr make(Expr a, Expr b)
Halide::Internal::Min
The lesser of two values.
Definition: IR.h:85
Halide::Internal::Fork::first
Stmt first
Definition: IR.h:432
Halide::Internal::Allocate::constant_allocation_size
int32_t constant_allocation_size() const
Halide::Internal::Call::if_then_else_mask
@ if_then_else_mask
Definition: IR.h:521
Halide::Internal::LetStmt::_node_type
static const IRNodeType _node_type
Definition: IR.h:271
Halide::Internal::ProducerConsumer
This node is a helpful annotation to do with permissions.
Definition: IR.h:297
Halide::Internal::Variable::make
static Expr make(Type type, const std::string &name, const Buffer<> &image)
Definition: IR.h:672
Halide::Internal::IRNodeType::VectorReduce
@ VectorReduce
Halide::Internal::Free::name
std::string name
Definition: IR.h:389
Halide::Internal::Div::_node_type
static const IRNodeType _node_type
Definition: IR.h:70
Halide::Internal::Call::memoize_expr
@ memoize_expr
Definition: IR.h:528
Halide::Internal::Call::is_pure
bool is_pure() const
Check if a call node is pure within a pipeline, meaning that the same args always give the same resul...
Definition: IR.h:624
Halide::Internal::Call::get_intrinsic_name
static const char * get_intrinsic_name(IntrinsicOp op)
Halide::Internal::FunctionPtr
A possibly-weak pointer to a Halide function.
Definition: FunctionPtr.h:27
Halide::Internal::LT::_node_type
static const IRNodeType _node_type
Definition: IR.h:126
Halide::Internal::Call::name
std::string name
Definition: IR.h:465
Halide::Internal::Mod
The remainder of a / b.
Definition: IR.h:76
Halide::Internal::Not::make
static Expr make(Expr a)
Halide::Internal::VectorReduce::Or
@ Or
Definition: IR.h:837
Halide::Internal::Call::make
static Expr make(const Buffer<> &image, const std::vector< Expr > &args)
Convenience constructor for loads from concrete images.
Definition: IR.h:609
Halide::Internal::IRNodeType::Let
@ Let
Halide::Internal::is_parallel
bool is_parallel(ForType for_type)
Returns true if for_type executes for loop iterations in parallel.
Halide::Internal::Store::name
std::string name
Definition: IR.h:316
Halide::Internal::Call::count_trailing_zeros
@ count_trailing_zeros
Definition: IR.h:506
Halide::Internal::Provide::_node_type
static const IRNodeType _node_type
Definition: IR.h:343
Halide::Internal::Allocate::condition
Expr condition
Definition: IR.h:357
Halide::Internal::Atomic::_node_type
static const IRNodeType _node_type
Definition: IR.h:818
Halide::Internal::AssertStmt
If the 'condition' is false, then evaluate and return the message, which should be a call to an error...
Definition: IR.h:276
Halide::Internal::Call::select_mask
@ select_mask
Definition: IR.h:541
Halide::Buffer::name
const std::string & name() const
Definition: Buffer.h:360
Halide::Internal::Call::buffer_get_device
static HALIDE_EXPORT ConstString buffer_get_device
Definition: IR.h:566
Halide::Internal::And::_node_type
static const IRNodeType _node_type
Definition: IR.h:162
Halide::Internal::ProducerConsumer::make_consume
static Stmt make_consume(const std::string &name, Stmt body)
Halide::Internal::And::a
Expr a
Definition: IR.h:158
Halide::Buffer::type
Type type() const
Definition: Buffer.h:521
Halide::Internal::Call::shift_right
@ shift_right
Definition: IR.h:543
Halide::Internal::IRNodeType::NE
@ NE
Halide::Internal::Call::PureIntrinsic
@ PureIntrinsic
A side-effect-free version of the above.
Definition: IR.h:473
Halide::Internal::PrefetchDirective
Definition: PrefetchDirective.h:37
Halide::Internal::Call::args
std::vector< Expr > args
Definition: IR.h:466
Halide::Internal::Function
A reference-counted handle to Halide's internal representation of a function.
Definition: Function.h:38
Halide::Internal::Select::_node_type
static const IRNodeType _node_type
Definition: IR.h:191
Halide::Internal::Call::PureExtern
@ PureExtern
A call to a guaranteed-side-effect-free external function.
Definition: IR.h:470
Halide::Internal::Call
A function call.
Definition: IR.h:464
Halide::Internal::LT::make
static Expr make(Expr a, Expr b)
Halide::Internal::Block::rest
Stmt rest
Definition: IR.h:418
Halide::Internal::Mod::b
Expr b
Definition: IR.h:77
Halide::Internal::Call::count_leading_zeros
@ count_leading_zeros
Definition: IR.h:505
Halide::Internal::Call::buffer_set_host_dirty
static HALIDE_EXPORT ConstString buffer_set_host_dirty
Definition: IR.h:572
HALIDE_EXPORT
#define HALIDE_EXPORT
Definition: Util.h:36
Halide::Internal::Shuffle::make_extract_element
static Expr make_extract_element(Expr vector, int i)
Convenience constructor for making a shuffle representing extracting a single element.
Halide::Internal::Shuffle::indices
std::vector< int > indices
Indices indicating which vector element to place into the result.
Definition: IR.h:735
ModulusRemainder.h
Halide::Internal::Call::IntrinsicOp
IntrinsicOp
Definition: IR.h:492
Halide::Internal::Ramp::_node_type
static const IRNodeType _node_type
Definition: IR.h:235
Halide::Internal::For::extent
Expr extent
Definition: IR.h:700
Halide::Internal::IRNodeType::IfThenElse
@ IfThenElse
Halide::Internal::Prefetch::body
Stmt body
Definition: IR.h:793
Halide::Internal::IRNodeType::Mul
@ Mul
Halide::Internal::Parameter::name
const std::string & name() const
Get the name of this parameter.
Halide::Internal::IfThenElse::then_case
Stmt then_case
Definition: IR.h:442
Halide::Internal::Call::is_intrinsic
bool is_intrinsic() const
Definition: IR.h:630
Halide::Internal::And::b
Expr b
Definition: IR.h:158
Halide::Internal::IfThenElse::make
static Stmt make(Expr condition, Stmt then_case, Stmt else_case=Stmt())
Halide::Internal::Prefetch::_node_type
static const IRNodeType _node_type
Definition: IR.h:800
Halide::Internal::IfThenElse::else_case
Stmt else_case
Definition: IR.h:442
Halide::Internal::Call::unsafe_promise_clamped
@ unsafe_promise_clamped
Definition: IR.h:550
Halide::Internal::Call::buffer_get_shape
static HALIDE_EXPORT ConstString buffer_get_shape
Definition: IR.h:568
Halide::Internal::IRNodeType::GT
@ GT
Halide::Internal::Call::bool_to_mask
@ bool_to_mask
Definition: IR.h:501
Halide::Internal::Store::alignment
ModulusRemainder alignment
Definition: IR.h:323
Halide::Internal::Let::value
Expr value
Definition: IR.h:255
Halide::Internal::ProducerConsumer::name
std::string name
Definition: IR.h:298
Halide::Internal::Call::cast_mask
@ cast_mask
Definition: IR.h:504
Halide::Internal::LE::make
static Expr make(Expr a, Expr b)
Halide::Internal::Realize::bounds
Region bounds
Definition: IR.h:406
Halide::Internal::Add::_node_type
static const IRNodeType _node_type
Definition: IR.h:43
Halide::Internal::Select
A ternary operator.
Definition: IR.h:186
PrefetchDirective.h
Halide::Internal::IRNodeType::Ramp
@ Ramp
Halide::Internal::Call::mulhi_shr
@ mulhi_shr
Definition: IR.h:530
Halide::Internal::Select::false_value
Expr false_value
Definition: IR.h:187
Halide::Internal::Fork::make
static Stmt make(Stmt first, Stmt rest)
Halide::Internal::Ramp::base
Expr base
Definition: IR.h:230
Halide::Internal::Call::stringify
@ stringify
Definition: IR.h:548
Halide::Internal::Call::add_image_checks_marker
@ add_image_checks_marker
Definition: IR.h:495
Halide::Internal::Variable::param
Parameter param
References to scalar parameters, or to the dimensions of buffer parameters hang onto those expression...
Definition: IR.h:656
Halide::Internal::Realize::types
std::vector< Type > types
Definition: IR.h:404
Halide::Internal::Sub::make
static Expr make(Expr a, Expr b)
FunctionPtr.h
Halide::Internal::VectorReduce::_node_type
static const IRNodeType _node_type
Definition: IR.h:845
Halide::Internal::Call::_node_type
static const IRNodeType _node_type
Definition: IR.h:645
Halide::Internal::Variable::make
static Expr make(Type type, const std::string &name, ReductionDomain reduction_domain)
Definition: IR.h:676
Halide::Internal::Broadcast::_node_type
static const IRNodeType _node_type
Definition: IR.h:247
Halide::Internal::Allocate::extents
std::vector< Expr > extents
Definition: IR.h:356
Halide::Expr
A fragment of Halide syntax.
Definition: Expr.h:256
Halide::Internal::IRNodeType::Acquire
@ Acquire
Halide::Internal::Load::index
Expr index
Definition: IR.h:202
Halide::Internal::Prefetch
Represent a multi-dimensional region of a Func or an ImageParam that needs to be prefetched.
Definition: IR.h:786
Halide::Internal::Mul::b
Expr b
Definition: IR.h:57
Halide::Internal::GT
Is the first expression greater than the second.
Definition: IR.h:139
Halide::Internal::AssertStmt::message
Expr message
Definition: IR.h:279
Halide::MemoryType
MemoryType
An enum describing different address spaces to be used with Func::store_in.
Definition: Expr.h:346
Halide::Internal::Atomic
Lock all the Store nodes in the body statement.
Definition: IR.h:809
Halide::Internal::IRNodeType::Realize
@ Realize
Halide::Internal::Shuffle
Construct a new vector by taking elements from another sequence of vectors.
Definition: IR.h:729
Halide::Internal::LE::_node_type
static const IRNodeType _node_type
Definition: IR.h:135
Halide::Internal::Let::make
static Expr make(const std::string &name, Expr value, Expr body)
Halide::Internal::EQ::_node_type
static const IRNodeType _node_type
Definition: IR.h:108
Halide::Internal::Variable::name
std::string name
Definition: IR.h:652
Halide::Internal::Allocate::type
Type type
Definition: IR.h:354
Halide::Internal::IRNodeType::Mod
@ Mod
Halide::Internal::IRNodeType::Shuffle
@ Shuffle
Halide::Internal::Atomic::make
static Stmt make(const std::string &producer_name, const std::string &mutex_name, Stmt body)
Halide::Internal::Store::make
static Stmt make(const std::string &name, Expr value, Expr index, Parameter param, Expr predicate, ModulusRemainder alignment)
Halide::Internal::Call::buffer_init_from_buffer
static HALIDE_EXPORT ConstString buffer_init_from_buffer
Definition: IR.h:576
Halide::Internal::StmtNode
Definition: Expr.h:166
Halide::Internal::GE::_node_type
static const IRNodeType _node_type
Definition: IR.h:153
Halide::Internal::Call::image
Buffer image
Definition: IR.h:591
Halide::Internal::Call::declare_box_touched
@ declare_box_touched
Definition: IR.h:507
Halide::Internal::Realize::condition
Expr condition
Definition: IR.h:407
Halide::Internal::IRNodeType::Store
@ Store
Halide::Internal::Call::image_store
@ image_store
Definition: IR.h:523
Halide::Internal::ModulusRemainder
The result of modulus_remainder analysis.
Definition: ModulusRemainder.h:31
Halide::Internal::IRNodeType::Prefetch
@ Prefetch
Halide::Internal::Variable::make
static Expr make(Type type, const std::string &name)
Definition: IR.h:664
Halide::Internal::Allocate::free_function
std::string free_function
Definition: IR.h:367
Halide::Internal::ReductionDomain
A reference-counted handle on a reduction domain, which is just a vector of ReductionVariable.
Definition: Reduction.h:33
Halide::Internal::Call::buffer_get_extent
static HALIDE_EXPORT ConstString buffer_get_extent
Definition: IR.h:562
Halide::Internal::Allocate::name
std::string name
Definition: IR.h:353
Halide::Internal::Call::debug_to_file
@ debug_to_file
Definition: IR.h:508
Halide::Internal::Call::call_type
CallType call_type
Definition: IR.h:475
Halide::Internal::Call::hvx_scatter_acc
@ hvx_scatter_acc
Definition: IR.h:518
Halide::Internal::IRNodeType::Allocate
@ Allocate
Halide::Internal::Add::b
Expr b
Definition: IR.h:39
Halide::Internal::GT::_node_type
static const IRNodeType _node_type
Definition: IR.h:144
Halide::Internal::IRNodeType::Div
@ Div
Halide::Internal::IfThenElse
An if-then-else block.
Definition: IR.h:440
Halide::Internal::Call::promise_clamped
@ promise_clamped
Definition: IR.h:533
Halide::Internal::Sub
The difference of two expressions.
Definition: IR.h:47
Halide::Internal::LetStmt::body
Stmt body
Definition: IR.h:267
Halide::Internal::Call::bitwise_or
@ bitwise_or
Definition: IR.h:499
Halide::Internal::Store::value
Expr value
Definition: IR.h:317
Halide::Internal::Load::name
std::string name
Definition: IR.h:200
Halide::Internal::Prefetch::name
std::string name
Definition: IR.h:787
Halide::Internal::Variable::make
static Expr make(Type type, const std::string &name, Parameter param)
Definition: IR.h:668
Halide::Internal::Ramp::stride
Expr stride
Definition: IR.h:230
Halide::Internal::IRNodeType::Call
@ Call
Halide::Internal::And
Logical and - are both expressions true.
Definition: IR.h:157
Halide::Internal::Call::mod_round_to_zero
@ mod_round_to_zero
Definition: IR.h:529
Halide::Internal::EQ::b
Expr b
Definition: IR.h:104
Halide::Internal::Variable::_node_type
static const IRNodeType _node_type
Definition: IR.h:683
Halide::Internal::Max::make
static Expr make(Expr a, Expr b)
Halide::Internal::Call::trace
static HALIDE_EXPORT ConstString trace
Definition: IR.h:579
Halide::Internal::Load::alignment
ModulusRemainder alignment
Definition: IR.h:213
Halide::Internal::Call::likely_if_innermost
@ likely_if_innermost
Definition: IR.h:526
Halide::Internal::Cast::_node_type
static const IRNodeType _node_type
Definition: IR.h:34
Halide::Internal::Call::buffer_get_device_interface
static HALIDE_EXPORT ConstString buffer_get_device_interface
Definition: IR.h:567
Halide::Internal::GT::b
Expr b
Definition: IR.h:140
Halide::Internal::Call::glsl_texture_store
@ glsl_texture_store
Definition: IR.h:513
Halide::Internal::Not
Logical not - true if the expression false.
Definition: IR.h:175
Halide::Internal::LE::b
Expr b
Definition: IR.h:131
Halide::Internal::LT
Is the first expression less than the second.
Definition: IR.h:121
Halide::Internal::Call::make_struct
@ make_struct
Definition: IR.h:527
Halide::DeviceAPI
DeviceAPI
An enum describing a type of device API.
Definition: DeviceAPI.h:15
Halide::Internal::Mul
The product of two expressions.
Definition: IR.h:56
Halide::Internal::GT::a
Expr a
Definition: IR.h:140
Halide::Internal::Div::b
Expr b
Definition: IR.h:66
Halide::Internal::NE::make
static Expr make(Expr a, Expr b)
Halide::Internal::Variable::image
Buffer image
References to properties of literal image parameters.
Definition: IR.h:659
Halide::Internal::VectorReduce::Add
@ Add
Definition: IR.h:832
Halide::Internal::Block
A sequence of statements to be executed in-order.
Definition: IR.h:417
Halide::Internal::Call::prefetch
@ prefetch
Definition: IR.h:532
Halide::Internal::IRNodeType::Load
@ Load
Halide::Internal::Shuffle::make_interleave
static Expr make_interleave(const std::vector< Expr > &vectors)
Convenience constructor for making a shuffle representing an interleaving of vectors of the same leng...
Halide::Internal::Fork::rest
Stmt rest
Definition: IR.h:432
Halide::Internal::NE::a
Expr a
Definition: IR.h:113