Halide 18.0.0
Halide compiler and libraries
|
A base class for GPU backends that require C-like shader output. More...
#include <CodeGen_GPU_Dev.h>
Public Types | |
enum class | VectorDeclarationStyle { CLikeSyntax = 0 , OpenCLSyntax = 1 , WGSLSyntax = 2 } |
OpenCL and WGSL use different syntax than C for immediate vectors. More... | |
![]() | |
enum | OutputKind { CHeader , CPlusPlusHeader , CImplementation , CPlusPlusImplementation , CExternDecl , CPlusPlusExternDecl , CPlusPlusFunctionInfoHeader } |
Public Member Functions | |
CodeGen_GPU_C (std::ostream &s, Target t) | |
![]() | |
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. | |
~CodeGen_C () override | |
void | compile (const Module &module) |
Emit the declarations contained in the module as C code. | |
const Target & | get_target () const |
The target we're generating code for. | |
![]() | |
IRPrinter (std::ostream &) | |
Construct an IRPrinter pointed at a given output stream (e.g. | |
void | print (const Expr &) |
emit an expression on the output stream | |
void | print_no_parens (const Expr &) |
Emit an expression on the output stream without enclosing parens. | |
void | print (const Stmt &) |
emit a statement on the output stream | |
void | print_list (const std::vector< Expr > &exprs) |
emit a comma delimited list of exprs, without any leading or trailing punctuation. | |
![]() | |
IRVisitor ()=default | |
virtual | ~IRVisitor ()=default |
Protected Attributes | |
VectorDeclarationStyle | vector_declaration_style = VectorDeclarationStyle::CLikeSyntax |
![]() | |
IntegerSuffixStyle | integer_suffix_style = IntegerSuffixStyle::PlainC |
How to emit 64-bit integer constants. | |
std::string | id |
An ID for the most recently generated ssa variable. | |
Target | target |
The target being generated for. | |
OutputKind | output_kind |
Controls whether this instance is generating declarations or definitions and whether the interface us extern "C" or C++. | |
std::map< std::string, std::string > | cache |
A cache of generated values in scope. | |
Scope< Allocation > | allocations |
Track the types of allocations to avoid unnecessary casts. | |
Scope | heap_allocations |
Track which allocations actually went on the heap. | |
bool | have_user_context |
True if there is a void * __user_context parameter in the arguments. | |
bool | extern_c_open = false |
Track current calling convention scope. | |
bool | uses_gpu_for_loops |
True if at least one gpu-based for loop is used. | |
std::set< const halide_handle_cplusplus_type * > | forward_declared |
Track which handle types have been forward-declared already. | |
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. | |
bool | emit_atomic_stores = false |
Emit atomic store instructions? | |
bool | using_vector_typedefs = false |
true if add_vector_typedefs() has been called. | |
![]() | |
std::ostream & | stream |
The stream on which we're outputting. | |
int | indent = 0 |
The current indentation level, useful for pretty-printing statements. | |
bool | implicit_parens = false |
Certain expressions do not need parens around them, e.g. | |
Scope | known_type |
The symbols whose types can be inferred from values printed already. | |
Additional Inherited Members | |
![]() | |
static void | test () |
![]() | |
static void | test () |
![]() | |
enum class | IntegerSuffixStyle { PlainC = 0 , OpenCL = 1 , HLSL = 2 } |
enum | AppendSpaceIfNeeded { DoNotAppendSpace , AppendSpace } |
![]() | |
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) |
A base class for GPU backends that require C-like shader output.
GPU backends derive from and specialize this class.
Definition at line 84 of file CodeGen_GPU_Dev.h.
OpenCL and WGSL use different syntax than C for immediate vectors.
This enum defines which style should be used by the backend.
Enumerator | |
---|---|
CLikeSyntax | |
OpenCLSyntax | |
WGSLSyntax |
Definition at line 88 of file CodeGen_GPU_Dev.h.
|
inline |
Definition at line 94 of file CodeGen_GPU_Dev.h.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::CodeGen_C.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::CodeGen_C.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
Reimplemented from Halide::Internal::CodeGen_C.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::CodeGen_C.
|
protected |
Definition at line 103 of file CodeGen_GPU_Dev.h.