1#ifndef HALIDE_CODEGEN_GPU_DEV_H
2#define HALIDE_CODEGEN_GPU_DEV_H
25 const std::string &name,
26 const std::vector<DeviceArgument> &args) = 0;
Defines an IRPrinter that emits C++ code equivalent to a halide stmt.
Defines helpers for passing arguments to separate devices, such as GPUs.
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
This class emits C++ code equivalent to a halide Stmt.
void visit(const Variable *) override
A base class for GPU backends that require C-like shader output.
VectorDeclarationStyle
OpenCL and WGSL use different syntax than C for immediate vectors.
void visit(const Call *op) override
CodeGen_GPU_C(std::ostream &s, Target t)
void visit(const Shuffle *op) override
VectorDeclarationStyle vector_declaration_style
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
A fragment of Halide syntax.
A code generator that emits GPU code from a given Halide stmt.
virtual void init_module()=0
(Re)initialize the GPU kernel module.
static bool is_block_uniform(const Expr &expr)
Checks if expr is block uniform, i.e.
MemoryFenceType
An mask describing which type of memory fence to use for the gpu_thread_barrier() intrinsic.
static Stmt scalarize_predicated_loads_stores(Stmt &s)
Modifies predicated loads and stores to be non-predicated, since most GPU backends do not support pre...
virtual ~CodeGen_GPU_Dev()
virtual std::string get_current_kernel_name()=0
virtual std::string print_gpu_name(const std::string &name)=0
Returns the specified name transformed by the variable naming rules for the GPU language backend.
virtual bool kernel_run_takes_types() const
Allows the GPU device specific code to request halide_type_t values to be passed to the kernel_run ro...
virtual std::vector< char > compile_to_src()=0
virtual std::string api_unique_name()=0
This routine returns the GPU API name that is combined into runtime routine names to ensure each GPU ...
static bool is_buffer_constant(const Stmt &kernel, const std::string &buffer)
Checks if the buffer is a candidate for constant storage.
virtual void add_kernel(Stmt stmt, const std::string &name, const std::vector< DeviceArgument > &args)=0
Compile a GPU kernel into the module.
Construct a new vector by taking elements from another sequence of vectors.
A reference-counted handle to a statement node.
A struct representing a target machine and os to generate code for.