ViennaCL - The Vienna Computing Library  1.5.1
Public Types | Public Member Functions
code_generator Class Reference

Class for handling code generation. More...

#include <generate.hpp>

Public Types

typedef std::pair
< expression_type, vcl_size_t
forced_profile_key_type
 typedef of the key used in the forced profiles. Contains the expression type and the size of the scalartype More...
 

Public Member Functions

 code_generator (viennacl::ocl::context const &ctx=viennacl::ocl::current_context())
 The constructor. More...
 
template<class T >
void force_profile (forced_profile_key_type key, T const &t)
 Force the generator to use a specific profile for an operation. More...
 
bool add (scheduler::statement const &statement, scheduler::statement_node const &root_node)
 Add a statement and the root node to the expression list. More...
 
void configure_program (viennacl::ocl::program &p, std::list< viennacl::ocl::kernel * > &kernels) const
 Set the arguments for a program previously generated by the generator and fills the kernels. More...
 
void make_program_name (char *program_name) const
 Creates an identifier string for the set of expressions in the object. More...
 
std::string make_opencl_program_string () const
 Creates the OpenCL program string from the set of expressions in the object. More...
 
std::string make_cuda_program_string () const
 Creates the CUDA device code from the set of expressions in the object. More...
 

Detailed Description

Class for handling code generation.

It is meant to be only used along with the scheduler.

Member Typedef Documentation

typedef of the key used in the forced profiles. Contains the expression type and the size of the scalartype

Constructor & Destructor Documentation

The constructor.

Member Function Documentation

bool add ( scheduler::statement const &  statement,
scheduler::statement_node const &  root_node 
)
inline

Add a statement and the root node to the expression list.

Returns
Whether or not the operation could be handled by the generator
void configure_program ( viennacl::ocl::program p,
std::list< viennacl::ocl::kernel * > &  kernels 
) const
inline

Set the arguments for a program previously generated by the generator and fills the kernels.

void force_profile ( forced_profile_key_type  key,
T const &  t 
)
inline

Force the generator to use a specific profile for an operation.

std::string make_cuda_program_string ( ) const
inline

Creates the CUDA device code from the set of expressions in the object.

Performs just a direct translation...

std::string make_opencl_program_string ( ) const
inline

Creates the OpenCL program string from the set of expressions in the object.

void make_program_name ( char *  program_name) const
inline

Creates an identifier string for the set of expressions in the object.


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