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