Halide 22.0.0 Halide compiler and libraries

Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
Halide::Internal::CodeGen_C Class Reference

This class emits C++ code equivalent to a halide Stmt. More...

`#include <CodeGen_C.h>`

Inheritance diagram for Halide::Internal::CodeGen_C:

## Classes
struct | Allocation

## Public Types
enum | OutputKind { CHeader , CPlusPlusHeader , CImplementation , CPlusPlusImplementation , CExternDecl , CPlusPlusExternDecl , CPlusPlusFunctionInfoHeader }

## Public Member Functions
| 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. More...
| ~CodeGen_C () override
void | compile (const Module &module)
| Emit the declarations contained in the module as C code. More...
const Target & | get_target () const
| The target we're generating code for. More...
Public Member Functions inherited from Halide::Internal::IRPrinter
| IRPrinter (std::ostream &)
| Construct an IRPrinter pointed at a given output stream (e.g. More...
void | print (const Expr &)
| emit an expression on the output stream More...
void | print_no_parens (const Expr &)
| Emit an expression on the output stream without enclosing parens. More...
void | print (const Stmt &)
| emit a statement on the output stream More...
void | print_summary (const Stmt &)
| emit a statement summary on the output stream More...
void | print_list (const std::vector< Expr > &exprs)
| emit a comma delimited list of exprs, without any leading or trailing punctuation. More...
Public Member Functions inherited from Halide::Internal::IRVisitor
| IRVisitor ()=default
virtual | ~IRVisitor ()=default

## Static Public Member Functions
static void | test ()
Static Public Member Functions inherited from Halide::Internal::IRPrinter
static void | test ()

## Protected Types
enum class | IntegerSuffixStyle { PlainC = 0 , OpenCL = 1 , HLSL = 2 }
enum | AppendSpaceIfNeeded { DoNotAppendSpace , AppendSpace }

## Protected Member Functions
void | compile (const LoweredFunc &func, const MetadataNameMap &metadata_name_map)
| Emit a declaration. More...
void | compile (const Buffer<> &buffer)
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.g., to transform the IR to code that is easier to recognize and emit. More...
std::string | print_expr (const Expr &)
| Emit an expression as an assignment, then return the id of the resulting var. More...
std::string | print_cast_expr (const Type &, const Expr &)
| Like print_expr, but cast the Expr to the given Type. More...
void | print_stmt (const Stmt &)
| Emit a statement. More...
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)
virtual std::string | print_type (Type, AppendSpaceIfNeeded space_option=DoNotAppendSpace)
| Emit the C name for a halide type. More...
virtual std::string | print_reinterpret (Type, const Expr &)
| Emit a statement to reinterpret an expression as another type. More...
virtual std::string | print_name (const std::string &)
| Emit a version of a string that is a valid identifier in C (. More...
virtual void | add_platform_prologue ()
| Add platform specific prologue. More...
virtual void | add_vector_typedefs (const std::set< Type > &vector_types)
| Add typedefs for vector types. More...
virtual std::string | print_extern_call (const Call *op)
| Bottleneck to allow customization of calls to generic Extern/PureExtern calls. More...
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. More...
virtual std::string | print_assignment (Type t, const std::string &rhs)
| Emit an SSA-style assignment, and set id to the freshly generated name. More...
void | print_heap_free (const std::string &alloc_name)
| Emit free for the heap allocation. More...
bool | is_header ()
| Return true if only generating an interface, which may be extern "C" or C++. More...
bool | is_extern_decl ()
| Return true if only generating an interface, which may be extern "C" or C++. More...
bool | is_header_or_extern_decl ()
| Return true if only generating an interface, which may be extern "C" or C++. More...
bool | is_c_plus_plus_interface ()
| Return true if generating C++ linkage. More...
void | open_scope ()
| Open a new C scope (i.e. More...
void | close_scope (const std::string &comment)
| Close a C scope (i.e. More...
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. More...
void | set_name_mangling_mode (NameMangling mode)
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)
virtual bool | is_stack_private_to_thread () const
| Some architectures have private memory for the call stack; this means a thread cannot hand pointers to stack memory to another thread. More...
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)
void | visit (const IntImm *) override
void | visit (const UIntImm *) override
void | visit (const FloatImm *) override
void | visit (const StringImm *) override
void | visit (const Cast *) override
void | visit (const Reinterpret *) override
void | visit (const Variable *) 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 Min *) override
void | visit (const Max *) 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 Select *) override
void | visit (const Load *) override
void | visit (const Ramp *) override
void | visit (const Broadcast *) override
void | visit (const Call *) 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 Acquire *) override
void | visit (const Store *) override
void | visit (const Provide *) override
void | visit (const Allocate *) override
void | visit (const Free *) override
void | visit (const Realize *) override
void | visit (const Block *) override
void | visit (const Fork *) override
void | visit (const IfThenElse *) override
void | visit (const Evaluate *) override
void | visit (const Shuffle *) override
void | visit (const VectorReduce *) override
void | visit (const Prefetch *) override
void | visit (const Atomic *) override
void | visit (const HoistedStorage *) override
Protected Member Functions inherited from Halide::Internal::IRPrinter
Indentation | get_indent () const
template<typename T >
Ansi< T > | hl (const T &t)
template<typename T >
Ansi< T > | kw (const T &t)
template<typename T >
Ansi< T > | imm_int (const T &t)
template<typename T >
Ansi< T > | imm_float (const T &t)
template<typename T >
Ansi< T > | imm_str (const T &t)
template<typename T >
Ansi< T > | var (const T &t)
template<typename T >
Ansi< T > | buf (const T &t)
template<typename T >
Ansi< T > | fn (const T &t)
template<typename T >
Ansi< T > | type (const T &t)
template<typename T >
Ansi< T > | typep (const T &t)
template<typename T >
Ansi< T > | paren (const T &t, bool bold=true, int d=-1)
void | open ()
| Either emits "(" or "", depending on the value of implicit_parens. More...
void | close ()
| Either emits ")" or "", depending on the value of implicit_parens. More...
void | openf ()
| Emits "(" always. More...
void | openf (const char *name)
| Emits "name(" always. More...
void | closef ()
| Emits ")" always. More...
void | print_lets (const Let *let)
| A helper for printing a chain of lets with line breaks. More...
void | print_braced_stmt (const Stmt &, int extra_indent=2)
| A helper for printing a braced statement. More...
void | visit (const IntImm *) override
void | visit (const UIntImm *) override
void | visit (const FloatImm *) override
void | visit (const StringImm *) override
void | visit (const Cast *) override
void | visit (const Reinterpret *) override
void | visit (const Variable *) 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 Min *) override
void | visit (const Max *) 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 Select *) override
void | visit (const Load *) override
void | visit (const Ramp *) override
void | visit (const Broadcast *) override
void | visit (const Call *) 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 Acquire *) override
void | visit (const Store *) override
void | visit (const Provide *) override
void | visit (const Allocate *) override
void | visit (const Free *) override
void | visit (const Realize *) override
void | visit (const Block *) override
void | visit (const Fork *) override
void | visit (const IfThenElse *) override
void | visit (const Evaluate *) override
void | visit (const Shuffle *) override
void | visit (const VectorReduce *) override
void | visit (const Prefetch *) override
void | visit (const Atomic *) override
void | visit (const HoistedStorage *) override
virtual void | visit (const IntImm *)
virtual void | visit (const UIntImm *)
virtual void | visit (const FloatImm *)
virtual void | visit (const StringImm *)
virtual void | visit (const Cast *)
virtual void | visit (const Reinterpret *)
virtual void | visit (const Add *)
virtual void | visit (const Sub *)
virtual void | visit (const Mul *)
virtual void | visit (const Div *)
virtual void | visit (const Mod *)
virtual void | visit (const Min *)
virtual void | visit (const Max *)
virtual void | visit (const EQ *)
virtual void | visit (const NE *)
virtual void | visit (const LT *)
virtual void | visit (const LE *)
virtual void | visit (const GT *)
virtual void | visit (const GE *)
virtual void | visit (const And *)
virtual void | visit (const Or *)
virtual void | visit (const Not *)
virtual void | visit (const Select *)
virtual void | visit (const Load *)
virtual void | visit (const Ramp *)
virtual void | visit (const Broadcast *)
virtual void | visit (const Let *)
virtual void | visit (const LetStmt *)
virtual void | visit (const AssertStmt *)
virtual void | visit (const ProducerConsumer *)
virtual void | visit (const Store *)
virtual void | visit (const Provide *)
virtual void | visit (const Allocate *)
virtual void | visit (const Free *)
virtual void | visit (const Realize *)
virtual void | visit (const Block *)
virtual void | visit (const Fork *)
virtual void | visit (const IfThenElse *)
virtual void | visit (const Evaluate *)
virtual void | visit (const Call *)
virtual void | visit (const Variable *)
virtual void | visit (const For *)
virtual void | visit (const Acquire *)
virtual void | visit (const Shuffle *)
virtual void | visit (const Prefetch *)
virtual void | visit (const HoistedStorage *)
virtual void | visit (const Atomic *)
virtual void | visit (const VectorReduce *)

## Static Protected Member Functions
template<typename T >
static std::string | with_sep (const std::vector< T > &v, const std::string &sep)
template<typename T >
static std::string | with_commas (const std::vector< T > &v)

## Protected Attributes
IntegerSuffixStyle | integer_suffix_style = IntegerSuffixStyle::PlainC
| How to emit 64-bit integer constants. More...
std::string | id
| An ID for the most recently generated ssa variable. More...
Target | target
| The target being generated for. More...
OutputKind | output_kind
| Controls whether this instance is generating declarations or definitions and whether the interface us extern "C" or C++. More...
std::map< std::string, std::string > | cache
| A cache of generated values in scope. More...
std::unordered_map< std::string, std::string > | extern_function_name_map
Scope< Allocation > | allocations
| Track the types of allocations to avoid unnecessary casts. More...
Scope | heap_allocations
| Track which allocations actually went on the heap. More...
bool | have_user_context
| True if there is a void * __user_context parameter in the arguments. More...
bool | extern_c_open = false
| Track current calling convention scope. More...
bool | uses_gpu_for_loops
| True if at least one gpu-based for loop is used. More...
std::set< const halide_handle_cplusplus_type * > | forward_declared
| Track which handle types have been forward-declared already. More...
bool | inside_atomic_mutex_node = false
| Are we inside an atomic node that uses mutex locks? This is used for detecting deadlocks from nested atomics. More...
bool | emit_atomic_stores = false
| Emit atomic store instructions? More...
bool | using_vector_typedefs = false
| true if add_vector_typedefs() has been called. More...
Protected Attributes inherited from Halide::Internal::IRPrinter
std::ostream & | stream
| The stream on which we're outputting. More...
int | indent = 0
| The current indentation level, useful for pretty-printing statements. More...
bool | implicit_parens = false
| Certain expressions do not need parens around them, e.g. More...
bool | is_summary = false
| Print only a summary of a statement, with sub-statements replaced by ellipses (...). More...
bool | ansi = false
int | paren_depth = 0
const char * | ansi_hl = ""
const char * | ansi_dim = ""
const char * | ansi_kw = ""
const char * | ansi_imm_int = ""
const char * | ansi_imm_float = ""
const char * | ansi_imm_str = ""
const char * | ansi_var = ""
const char * | ansi_buf = ""
const char * | ansi_fn = ""
const char * | ansi_type = ""
const char * | ansi_reset_col = ""
const char * | ansi_reset = ""
Scope | known_type
| The symbols whose types can be inferred from values printed already. More...

## Detailed Description

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++.

Definition at line 29 of file CodeGen_C.h.

## Member Enumeration Documentation

## ◆ OutputKind

enum Halide::Internal::CodeGen_C::OutputKind

Enumerator
CHeader |
CPlusPlusHeader |
CImplementation |
CPlusPlusImplementation |
CExternDecl |
CPlusPlusExternDecl |
CPlusPlusFunctionInfoHeader |

Definition at line 31 of file CodeGen_C.h.

## ◆ IntegerSuffixStyle

enum class Halide::Internal::CodeGen_C::IntegerSuffixStyle
| strong protected

Enumerator
PlainC |
OpenCL |
HLSL |

Definition at line 60 of file CodeGen_C.h.

## ◆ AppendSpaceIfNeeded

enum Halide::Internal::CodeGen_C::AppendSpaceIfNeeded
| protected

Enumerator
DoNotAppendSpace |
AppendSpace |

Definition at line 114 of file CodeGen_C.h.

## Constructor & Destructor Documentation

## ◆ CodeGen_C()

Halide::Internal::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.

a file, or std::cout)

## ◆ ~CodeGen_C()

Halide::Internal::CodeGen_C::~CodeGen_C | ( |  | ) |
| override

## Member Function Documentation

## ◆ compile() [1/3]

void Halide::Internal::CodeGen_C::compile | ( | const Module & | module | ) |

Emit the declarations contained in the module as C code.

## ◆ get_target()

const Target & Halide::Internal::CodeGen_C::get_target | ( |  | ) | const
| inline

The target we're generating code for.

Definition at line 53 of file CodeGen_C.h.

References target.

## ◆ test()

static void Halide::Internal::CodeGen_C::test | ( |  | ) |
| static

## ◆ compile() [2/3]

void Halide::Internal::CodeGen_C::compile | ( | const LoweredFunc & | func,
|  | const MetadataNameMap & | metadata_name_map
| ) |  |
| protected

Emit a declaration.

## ◆ compile() [3/3]

void Halide::Internal::CodeGen_C::compile | ( | const Buffer<> & | buffer | ) |
| protected

## ◆ preprocess_function_body()

virtual Stmt Halide::Internal::CodeGen_C::preprocess_function_body | ( | const Stmt & | stmt | ) |
| protected virtual

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.

## ◆ print_expr()

std::string Halide::Internal::CodeGen_C::print_expr | ( | const Expr & |  | ) |
| protected

Emit an expression as an assignment, then return the id of the resulting var.

## ◆ print_cast_expr()

std::string Halide::Internal::CodeGen_C::print_cast_expr | ( | const Type & | ,
|  | const Expr & |
| ) |  |
| protected

Like print_expr, but cast the Expr to the given Type.

## ◆ print_stmt()

void Halide::Internal::CodeGen_C::print_stmt | ( | const Stmt & |  | ) |
| protected

Emit a statement.

## ◆ create_assertion() [1/2]

void Halide::Internal::CodeGen_C::create_assertion | ( | const std::string & | id_cond,
|  | const Expr & | message
| ) |  |
| protected

## ◆ create_assertion() [2/2]

void Halide::Internal::CodeGen_C::create_assertion | ( | const Expr & | cond,
|  | const Expr & | message
| ) |  |
| protected

## ◆ scalarize_vector_reduce()

Expr Halide::Internal::CodeGen_C::scalarize_vector_reduce | ( | const VectorReduce * | op | ) |
| protected

## ◆ print_type()

virtual std::string Halide::Internal::CodeGen_C::print_type | ( | Type | ,
|  | AppendSpaceIfNeeded | space_option = `DoNotAppendSpace`
| ) |  |
| protected virtual

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".)

## ◆ print_reinterpret()

virtual std::string Halide::Internal::CodeGen_C::print_reinterpret | ( | Type | ,
|  | const Expr & |
| ) |  |
| protected virtual

Emit a statement to reinterpret an expression as another type.

## ◆ print_name()

virtual std::string Halide::Internal::CodeGen_C::print_name | ( | const std::string & |  | ) |
| protected virtual

Emit a version of a string that is a valid identifier in C (.

is replaced with _)

## ◆ add_platform_prologue()

virtual void Halide::Internal::CodeGen_C::add_platform_prologue | ( |  | ) |
| protected virtual

Add platform specific prologue.

## ◆ add_vector_typedefs()

virtual void Halide::Internal::CodeGen_C::add_vector_typedefs | ( | const std::set< Type > & | vector_types | ) |
| protected virtual

Add typedefs for vector types.

Not needed for OpenCL, might use different syntax for other C-like languages.

## ◆ print_extern_call()

virtual std::string Halide::Internal::CodeGen_C::print_extern_call | ( | const Call * | op | ) |
| protected virtual

Bottleneck to allow customization of calls to generic Extern/PureExtern calls.

Reimplemented in Halide::Internal::CodeGen_GPU_C.

## ◆ print_scalarized_expr()

std::string Halide::Internal::CodeGen_C::print_scalarized_expr | ( | const Expr & | e | ) |
| protected

Convert a vector Expr into a series of scalar Exprs, then reassemble into vector of original type.

## ◆ print_assignment()

virtual std::string Halide::Internal::CodeGen_C::print_assignment | ( | Type | t,
|  | const std::string & | rhs
| ) |  |
| protected virtual

Emit an SSA-style assignment, and set id to the freshly generated name.

Return id.

## ◆ print_heap_free()

void Halide::Internal::CodeGen_C::print_heap_free | ( | const std::string & | alloc_name | ) |
| protected

Emit free for the heap allocation.

## ◆ is_header()

bool Halide::Internal::CodeGen_C::is_header | ( |  | ) |
| inline protected

Return true if only generating an interface, which may be extern "C" or C++.

Definition at line 154 of file CodeGen_C.h.

References CHeader, CPlusPlusFunctionInfoHeader, CPlusPlusHeader, and output_kind.

Referenced by is_header_or_extern_decl().

## ◆ is_extern_decl()

bool Halide::Internal::CodeGen_C::is_extern_decl | ( |  | ) |
| inline protected

Return true if only generating an interface, which may be extern "C" or C++.

Definition at line 161 of file CodeGen_C.h.

References CExternDecl, CPlusPlusExternDecl, and output_kind.

Referenced by is_header_or_extern_decl().

## ◆ is_header_or_extern_decl()

bool Halide::Internal::CodeGen_C::is_header_or_extern_decl | ( |  | ) |
| inline protected

Return true if only generating an interface, which may be extern "C" or C++.

Definition at line 167 of file CodeGen_C.h.

References is_extern_decl(), and is_header().

## ◆ is_c_plus_plus_interface()

bool Halide::Internal::CodeGen_C::is_c_plus_plus_interface | ( |  | ) |
| inline protected

Return true if generating C++ linkage.

Definition at line 172 of file CodeGen_C.h.

References CPlusPlusExternDecl, CPlusPlusFunctionInfoHeader, CPlusPlusHeader, CPlusPlusImplementation, and output_kind.

## ◆ open_scope()

void Halide::Internal::CodeGen_C::open_scope | ( |  | ) |
| protected

Open a new C scope (i.e.

throw in a brace, increase the indent)

## ◆ close_scope()

void Halide::Internal::CodeGen_C::close_scope | ( | const std::string & | comment | ) |
| protected

Close a C scope (i.e.

throw in an end brace, decrease the indent)

## ◆ forward_declare_type_if_needed()

void Halide::Internal::CodeGen_C::forward_declare_type_if_needed | ( | const Type & | t | ) |
| protected

If the Type is a handle type, emit a forward-declaration for it if we haven't already.

## ◆ set_name_mangling_mode()

void Halide::Internal::CodeGen_C::set_name_mangling_mode | ( | NameMangling | mode | ) |
| protected

## ◆ visit() [1/94]

void Halide::Internal::CodeGen_C::visit | ( | const Variable * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [2/94]

void Halide::Internal::CodeGen_C::visit | ( | const IntImm * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [3/94]

void Halide::Internal::CodeGen_C::visit | ( | const UIntImm * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [4/94]

void Halide::Internal::CodeGen_C::visit | ( | const StringImm * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [5/94]

void Halide::Internal::CodeGen_C::visit | ( | const FloatImm * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [6/94]

void Halide::Internal::CodeGen_C::visit | ( | const Cast * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [7/94]

void Halide::Internal::CodeGen_C::visit | ( | const Reinterpret * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [8/94]

void Halide::Internal::CodeGen_C::visit | ( | const Add * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [9/94]

void Halide::Internal::CodeGen_C::visit | ( | const Sub * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [10/94]

void Halide::Internal::CodeGen_C::visit | ( | const Mul * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [11/94]

void Halide::Internal::CodeGen_C::visit | ( | const Div * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [12/94]

void Halide::Internal::CodeGen_C::visit | ( | const Mod * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [13/94]

void Halide::Internal::CodeGen_C::visit | ( | const Max * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [14/94]

void Halide::Internal::CodeGen_C::visit | ( | const Min * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [15/94]

void Halide::Internal::CodeGen_C::visit | ( | const EQ * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [16/94]

void Halide::Internal::CodeGen_C::visit | ( | const NE * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [17/94]

void Halide::Internal::CodeGen_C::visit | ( | const LT * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [18/94]

void Halide::Internal::CodeGen_C::visit | ( | const LE * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [19/94]

void Halide::Internal::CodeGen_C::visit | ( | const GT * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [20/94]

void Halide::Internal::CodeGen_C::visit | ( | const GE * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [21/94]

void Halide::Internal::CodeGen_C::visit | ( | const And * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [22/94]

void Halide::Internal::CodeGen_C::visit | ( | const Or * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [23/94]

void Halide::Internal::CodeGen_C::visit | ( | const Not * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [24/94]

void Halide::Internal::CodeGen_C::visit | ( | const Call * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [25/94]

void Halide::Internal::CodeGen_C::visit | ( | const Select * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [26/94]

void Halide::Internal::CodeGen_C::visit | ( | const Load * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [27/94]

void Halide::Internal::CodeGen_C::visit | ( | const Store * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [28/94]

void Halide::Internal::CodeGen_C::visit | ( | const Let * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [29/94]

void Halide::Internal::CodeGen_C::visit | ( | const LetStmt * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [30/94]

void Halide::Internal::CodeGen_C::visit | ( | const AssertStmt * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [31/94]

void Halide::Internal::CodeGen_C::visit | ( | const ProducerConsumer * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [32/94]

void Halide::Internal::CodeGen_C::visit | ( | const For * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [33/94]

void Halide::Internal::CodeGen_C::visit | ( | const Ramp * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [34/94]

void Halide::Internal::CodeGen_C::visit | ( | const Broadcast * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [35/94]

void Halide::Internal::CodeGen_C::visit | ( | const Provide * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [36/94]

void Halide::Internal::CodeGen_C::visit | ( | const Allocate * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [37/94]

void Halide::Internal::CodeGen_C::visit | ( | const Free * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [38/94]

void Halide::Internal::CodeGen_C::visit | ( | const Realize * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [39/94]

void Halide::Internal::CodeGen_C::visit | ( | const IfThenElse * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [40/94]

void Halide::Internal::CodeGen_C::visit | ( | const Evaluate * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [41/94]

void Halide::Internal::CodeGen_C::visit | ( | const Shuffle * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [42/94]

void Halide::Internal::CodeGen_C::visit | ( | const Prefetch * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [43/94]

void Halide::Internal::CodeGen_C::visit | ( | const Fork * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [44/94]

void Halide::Internal::CodeGen_C::visit | ( | const Acquire * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [45/94]

void Halide::Internal::CodeGen_C::visit | ( | const Atomic * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [46/94]

void Halide::Internal::CodeGen_C::visit | ( | const VectorReduce * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRVisitor.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit_binop()

void Halide::Internal::CodeGen_C::visit_binop | ( | Type | t,
|  | const Expr & | a,
|  | const Expr & | b,
|  | const char * | op
| ) |  |
| protected

## ◆ visit_relop()

void Halide::Internal::CodeGen_C::visit_relop | ( | Type | t,
|  | const Expr & | a,
|  | const Expr & | b,
|  | const char * | scalar_op,
|  | const char * | vector_op
| ) |  |
| protected

## ◆ with_sep()

template<typename T >

static std::string Halide::Internal::CodeGen_C::with_sep | ( | const std::vector< T > & | v,
|  | const std::string & | sep
| ) |  |
| inline static protected

Definition at line 266 of file CodeGen_C.h.

## ◆ with_commas()

template<typename T >

static std::string Halide::Internal::CodeGen_C::with_commas | ( | const std::vector< T > & | v | ) |
| inline static protected

Definition at line 278 of file CodeGen_C.h.

## ◆ is_stack_private_to_thread()

virtual bool Halide::Internal::CodeGen_C::is_stack_private_to_thread | ( |  | ) | const
| protected virtual

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.

## ◆ emit_argv_wrapper()

void Halide::Internal::CodeGen_C::emit_argv_wrapper | ( | const std::string & | function_name,
|  | const std::vector< LoweredArgument > & | args
| ) |  |
| protected

## ◆ emit_metadata_getter()

void Halide::Internal::CodeGen_C::emit_metadata_getter | ( | const std::string & | function_name,
|  | const std::vector< LoweredArgument > & | args,
|  | const MetadataNameMap & | metadata_name_map
| ) |  |
| protected

## ◆ emit_constexpr_function_info()

void Halide::Internal::CodeGen_C::emit_constexpr_function_info | ( | const std::string & | function_name,
|  | const std::vector< LoweredArgument > & | args,
|  | const MetadataNameMap & | metadata_name_map
| ) |  |
| protected

## ◆ emit_halide_free_helper()

void Halide::Internal::CodeGen_C::emit_halide_free_helper | ( | const std::string & | alloc_name,
|  | const std::string & | free_function
| ) |  |
| protected

## ◆ visit() [47/94]

void Halide::Internal::IRPrinter::visit | ( | const IntImm * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [48/94]

void Halide::Internal::IRPrinter::visit | ( | const UIntImm * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [49/94]

void Halide::Internal::IRPrinter::visit | ( | const FloatImm * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [50/94]

void Halide::Internal::IRPrinter::visit | ( | const StringImm * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [51/94]

void Halide::Internal::IRPrinter::visit | ( | const Cast * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [52/94]

void Halide::Internal::IRPrinter::visit | ( | const Reinterpret * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [53/94]

void Halide::Internal::IRPrinter::visit | ( | const Variable * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [54/94]

void Halide::Internal::IRPrinter::visit | ( | const Add * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [55/94]

void Halide::Internal::IRPrinter::visit | ( | const Sub * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [56/94]

void Halide::Internal::IRPrinter::visit | ( | const Mul * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [57/94]

void Halide::Internal::IRPrinter::visit | ( | const Div * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [58/94]

void Halide::Internal::IRPrinter::visit | ( | const Mod * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [59/94]

void Halide::Internal::IRPrinter::visit | ( | const Min * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [60/94]

void Halide::Internal::IRPrinter::visit | ( | const Max * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [61/94]

void Halide::Internal::IRPrinter::visit | ( | const EQ * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [62/94]

void Halide::Internal::IRPrinter::visit | ( | const NE * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [63/94]

void Halide::Internal::IRPrinter::visit | ( | const LT * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [64/94]

void Halide::Internal::IRPrinter::visit | ( | const LE * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [65/94]

void Halide::Internal::IRPrinter::visit | ( | const GT * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [66/94]

void Halide::Internal::IRPrinter::visit | ( | const GE * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [67/94]

void Halide::Internal::IRPrinter::visit | ( | const And * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [68/94]

void Halide::Internal::IRPrinter::visit | ( | const Or * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [69/94]

void Halide::Internal::IRPrinter::visit | ( | const Not * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [70/94]

void Halide::Internal::IRPrinter::visit | ( | const Select * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [71/94]

void Halide::Internal::IRPrinter::visit | ( | const Load * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [72/94]

void Halide::Internal::IRPrinter::visit | ( | const Ramp * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [73/94]

void Halide::Internal::IRPrinter::visit | ( | const Broadcast * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [74/94]

void Halide::Internal::IRPrinter::visit | ( | const Call * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [75/94]

void Halide::Internal::IRPrinter::visit | ( | const Let * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [76/94]

void Halide::Internal::IRPrinter::visit | ( | const LetStmt * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [77/94]

void Halide::Internal::IRPrinter::visit | ( | const AssertStmt * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [78/94]

void Halide::Internal::IRPrinter::visit | ( | const ProducerConsumer * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [79/94]

void Halide::Internal::IRPrinter::visit | ( | const For * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [80/94]

void Halide::Internal::IRPrinter::visit | ( | const Acquire * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [81/94]

void Halide::Internal::IRPrinter::visit | ( | const Store * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [82/94]

void Halide::Internal::IRPrinter::visit | ( | const Provide * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [83/94]

void Halide::Internal::IRPrinter::visit | ( | const Allocate * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [84/94]

void Halide::Internal::IRPrinter::visit | ( | const Free * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [85/94]

void Halide::Internal::IRPrinter::visit | ( | const Realize * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [86/94]

void Halide::Internal::IRPrinter::visit | ( | const Block * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [87/94]

void Halide::Internal::IRPrinter::visit | ( | const Fork * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [88/94]

void Halide::Internal::IRPrinter::visit | ( | const IfThenElse * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [89/94]

void Halide::Internal::IRPrinter::visit | ( | const Evaluate * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [90/94]

void Halide::Internal::IRPrinter::visit | ( | const Shuffle * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [91/94]

void Halide::Internal::IRPrinter::visit | ( | const VectorReduce * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [92/94]

void Halide::Internal::IRPrinter::visit | ( | const Prefetch * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [93/94]

void Halide::Internal::IRPrinter::visit | ( | const Atomic * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C, and Halide::Internal::CodeGen_GPU_C.

## ◆ visit() [94/94]

void Halide::Internal::IRPrinter::visit | ( | const HoistedStorage * |  | ) |
| override protected virtual

Reimplemented from Halide::Internal::IRPrinter.

Reimplemented in Halide::Internal::CodeGen_GPU_C.

## Member Data Documentation

## ◆ integer_suffix_style

IntegerSuffixStyle Halide::Internal::CodeGen_C::integer_suffix_style = IntegerSuffixStyle::PlainC
| protected

How to emit 64-bit integer constants.

Definition at line 67 of file CodeGen_C.h.

## ◆ id

std::string Halide::Internal::CodeGen_C::id
| protected

An ID for the most recently generated ssa variable.

Definition at line 88 of file CodeGen_C.h.

## ◆ target

Target Halide::Internal::CodeGen_C::target
| protected

The target being generated for.

Definition at line 91 of file CodeGen_C.h.

Referenced by get_target().

## ◆ output_kind

OutputKind Halide::Internal::CodeGen_C::output_kind
| protected

Controls whether this instance is generating declarations or definitions and whether the interface us extern "C" or C++.

Definition at line 95 of file CodeGen_C.h.

Referenced by is_c_plus_plus_interface(), is_extern_decl(), and is_header().

## ◆ cache

std::map<std::string, std::string> Halide::Internal::CodeGen_C::cache
| protected

A cache of generated values in scope.

Definition at line 98 of file CodeGen_C.h.

## ◆ extern_function_name_map

std::unordered_map<std::string, std::string> Halide::Internal::CodeGen_C::extern_function_name_map
| protected

Definition at line 139 of file CodeGen_C.h.

## ◆ allocations

Scope<Allocation> Halide::Internal::CodeGen_C::allocations
| protected

Track the types of allocations to avoid unnecessary casts.

Definition at line 190 of file CodeGen_C.h.

## ◆ heap_allocations

Scope Halide::Internal::CodeGen_C::heap_allocations
| protected

Track which allocations actually went on the heap.

Definition at line 193 of file CodeGen_C.h.

## ◆ have_user_context

bool Halide::Internal::CodeGen_C::have_user_context
| protected

True if there is a void * __user_context parameter in the arguments.

Definition at line 196 of file CodeGen_C.h.

## ◆ extern_c_open

bool Halide::Internal::CodeGen_C::extern_c_open = false
| protected

Track current calling convention scope.

Definition at line 199 of file CodeGen_C.h.

## ◆ uses_gpu_for_loops

bool Halide::Internal::CodeGen_C::uses_gpu_for_loops
| protected

True if at least one gpu-based for loop is used.

Definition at line 202 of file CodeGen_C.h.

## ◆ forward_declared

std::set<const halide_handle_cplusplus_type *> Halide::Internal::CodeGen_C::forward_declared
| protected

Track which handle types have been forward-declared already.

Definition at line 205 of file CodeGen_C.h.

## ◆ inside_atomic_mutex_node

bool Halide::Internal::CodeGen_C::inside_atomic_mutex_node = false
| protected

Are we inside an atomic node that uses mutex locks? This is used for detecting deadlocks from nested atomics.

Definition at line 284 of file CodeGen_C.h.

## ◆ emit_atomic_stores

bool Halide::Internal::CodeGen_C::emit_atomic_stores = false
| protected

Emit atomic store instructions?

Definition at line 287 of file CodeGen_C.h.

## ◆ using_vector_typedefs

bool Halide::Internal::CodeGen_C::using_vector_typedefs = false
| protected

true if add_vector_typedefs() has been called.

Definition at line 290 of file CodeGen_C.h.

The documentation for this class was generated from the following file:

- src/CodeGen_C.h