Halide::Internal::CodeGen_OpenCL_Dev Class Reference

#include <CodeGen_OpenCL_Dev.h>

Inherits Halide::Internal::CodeGen_GPU_Dev.


class  CodeGen_OpenCL_C

Public Member Functions

 CodeGen_OpenCL_Dev (Target target)
void add_kernel (Stmt stmt, const std::string &name, const std::vector< DeviceArgument > &args) override
 Compile a GPU kernel into the module. More...
void init_module () override
 (Re)initialize the GPU kernel module. More...
std::vector< char > compile_to_src () override
std::string get_current_kernel_name () override
void dump () override
std::string print_gpu_name (const std::string &name) override
 Returns the specified name transformed by the variable naming rules for the GPU language backend. More...
std::string api_unique_name () override
 This routine returns the GPU API name that is combined into runtime routine names to ensure each GPU API has a unique name. More...
- Public Member Functions inherited from Halide::Internal::CodeGen_GPU_Dev
virtual ~CodeGen_GPU_Dev ()
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 routine rather than just argument type sizes. More...

Protected Attributes

std::ostringstream src_stream
std::string cur_kernel_name
CodeGen_OpenCL_C clc

Additional Inherited Members

- Public Types inherited from Halide::Internal::CodeGen_GPU_Dev
enum  MemoryFenceType { None = 0, Device = 1, Shared = 2 }
 An mask describing which type of memory fence to use for the gpu_thread_barrier() intrinsic. More...
- Static Public Member Functions inherited from Halide::Internal::CodeGen_GPU_Dev
static bool is_gpu_var (const std::string &name)
static bool is_gpu_block_var (const std::string &name)
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. More...
static bool is_buffer_constant (const Stmt &kernel, const std::string &buffer)
 Checks if the buffer is a candidate for constant storage. More...

Detailed Description

Definition at line 17 of file CodeGen_OpenCL_Dev.h.

Constructor & Destructor Documentation

◆ CodeGen_OpenCL_Dev()

Halide::Internal::CodeGen_OpenCL_Dev::CodeGen_OpenCL_Dev ( Target  target)

Member Function Documentation

◆ add_kernel()

void Halide::Internal::CodeGen_OpenCL_Dev::add_kernel ( Stmt  stmt,
const std::string &  name,
const std::vector< DeviceArgument > &  args 

Compile a GPU kernel into the module.

This may be called many times with different kernels, which will all be accumulated into a single source module shared by a given Halide pipeline.

Implements Halide::Internal::CodeGen_GPU_Dev.

◆ init_module()

void Halide::Internal::CodeGen_OpenCL_Dev::init_module ( )

(Re)initialize the GPU kernel module.

This is separate from compile, since a GPU device module will often have many kernels compiled into it for a single pipeline.

Implements Halide::Internal::CodeGen_GPU_Dev.

◆ compile_to_src()

std::vector<char> Halide::Internal::CodeGen_OpenCL_Dev::compile_to_src ( )

◆ get_current_kernel_name()

std::string Halide::Internal::CodeGen_OpenCL_Dev::get_current_kernel_name ( )

◆ dump()

void Halide::Internal::CodeGen_OpenCL_Dev::dump ( )

◆ print_gpu_name()

std::string Halide::Internal::CodeGen_OpenCL_Dev::print_gpu_name ( const std::string &  name)

Returns the specified name transformed by the variable naming rules for the GPU language backend.

Used to determine the name of a parameter during host codegen.

Implements Halide::Internal::CodeGen_GPU_Dev.

◆ api_unique_name()

std::string Halide::Internal::CodeGen_OpenCL_Dev::api_unique_name ( )

This routine returns the GPU API name that is combined into runtime routine names to ensure each GPU API has a unique name.

Implements Halide::Internal::CodeGen_GPU_Dev.

Definition at line 41 of file CodeGen_OpenCL_Dev.h.

Member Data Documentation

◆ src_stream

std::ostringstream Halide::Internal::CodeGen_OpenCL_Dev::src_stream

Definition at line 92 of file CodeGen_OpenCL_Dev.h.

◆ cur_kernel_name

std::string Halide::Internal::CodeGen_OpenCL_Dev::cur_kernel_name

Definition at line 93 of file CodeGen_OpenCL_Dev.h.

◆ clc

CodeGen_OpenCL_C Halide::Internal::CodeGen_OpenCL_Dev::clc

Definition at line 94 of file CodeGen_OpenCL_Dev.h.

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