ViennaCL - The Vienna Computing Library  1.5.0
Namespaces | Data Structures | Typedefs | Enumerations | Functions
viennacl::generator Namespace Reference

Provides an OpenCL kernel generator. More...

Namespaces

namespace  autotune
 

Provides the implementation for tuning the kernels for a particular device.


namespace  detail
 

Contains implementation details of the kernel generator.


namespace  profiles
 

Namespace holding the various device-specific parameters for generating the best kernels.


namespace  utils
 

Contains various helper routines for kernel generation.


Data Structures

struct  expression_descriptor
 A class for holding meta information such as the type or the underlying scalar type of an expression (such as x = inner_prod(y, z)). More...
class  code_generator
 Class for handling code generation. More...
class  matrix_product
 Kernel generation class for matrix-matrix products. More...
class  profile_base
 Base class for an operation profile. More...
class  vector_saxpy
 OpenCL kernel generation class for vector expressions of AXPY type, i.e. x = alpha * y + beta * z, where the number of summands can in principle be arbitrarily large. More...
class  matrix_saxpy
 OpenCL kernel generation class for matrix expressions of AXPY type, i.e. A = alpha * B + beta * C, where the number of summands can in principle be arbitrarily large. More...
class  scalar_reduction
 OpenCL kernel generation template for scalar reduction operations such as s = norm_2(x). More...
class  vector_reduction
 OpenCL kernel template for reductions resulting in a vector. Example: Computing the row norms of a matrix concurrently. More...

Typedefs

typedef std::pair
< expression_type, vcl_size_t
expression_key_type

Enumerations

enum  expression_type_family {
  SCALAR_SAXPY_FAMILY, VECTOR_SAXPY_FAMILY, MATRIX_SAXPY_FAMILY, SCALAR_REDUCE_FAMILY,
  VECTOR_REDUCE_FAMILY, MATRIX_PRODUCT_FAMILY, INVALID_EXPRESSION_FAMILY
}
enum  expression_type {
  SCALAR_SAXPY_TYPE, VECTOR_SAXPY_TYPE, MATRIX_SAXPY_TYPE, SCALAR_REDUCE_TYPE,
  VECTOR_REDUCE_Nx_TYPE, VECTOR_REDUCE_Tx_TYPE, MATRIX_PRODUCT_NN_TYPE, MATRIX_PRODUCT_TN_TYPE,
  MATRIX_PRODUCT_NT_TYPE, MATRIX_PRODUCT_TT_TYPE, INVALID_EXPRESSION_TYPE
}

Functions

void generate_enqueue_statement (viennacl::scheduler::statement const &s, scheduler::statement_node const &root_node)
 Generate and enqueue a statement plus root_node into the current queue.
void generate_enqueue_statement (viennacl::scheduler::statement const &s)
 Generate and enqueue a statement into the current queue, assumes the root_node is the first node of the statement.
const char * expression_type_to_string (expression_type type)
template<typename KeyT , typename ValueT >
ValueT const & at (std::map< KeyT, ValueT > const &map, KeyT const &key)
 Emulation of C++11's .at() member for std::map<>
viennacl::ocl::programget_configured_program (viennacl::generator::code_generator const &generator, std::list< viennacl::ocl::kernel * > &kernels, bool force_recompilation=false)
 Creates the program associated with a generator object and fills the kernels. Checks the context for the program and possibly (re)compile it.
void enqueue (viennacl::generator::code_generator const &generator, bool force_recompilation=false)
 Set the arguments and enqueue a generator object.
std::string get_opencl_program_string (viennacl::scheduler::statement const &s)
 Convenience function to get the OpenCL program string for a single statement.
std::string get_cuda_device_code (viennacl::scheduler::statement const &s)
 Convenience function to get the CUDA device code for a single statement.
std::ostream & operator<< (std::ostream &os, profile_base const &profile)
void enqueue_custom_op (viennacl::generator::custom_operation &op, viennacl::ocl::command_queue const &queue)

Detailed Description

Provides an OpenCL kernel generator.


Typedef Documentation


Enumeration Type Documentation

Enumerator:
SCALAR_SAXPY_TYPE 
VECTOR_SAXPY_TYPE 
MATRIX_SAXPY_TYPE 
SCALAR_REDUCE_TYPE 
VECTOR_REDUCE_Nx_TYPE 
VECTOR_REDUCE_Tx_TYPE 
MATRIX_PRODUCT_NN_TYPE 
MATRIX_PRODUCT_TN_TYPE 
MATRIX_PRODUCT_NT_TYPE 
MATRIX_PRODUCT_TT_TYPE 
INVALID_EXPRESSION_TYPE 
Enumerator:
SCALAR_SAXPY_FAMILY 
VECTOR_SAXPY_FAMILY 
MATRIX_SAXPY_FAMILY 
SCALAR_REDUCE_FAMILY 
VECTOR_REDUCE_FAMILY 
MATRIX_PRODUCT_FAMILY 
INVALID_EXPRESSION_FAMILY 

Function Documentation

ValueT const& viennacl::generator::at ( std::map< KeyT, ValueT > const &  map,
KeyT const &  key 
)

Emulation of C++11's .at() member for std::map<>

void viennacl::generator::enqueue ( viennacl::generator::code_generator const &  generator,
bool  force_recompilation = false 
) [inline]

Set the arguments and enqueue a generator object.

void viennacl::generator::enqueue_custom_op ( viennacl::generator::custom_operation &  op,
viennacl::ocl::command_queue const &  queue 
)
const char* viennacl::generator::expression_type_to_string ( expression_type  type) [inline]
void generate_enqueue_statement ( viennacl::scheduler::statement const &  s,
scheduler::statement_node const &  root_node 
) [inline]

Generate and enqueue a statement plus root_node into the current queue.

Generate and enqueue a statement into the current queue, assumes the root_node is the first node of the statement.

viennacl::ocl::program& viennacl::generator::get_configured_program ( viennacl::generator::code_generator const &  generator,
std::list< viennacl::ocl::kernel * > &  kernels,
bool  force_recompilation = false 
) [inline]

Creates the program associated with a generator object and fills the kernels. Checks the context for the program and possibly (re)compile it.

Parameters:
generatorthe generator to work on
kernelsthis list will be filled with the kernels associated with the generator
force_recompilationif true, the program will be recompiled

Convenience function to get the CUDA device code for a single statement.

Convenience function to get the OpenCL program string for a single statement.

std::ostream& viennacl::generator::operator<< ( std::ostream &  os,
profile_base const &  profile 
) [inline]