Go to the documentation of this file. 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;
37 virtual void dump() = 0;
58 static bool is_gpu_var(
const std::string &name);
virtual ~CodeGen_GPU_Dev()
void visit(const Variable *) override
static bool is_gpu_var(const std::string &name)
static bool is_gpu_block_var(const std::string &name)
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.
A reference-counted handle to a statement node.
This class emits C++ code equivalent to a halide Stmt.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
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 ...
MemoryFenceType
An mask describing which type of memory fence to use for the gpu_thread_barrier() intrinsic.
@ Internal
Not visible externally, similar to 'static' linkage in C.
A code generator that emits GPU code from a given Halide stmt.
virtual void add_kernel(Stmt stmt, const std::string &name, const std::vector< DeviceArgument > &args)=0
Compile a GPU kernel into the module.
static bool is_gpu_thread_var(const std::string &name)
static bool is_block_uniform(const Expr &expr)
Checks if expr is block uniform, i.e.
A base class for GPU backends that require C-like shader output.
CodeGen_GPU_C(std::ostream &s, Target t)
VectorDeclarationStyle
OpenCL and WGSL use different syntax than C for immediate vectors.
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 std::vector< char > compile_to_src()=0
static bool is_buffer_constant(const Stmt &kernel, const std::string &buffer)
Checks if the buffer is a candidate for constant storage.
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...
A fragment of Halide syntax.
Construct a new vector by taking elements from another sequence of vectors.
virtual std::string get_current_kernel_name()=0
virtual void init_module()=0
(Re)initialize the GPU kernel module.
void visit(const Shuffle *op) override
A struct representing a target machine and os to generate code for.
VectorDeclarationStyle vector_declaration_style