Loading...
Searching...
No Matches
CodeGen_C.h
Go to the documentation of this file.
#ifndef HALIDE_CODEGEN_C_H
#define HALIDE_CODEGEN_C_H
/** \file
*
* Defines an IRPrinter that emits C++ code equivalent to a halide stmt
*/
#include "IRPrinter.h"
#include "Scope.h"
#include "Target.h"
#include <unordered_map>
namespace Halide {
struct Argument;
class Module;
namespace Internal {
struct LoweredFunc;
/** This class emits C++ code equivalent to a halide Stmt. It's
* mostly the same as an IRPrinter, but it's wrapped in a function
* definition, and some things are handled differently to be valid
* C++.
*/
class CodeGen_C : public IRPrinter {
public:
enum OutputKind {
CHeader,
CPlusPlusHeader,
CImplementation,
CPlusPlusImplementation,
CExternDecl,
CPlusPlusExternDecl,
CPlusPlusFunctionInfoHeader,
};
/** Initialize a C code generator pointing at a particular output
* stream (e.g. a file, or std::cout) */
CodeGen_C(std::ostream &dest,
const Target &target,
OutputKind output_kind = CImplementation,
const std::string &include_guard = "");
~CodeGen_C() override;
/** Emit the declarations contained in the module as C code. */
void compile(const Module &module);
/** The target we're generating code for */
const Target &get_target() const {
return target;
}
static void test();
protected:
enum class IntegerSuffixStyle {
PlainC = 0,
OpenCL = 1,
HLSL = 2
};
/** How to emit 64-bit integer constants */
IntegerSuffixStyle integer_suffix_style = IntegerSuffixStyle::PlainC;
/** Emit a declaration. */
// @{
void compile(const LoweredFunc &func, const MetadataNameMap &metadata_name_map);
void compile(const Buffer<> &buffer);
// @}
/** This is a hook that subclasses can use to transform a function body
* just before it is emitted -- e.g., to transform the IR to code that
* is easier to recognize and emit. The default implementation simply
* returns the input unchanged.
*
* This hook will always be called after the function declaration and
* opening brace is emitted, so in addition to (possibly) returning
* a modified Stmt, this function may also emit C++ code to the default
* stream if it wishes to add some prologue at the start of the function.
*/
virtual Stmt preprocess_function_body(const Stmt &stmt);
/** An ID for the most recently generated ssa variable */
std::string id;
/** The target being generated for. */
Target target;
/** Controls whether this instance is generating declarations or
* definitions and whether the interface us extern "C" or C++. */
OutputKind output_kind;
/** A cache of generated values in scope */
std::map<std::string, std::string> cache;
/** Emit an expression as an assignment, then return the id of the
* resulting var */
std::string print_expr(const Expr &);
/** Like print_expr, but cast the Expr to the given Type */
std::string print_cast_expr(const Type &, const Expr &);
/** Emit a statement */
void print_stmt(const Stmt &);
void create_assertion(const std::string &id_cond, const Expr &message);
void create_assertion(const Expr &cond, const Expr &message);
Expr scalarize_vector_reduce(const VectorReduce *op);
enum AppendSpaceIfNeeded {
DoNotAppendSpace,
AppendSpace,
};
/** Emit the C name for a halide type. If space_option is AppendSpace,
* and there should be a space between the type and the next token,
* one is appended. (This allows both "int foo" and "Foo *foo" to be
* formatted correctly. Otherwise the latter is "Foo * foo".)
*/
virtual std::string print_type(Type, AppendSpaceIfNeeded space_option = DoNotAppendSpace);
/** Emit a statement to reinterpret an expression as another type */
virtual std::string print_reinterpret(Type, const Expr &);
/** Emit a version of a string that is a valid identifier in C (. is replaced with _) */
virtual std::string print_name(const std::string &);
/** Add platform specific prologue */
virtual void add_platform_prologue();
/** Add typedefs for vector types. Not needed for OpenCL, might
* use different syntax for other C-like languages. */
virtual void add_vector_typedefs(const std::set<Type> &vector_types);
std::unordered_map<std::string, std::string> extern_function_name_map;
/** Bottleneck to allow customization of calls to generic Extern/PureExtern calls. */
virtual std::string print_extern_call(const Call *op);
/** Convert a vector Expr into a series of scalar Exprs, then reassemble into vector of original type. */
std::string print_scalarized_expr(const Expr &e);
/** Emit an SSA-style assignment, and set id to the freshly generated name. Return id. */
virtual std::string print_assignment(Type t, const std::string &rhs);
/** Emit free for the heap allocation. **/
void print_heap_free(const std::string &alloc_name);
/** Return true if only generating an interface, which may be extern "C" or C++ */
bool is_header() {
return output_kind == CHeader ||
output_kind == CPlusPlusHeader ||
output_kind == CPlusPlusFunctionInfoHeader;
}
/** Return true if only generating an interface, which may be extern "C" or C++ */
bool is_extern_decl() {
return output_kind == CExternDecl ||
output_kind == CPlusPlusExternDecl;
}
/** Return true if only generating an interface, which may be extern "C" or C++ */
bool is_header_or_extern_decl() {
return is_header() || is_extern_decl();
}
/** Return true if generating C++ linkage. */
bool is_c_plus_plus_interface() {
return output_kind == CPlusPlusHeader ||
output_kind == CPlusPlusImplementation ||
output_kind == CPlusPlusExternDecl ||
output_kind == CPlusPlusFunctionInfoHeader;
}
/** Open a new C scope (i.e. throw in a brace, increase the indent) */
void open_scope();
/** Close a C scope (i.e. throw in an end brace, decrease the indent) */
void close_scope(const std::string &comment);
struct Allocation {
Type type;
};
/** Track the types of allocations to avoid unnecessary casts. */
Scope<Allocation> allocations;
/** Track which allocations actually went on the heap. */
Scope<> heap_allocations;
/** True if there is a void * __user_context parameter in the arguments. */
bool have_user_context;
/** Track current calling convention scope. */
bool extern_c_open = false;
/** True if at least one gpu-based for loop is used. */
bool uses_gpu_for_loops;
/** Track which handle types have been forward-declared already. */
std::set<const halide_handle_cplusplus_type *> forward_declared;
/** If the Type is a handle type, emit a forward-declaration for it
* if we haven't already. */
void forward_declare_type_if_needed(const Type &t);
void set_name_mangling_mode(NameMangling mode);
using IRPrinter::visit;
void visit(const Variable *) override;
void visit(const IntImm *) override;
void visit(const UIntImm *) override;
void visit(const StringImm *) override;
void visit(const FloatImm *) override;
void visit(const Cast *) override;
void visit(const Reinterpret *) override;
void visit(const Add *) override;
void visit(const Sub *) override;
void visit(const Mul *) override;
void visit(const Div *) override;
void visit(const Mod *) override;
void visit(const Max *) override;
void visit(const Min *) override;
void visit(const EQ *) override;
void visit(const NE *) override;
void visit(const LT *) override;
void visit(const LE *) override;
void visit(const GT *) override;
void visit(const GE *) override;
void visit(const And *) override;
void visit(const Or *) override;
void visit(const Not *) override;
void visit(const Call *) override;
void visit(const Select *) override;
void visit(const Load *) override;
void visit(const Store *) override;
void visit(const Let *) override;
void visit(const LetStmt *) override;
void visit(const AssertStmt *) override;
void visit(const ProducerConsumer *) override;
void visit(const For *) override;
void visit(const Ramp *) override;
void visit(const Broadcast *) override;
void visit(const Provide *) override;
void visit(const Allocate *) override;
void visit(const Free *) override;
void visit(const Realize *) override;
void visit(const IfThenElse *) override;
void visit(const Evaluate *) override;
void visit(const Shuffle *) override;
void visit(const Prefetch *) override;
void visit(const Fork *) override;
void visit(const Acquire *) override;
void visit(const Atomic *) override;
void visit(const VectorReduce *) override;
void visit_binop(Type t, const Expr &a, const Expr &b, const char *op);
void visit_relop(Type t, const Expr &a, const Expr &b, const char *scalar_op, const char *vector_op);
template<typename T>
static std::string with_sep(const std::vector<T> &v, const std::string &sep) {
std::ostringstream o;
for (size_t i = 0; i < v.size(); ++i) {
if (i > 0) {
o << sep;
}
o << v[i];
}
return o.str();
}
template<typename T>
static std::string with_commas(const std::vector<T> &v) {
return with_sep<T>(v, ", ");
}
/** Are we inside an atomic node that uses mutex locks?
This is used for detecting deadlocks from nested atomics. */
bool inside_atomic_mutex_node = false;
/** Emit atomic store instructions? */
bool emit_atomic_stores = false;
/** true if add_vector_typedefs() has been called. */
bool using_vector_typedefs = false;
/** Some architectures have private memory for the call stack; this
* means a thread cannot hand pointers to stack memory to another
* thread. Returning true here flag forces heap allocation of
* things that might be shared, such as closures and any buffer
* that may be used in a parallel context. */
virtual bool is_stack_private_to_thread() const;
void emit_argv_wrapper(const std::string &function_name,
const std::vector<LoweredArgument> &args);
void emit_metadata_getter(const std::string &function_name,
const std::vector<LoweredArgument> &args,
const MetadataNameMap &metadata_name_map);
void emit_constexpr_function_info(const std::string &function_name,
const std::vector<LoweredArgument> &args,
const MetadataNameMap &metadata_name_map);
void emit_halide_free_helper(const std::string &alloc_name, const std::string &free_function);
};
} // namespace Internal
} // namespace Halide
#endif
IRPrinter.h
This header file defines operators that let you dump a Halide expression, statement,...
Scope.h
Defines the Scope class, which is used for keeping track of names in a scope while traversing IR.
Target.h
Defines the structure that describes a Halide target.
Halide::Buffer<>
Halide::Internal::CodeGen_C::OutputKind
OutputKind
Definition CodeGen_C.h:31
Halide::Internal::CodeGen_C::CPlusPlusHeader
@ CPlusPlusHeader
Definition CodeGen_C.h:33
Halide::Internal::CodeGen_C::CPlusPlusFunctionInfoHeader
@ CPlusPlusFunctionInfoHeader
Definition CodeGen_C.h:38
Halide::Internal::CodeGen_C::CPlusPlusImplementation
@ CPlusPlusImplementation
Definition CodeGen_C.h:35
Halide::Internal::CodeGen_C::CPlusPlusExternDecl
@ CPlusPlusExternDecl
Definition CodeGen_C.h:37
Halide::Internal::CodeGen_C::CHeader
@ CHeader
Definition CodeGen_C.h:32
Halide::Internal::CodeGen_C::CExternDecl
@ CExternDecl
Definition CodeGen_C.h:36
Halide::Internal::CodeGen_C::CImplementation
@ CImplementation
Definition CodeGen_C.h:34
Halide::Internal::CodeGen_C::visit
void visit(const GE *) override
Halide::Internal::CodeGen_C::is_extern_decl
bool is_extern_decl()
Return true if only generating an interface, which may be extern "C" or C++.
Definition CodeGen_C.h:161
Halide::Internal::CodeGen_C::visit
void visit(const Provide *) override
Halide::Internal::CodeGen_C::visit
void visit(const Evaluate *) override
Halide::Internal::CodeGen_C::print_type
virtual std::string print_type(Type, AppendSpaceIfNeeded space_option=DoNotAppendSpace)
Emit the C name for a halide type.
Halide::Internal::CodeGen_C::~CodeGen_C
~CodeGen_C() override
Halide::Internal::CodeGen_C::print_heap_free
void print_heap_free(const std::string &alloc_name)
Emit free for the heap allocation.
Halide::Internal::CodeGen_C::visit
void visit(const NE *) override
Halide::Internal::CodeGen_C::visit
void visit(const Realize *) override
Halide::Internal::CodeGen_C::CodeGen_C
CodeGen_C(std::ostream &dest, const Target &target, OutputKind output_kind=CImplementation, const std::string &include_guard="")
Initialize a C code generator pointing at a particular output stream (e.g.
Halide::Internal::CodeGen_C::visit
void visit(const Call *) override
Halide::Internal::CodeGen_C::visit
void visit(const UIntImm *) override
Halide::Internal::CodeGen_C::close_scope
void close_scope(const std::string &comment)
Close a C scope (i.e.
Halide::Internal::CodeGen_C::IntegerSuffixStyle
IntegerSuffixStyle
Definition CodeGen_C.h:60
Halide::Internal::CodeGen_C::IntegerSuffixStyle::OpenCL
@ OpenCL
Definition CodeGen_C.h:62
Halide::Internal::CodeGen_C::IntegerSuffixStyle::PlainC
@ PlainC
Definition CodeGen_C.h:61
Halide::Internal::CodeGen_C::IntegerSuffixStyle::HLSL
@ HLSL
Definition CodeGen_C.h:63
Halide::Internal::CodeGen_C::visit
void visit(const Or *) override
Halide::Internal::CodeGen_C::visit
void visit(const Sub *) override
Halide::Internal::CodeGen_C::create_assertion
void create_assertion(const std::string &id_cond, const Expr &message)
Halide::Internal::CodeGen_C::open_scope
void open_scope()
Open a new C scope (i.e.
Halide::Internal::CodeGen_C::is_stack_private_to_thread
virtual bool is_stack_private_to_thread() const
Some architectures have private memory for the call stack; this means a thread cannot hand pointers t...
Halide::Internal::CodeGen_C::output_kind
OutputKind output_kind
Controls whether this instance is generating declarations or definitions and whether the interface us...
Definition CodeGen_C.h:95
Halide::Internal::CodeGen_C::is_header
bool is_header()
Return true if only generating an interface, which may be extern "C" or C++.
Definition CodeGen_C.h:154
Halide::Internal::CodeGen_C::using_vector_typedefs
bool using_vector_typedefs
true if add_vector_typedefs() has been called.
Definition CodeGen_C.h:290
Halide::Internal::CodeGen_C::visit
void visit(const Max *) override
Halide::Internal::CodeGen_C::visit
void visit(const Select *) override
Halide::Internal::CodeGen_C::visit
void visit(const Load *) override
Halide::Internal::CodeGen_C::visit
void visit(const FloatImm *) override
Halide::Internal::CodeGen_C::forward_declare_type_if_needed
void forward_declare_type_if_needed(const Type &t)
If the Type is a handle type, emit a forward-declaration for it if we haven't already.
Halide::Internal::CodeGen_C::visit
void visit(const LE *) override
Halide::Internal::CodeGen_C::visit
void visit(const Div *) override
Halide::Internal::CodeGen_C::scalarize_vector_reduce
Expr scalarize_vector_reduce(const VectorReduce *op)
Halide::Internal::CodeGen_C::visit
void visit(const Let *) override
Halide::Internal::CodeGen_C::visit
void visit(const And *) override
Halide::Internal::CodeGen_C::test
static void test()
Halide::Internal::CodeGen_C::visit
void visit(const Atomic *) override
Halide::Internal::CodeGen_C::forward_declared
std::set< const halide_handle_cplusplus_type * > forward_declared
Track which handle types have been forward-declared already.
Definition CodeGen_C.h:205
Halide::Internal::CodeGen_C::is_header_or_extern_decl
bool is_header_or_extern_decl()
Return true if only generating an interface, which may be extern "C" or C++.
Definition CodeGen_C.h:167
Halide::Internal::CodeGen_C::add_vector_typedefs
virtual void add_vector_typedefs(const std::set< Type > &vector_types)
Add typedefs for vector types.
Halide::Internal::CodeGen_C::visit
void visit(const For *) override
Halide::Internal::CodeGen_C::print_stmt
void print_stmt(const Stmt &)
Emit a statement.
Halide::Internal::CodeGen_C::compile
void compile(const LoweredFunc &func, const MetadataNameMap &metadata_name_map)
Emit a declaration.
Halide::Internal::CodeGen_C::preprocess_function_body
virtual Stmt preprocess_function_body(const Stmt &stmt)
This is a hook that subclasses can use to transform a function body just before it is emitted – e....
Halide::Internal::CodeGen_C::allocations
Scope< Allocation > allocations
Track the types of allocations to avoid unnecessary casts.
Definition CodeGen_C.h:190
Halide::Internal::CodeGen_C::print_name
virtual std::string print_name(const std::string &)
Emit a version of a string that is a valid identifier in C (.
Halide::Internal::CodeGen_C::visit
void visit(const GT *) override
Halide::Internal::CodeGen_C::visit
void visit(const Free *) override
Halide::Internal::CodeGen_C::compile
void compile(const Buffer<> &buffer)
Halide::Internal::CodeGen_C::visit
void visit(const Store *) override
Halide::Internal::CodeGen_C::emit_atomic_stores
bool emit_atomic_stores
Emit atomic store instructions?
Definition CodeGen_C.h:287
Halide::Internal::CodeGen_C::emit_halide_free_helper
void emit_halide_free_helper(const std::string &alloc_name, const std::string &free_function)
Halide::Internal::CodeGen_C::visit
void visit(const Prefetch *) override
Halide::Internal::CodeGen_C::visit
void visit(const Add *) override
Halide::Internal::CodeGen_C::heap_allocations
Scope heap_allocations
Track which allocations actually went on the heap.
Definition CodeGen_C.h:193
Halide::Internal::CodeGen_C::target
Target target
The target being generated for.
Definition CodeGen_C.h:91
Halide::Internal::CodeGen_C::print_extern_call
virtual std::string print_extern_call(const Call *op)
Bottleneck to allow customization of calls to generic Extern/PureExtern calls.
Halide::Internal::CodeGen_C::print_reinterpret
virtual std::string print_reinterpret(Type, const Expr &)
Emit a statement to reinterpret an expression as another type.
Halide::Internal::CodeGen_C::visit
void visit(const Reinterpret *) override
Halide::Internal::CodeGen_C::visit
void visit(const AssertStmt *) override
Halide::Internal::CodeGen_C::visit
void visit(const EQ *) override
Halide::Internal::CodeGen_C::get_target
const Target & get_target() const
The target we're generating code for.
Definition CodeGen_C.h:53
Halide::Internal::CodeGen_C::create_assertion
void create_assertion(const Expr &cond, const Expr &message)
Halide::Internal::CodeGen_C::visit
void visit(const VectorReduce *) override
Halide::Internal::CodeGen_C::visit
void visit(const Ramp *) override
Halide::Internal::CodeGen_C::emit_argv_wrapper
void emit_argv_wrapper(const std::string &function_name, const std::vector< LoweredArgument > &args)
Halide::Internal::CodeGen_C::is_c_plus_plus_interface
bool is_c_plus_plus_interface()
Return true if generating C++ linkage.
Definition CodeGen_C.h:172
Halide::Internal::CodeGen_C::visit
void visit(const Not *) override
Halide::Internal::CodeGen_C::emit_constexpr_function_info
void emit_constexpr_function_info(const std::string &function_name, const std::vector< LoweredArgument > &args, const MetadataNameMap &metadata_name_map)
Halide::Internal::CodeGen_C::id
std::string id
An ID for the most recently generated ssa variable.
Definition CodeGen_C.h:88
Halide::Internal::CodeGen_C::visit_relop
void visit_relop(Type t, const Expr &a, const Expr &b, const char *scalar_op, const char *vector_op)
Halide::Internal::CodeGen_C::AppendSpaceIfNeeded
AppendSpaceIfNeeded
Definition CodeGen_C.h:114
Halide::Internal::CodeGen_C::DoNotAppendSpace
@ DoNotAppendSpace
Definition CodeGen_C.h:115
Halide::Internal::CodeGen_C::AppendSpace
@ AppendSpace
Definition CodeGen_C.h:116
Halide::Internal::CodeGen_C::with_commas
static std::string with_commas(const std::vector< T > &v)
Definition CodeGen_C.h:278
Halide::Internal::CodeGen_C::visit
void visit(const Min *) override
Halide::Internal::CodeGen_C::visit
void visit(const Variable *) override
Halide::Internal::CodeGen_C::emit_metadata_getter
void emit_metadata_getter(const std::string &function_name, const std::vector< LoweredArgument > &args, const MetadataNameMap &metadata_name_map)
Halide::Internal::CodeGen_C::set_name_mangling_mode
void set_name_mangling_mode(NameMangling mode)
Halide::Internal::CodeGen_C::visit
void visit(const Mul *) override
Halide::Internal::CodeGen_C::visit
void visit(const Mod *) override
Halide::Internal::CodeGen_C::visit
void visit(const Allocate *) override
Halide::Internal::CodeGen_C::have_user_context
bool have_user_context
True if there is a void * __user_context parameter in the arguments.
Definition CodeGen_C.h:196
Halide::Internal::CodeGen_C::with_sep
static std::string with_sep(const std::vector< T > &v, const std::string &sep)
Definition CodeGen_C.h:266
Halide::Internal::CodeGen_C::visit
void visit(const Cast *) override
Halide::Internal::CodeGen_C::print_assignment
virtual std::string print_assignment(Type t, const std::string &rhs)
Emit an SSA-style assignment, and set id to the freshly generated name.
Halide::Internal::CodeGen_C::extern_c_open
bool extern_c_open
Track current calling convention scope.
Definition CodeGen_C.h:199
Halide::Internal::CodeGen_C::add_platform_prologue
virtual void add_platform_prologue()
Add platform specific prologue.
Halide::Internal::CodeGen_C::inside_atomic_mutex_node
bool inside_atomic_mutex_node
Are we inside an atomic node that uses mutex locks?
Definition CodeGen_C.h:284
Halide::Internal::CodeGen_C::visit
void visit(const IfThenElse *) override
Halide::Internal::CodeGen_C::extern_function_name_map
std::unordered_map< std::string, std::string > extern_function_name_map
Definition CodeGen_C.h:139
Halide::Internal::CodeGen_C::visit
void visit(const Broadcast *) override
Halide::Internal::CodeGen_C::visit
void visit(const StringImm *) override
Halide::Internal::CodeGen_C::compile
void compile(const Module &module)
Emit the declarations contained in the module as C code.
Halide::Internal::CodeGen_C::visit
void visit(const Shuffle *) override
Halide::Internal::CodeGen_C::print_expr
std::string print_expr(const Expr &)
Emit an expression as an assignment, then return the id of the resulting var.
Halide::Internal::CodeGen_C::visit
void visit(const LT *) override
Halide::Internal::CodeGen_C::print_scalarized_expr
std::string print_scalarized_expr(const Expr &e)
Convert a vector Expr into a series of scalar Exprs, then reassemble into vector of original type.
Halide::Internal::CodeGen_C::visit
void visit(const LetStmt *) override
Halide::Internal::CodeGen_C::uses_gpu_for_loops
bool uses_gpu_for_loops
True if at least one gpu-based for loop is used.
Definition CodeGen_C.h:202
Halide::Internal::CodeGen_C::visit
void visit(const Fork *) override
Halide::Internal::CodeGen_C::visit
void visit(const ProducerConsumer *) override
Halide::Internal::CodeGen_C::visit
void visit(const Acquire *) override
Halide::Internal::CodeGen_C::cache
std::map< std::string, std::string > cache
A cache of generated values in scope.
Definition CodeGen_C.h:98
Halide::Internal::CodeGen_C::integer_suffix_style
IntegerSuffixStyle integer_suffix_style
How to emit 64-bit integer constants.
Definition CodeGen_C.h:67
Halide::Internal::CodeGen_C::visit
void visit(const IntImm *) override
Halide::Internal::CodeGen_C::visit_binop
void visit_binop(Type t, const Expr &a, const Expr &b, const char *op)
Halide::Internal::CodeGen_C::print_cast_expr
std::string print_cast_expr(const Type &, const Expr &)
Like print_expr, but cast the Expr to the given Type.
Halide::Internal::IRPrinter::visit
void visit(const IntImm *) override
Halide::Internal::IRPrinter::IRPrinter
IRPrinter(std::ostream &)
Construct an IRPrinter pointed at a given output stream (e.g.
Halide::Internal::Scope
A common pattern when traversing Halide IR is that you need to keep track of stuff when you find a Le...
Definition Scope.h:94
Halide::Module
A halide module.
Definition Module.h:142
Halide::Internal
Definition AbstractGenerator.h:24
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition AbstractGenerator.h:19
Halide::OutputFileType::stmt
@ stmt
Definition Module.h:43
Halide::NameMangling
NameMangling
An enum to specify calling convention for extern stages.
Definition Function.h:26
Halide::MetadataNameMap
std::map< std::string, std::string > MetadataNameMap
Definition Module.h:138
Halide::Argument
A struct representing an argument to a halide-generated function.
Definition Argument.h:37
Halide::Expr
A fragment of Halide syntax.
Definition Expr.h:258
Halide::Internal::Acquire
Definition IR.h:872
Halide::Internal::Add
The sum of two expressions.
Definition IR.h:56
Halide::Internal::Allocate
Allocate a scratch area called with the given name, type, and size.
Definition IR.h:371
Halide::Internal::And
Logical and - are both expressions true.
Definition IR.h:175
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:294
Halide::Internal::Atomic
Lock all the Store nodes in the body statement.
Definition IR.h:994
Halide::Internal::Broadcast
A vector with 'lanes' elements, in which every element is 'value'.
Definition IR.h:259
Halide::Internal::Call
A function call.
Definition IR.h:490
Halide::Internal::Cast
The actual IR nodes begin here.
Definition IR.h:30
Halide::Internal::CodeGen_C::Allocation
Definition CodeGen_C.h:185
Halide::Internal::CodeGen_C::Allocation::type
Type type
Definition CodeGen_C.h:186
Halide::Internal::Div
The ratio of two expressions.
Definition IR.h:83
Halide::Internal::EQ
Is the first expression equal to the second.
Definition IR.h:121
Halide::Internal::Evaluate
Evaluate and discard an expression, presumably because it has some side-effect.
Definition IR.h:476
Halide::Internal::FloatImm
Floating point constants.
Definition Expr.h:236
Halide::Internal::For
A for loop.
Definition IR.h:848
Halide::Internal::Fork
A pair of statements executed concurrently.
Definition IR.h:457
Halide::Internal::Free
Free the resources associated with the given buffer.
Definition IR.h:413
Halide::Internal::GE
Is the first expression greater than or equal to the second.
Definition IR.h:166
Halide::Internal::GT
Is the first expression greater than the second.
Definition IR.h:157
Halide::Internal::IfThenElse
An if-then-else block.
Definition IR.h:466
Halide::Internal::IntImm
Integer constants.
Definition Expr.h:218
Halide::Internal::LE
Is the first expression less than or equal to the second.
Definition IR.h:148
Halide::Internal::LT
Is the first expression less than the second.
Definition IR.h:139
Halide::Internal::Let
A let expression, like you might find in a functional language.
Definition IR.h:271
Halide::Internal::LetStmt
The statement form of a let node.
Definition IR.h:282
Halide::Internal::Load
Load a value from a named symbol if predicate is true.
Definition IR.h:217
Halide::Internal::LoweredFunc
Definition of a lowered function.
Definition Module.h:101
Halide::Internal::Max
The greater of two values.
Definition IR.h:112
Halide::Internal::Min
The lesser of two values.
Definition IR.h:103
Halide::Internal::Mod
The remainder of a / b.
Definition IR.h:94
Halide::Internal::Mul
The product of two expressions.
Definition IR.h:74
Halide::Internal::NE
Is the first expression not equal to the second.
Definition IR.h:130
Halide::Internal::Not
Logical not - true if the expression false.
Definition IR.h:193
Halide::Internal::Or
Logical or - is at least one of the expression true.
Definition IR.h:184
Halide::Internal::Prefetch
Represent a multi-dimensional region of a Func or an ImageParam that needs to be prefetched.
Definition IR.h:956
Halide::Internal::ProducerConsumer
This node is a helpful annotation to do with permissions.
Definition IR.h:315
Halide::Internal::Provide
This defines the value of a function at a multi-dimensional location.
Definition IR.h:354
Halide::Internal::Ramp
A linear ramp vector node.
Definition IR.h:247
Halide::Internal::Realize
Allocate a multi-dimensional buffer of the given type and size.
Definition IR.h:427
Halide::Internal::Reinterpret
Reinterpret value as another type, without affecting any of the bits (on little-endian systems).
Definition IR.h:47
Halide::Internal::Select
A ternary operator.
Definition IR.h:204
Halide::Internal::Shuffle
Construct a new vector by taking elements from another sequence of vectors.
Definition IR.h:884
Halide::Internal::Stmt
A reference-counted handle to a statement node.
Definition Expr.h:427
Halide::Internal::Store
Store a 'value' to the buffer called 'name' at a given 'index' if 'predicate' is true.
Definition IR.h:333
Halide::Internal::StringImm
String constants.
Definition Expr.h:245
Halide::Internal::Sub
The difference of two expressions.
Definition IR.h:65
Halide::Internal::UIntImm
Unsigned integer constants.
Definition Expr.h:227
Halide::Internal::Variable
A named variable.
Definition IR.h:801
Halide::Internal::VectorReduce
Horizontally reduce a vector to a scalar or narrower vector using the given commutative and associati...
Definition IR.h:1012
Halide::Internal::cond
Definition Generator.h:380
Halide::Target
A struct representing a target machine and os to generate code for.
Definition Target.h:19
Halide::Type
Types in the halide type system.
Definition Type.h:283