All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
viennacl::scheduler Namespace Reference

Contains the scheduling functionality which allows for dynamic kernel generation as well as the fusion of multiple statements into a single kernel. More...

## Namespaces

| detail
| Implementation details for the scheduler.
| preset
| result_of
| Helper metafunctions used for the scheduler.

## Classes

struct | lhs_rhs_element
| A class representing the 'data' for the LHS or RHS operand of the respective node. More...
struct | op_element
| Struct for holding the type family as well as the type of an operation (could be addition, subtraction, norm, etc.) More...
class | statement
| The main class for representing a statement such as x = inner_prod(y,z); at runtime. More...
struct | statement_node
| Main datastructure for an node in the statement tree. More...
class | statement_not_supported_exception
| Exception for the case the scheduler is unable to deal with the operation. More...

## Enumerations

enum | operation_node_type_family { OPERATION_INVALID_TYPE_FAMILY = 0, OPERATION_UNARY_TYPE_FAMILY, OPERATION_BINARY_TYPE_FAMILY, OPERATION_VECTOR_REDUCTION_TYPE_FAMILY, OPERATION_ROWS_REDUCTION_TYPE_FAMILY, OPERATION_COLUMNS_REDUCTION_TYPE_FAMILY }
| Optimization enum for grouping operations into unary or binary operations. Just for optimization of lookups. More...

enum

operation_node_type {
OPERATION_INVALID_TYPE = 0, OPERATION_UNARY_MINUS_TYPE, OPERATION_UNARY_CAST_CHAR_TYPE, OPERATION_UNARY_CAST_UCHAR_TYPE,
OPERATION_UNARY_CAST_SHORT_TYPE, OPERATION_UNARY_CAST_USHORT_TYPE, OPERATION_UNARY_CAST_INT_TYPE, OPERATION_UNARY_CAST_UINT_TYPE,
OPERATION_UNARY_CAST_LONG_TYPE, OPERATION_UNARY_CAST_ULONG_TYPE, OPERATION_UNARY_CAST_HALF_TYPE, OPERATION_UNARY_CAST_FLOAT_TYPE,
OPERATION_UNARY_CAST_DOUBLE_TYPE, OPERATION_UNARY_ABS_TYPE, OPERATION_UNARY_ACOS_TYPE, OPERATION_UNARY_ASIN_TYPE,
OPERATION_UNARY_ATAN_TYPE, OPERATION_UNARY_CEIL_TYPE, OPERATION_UNARY_COS_TYPE, OPERATION_UNARY_COSH_TYPE,
OPERATION_UNARY_EXP_TYPE, OPERATION_UNARY_FABS_TYPE, OPERATION_UNARY_FLOOR_TYPE, OPERATION_UNARY_LOG_TYPE,
OPERATION_UNARY_LOG10_TYPE, OPERATION_UNARY_SIN_TYPE, OPERATION_UNARY_SINH_TYPE, OPERATION_UNARY_SQRT_TYPE,
OPERATION_UNARY_TAN_TYPE, OPERATION_UNARY_TANH_TYPE, OPERATION_UNARY_TRANS_TYPE, OPERATION_UNARY_NORM_1_TYPE,
OPERATION_UNARY_NORM_2_TYPE, OPERATION_UNARY_NORM_INF_TYPE, OPERATION_UNARY_MAX_TYPE, OPERATION_UNARY_MIN_TYPE,
OPERATION_BINARY_ACCESS_TYPE, OPERATION_BINARY_ASSIGN_TYPE, OPERATION_BINARY_INPLACE_ADD_TYPE, OPERATION_BINARY_INPLACE_SUB_TYPE,
OPERATION_BINARY_ADD_TYPE, OPERATION_BINARY_SUB_TYPE, OPERATION_BINARY_MULT_TYPE, OPERATION_BINARY_DIV_TYPE,
OPERATION_BINARY_ELEMENT_ARGFMAX_TYPE, OPERATION_BINARY_ELEMENT_ARGFMIN_TYPE, OPERATION_BINARY_ELEMENT_ARGMAX_TYPE, OPERATION_BINARY_ELEMENT_ARGMIN_TYPE,
OPERATION_BINARY_ELEMENT_PROD_TYPE, OPERATION_BINARY_ELEMENT_DIV_TYPE, OPERATION_BINARY_ELEMENT_EQ_TYPE, OPERATION_BINARY_ELEMENT_NEQ_TYPE,
OPERATION_BINARY_ELEMENT_GREATER_TYPE, OPERATION_BINARY_ELEMENT_GEQ_TYPE, OPERATION_BINARY_ELEMENT_LESS_TYPE, OPERATION_BINARY_ELEMENT_LEQ_TYPE,
OPERATION_BINARY_ELEMENT_POW_TYPE, OPERATION_BINARY_ELEMENT_FMAX_TYPE, OPERATION_BINARY_ELEMENT_FMIN_TYPE, OPERATION_BINARY_ELEMENT_MAX_TYPE,
OPERATION_BINARY_ELEMENT_MIN_TYPE, OPERATION_BINARY_MATRIX_DIAG_TYPE, OPERATION_BINARY_VECTOR_DIAG_TYPE, OPERATION_BINARY_MATRIX_ROW_TYPE,
OPERATION_BINARY_MATRIX_COLUMN_TYPE, OPERATION_BINARY_MAT_VEC_PROD_TYPE, OPERATION_BINARY_MAT_MAT_PROD_TYPE, OPERATION_BINARY_INNER_PROD_TYPE
}

| Enumeration for identifying the possible operations. More...
enum | statement_node_type_family { INVALID_TYPE_FAMILY = 0, COMPOSITE_OPERATION_FAMILY, SCALAR_TYPE_FAMILY, VECTOR_TYPE_FAMILY, MATRIX_TYPE_FAMILY }
| Groups the type of a node in the statement tree. Used for faster dispatching. More...
enum | statement_node_subtype { INVALID_SUBTYPE = 0, HOST_SCALAR_TYPE, DEVICE_SCALAR_TYPE, DENSE_VECTOR_TYPE, IMPLICIT_VECTOR_TYPE, DENSE_MATRIX_TYPE, IMPLICIT_MATRIX_TYPE, COMPRESSED_MATRIX_TYPE, COORDINATE_MATRIX_TYPE, ELL_MATRIX_TYPE, HYB_MATRIX_TYPE }
| Encodes the type of a node in the statement tree. More...
enum | statement_node_numeric_type { INVALID_NUMERIC_TYPE = 0, CHAR_TYPE, UCHAR_TYPE, SHORT_TYPE, USHORT_TYPE, INT_TYPE, UINT_TYPE, LONG_TYPE, ULONG_TYPE, HALF_TYPE, FLOAT_TYPE, DOUBLE_TYPE }
| Encodes the type of a node in the statement tree. More...

## Functions

void | execute (statement const &s)
void | execute_element_composite (statement const &s, statement_node const &root_node)
| Deals with x = RHS where RHS is a vector expression. More...
void | execute_matrix_prod (statement const &s, statement_node const &root_node)
void | execute_scalar_assign_composite (statement const &s, statement_node const &root_node)
| Deals with x = RHS where RHS is a vector expression. More...
std::ostream & | operator<< (std::ostream &os, viennacl::scheduler::statement_node const &s_node)
| Print a single statement_node. Non-recursive. More...
std::ostream & | operator<< (std::ostream &os, viennacl::scheduler::statement const &s)
| Writes a string identifying the scheduler statement to an output stream. More...

## Detailed Description

Contains the scheduling functionality which allows for dynamic kernel generation as well as the fusion of multiple statements into a single kernel.

## Enumeration Type Documentation

enum viennacl::scheduler::operation_node_type

Enumeration for identifying the possible operations.

Enumerator
OPERATION_INVALID_TYPE |
OPERATION_UNARY_MINUS_TYPE |
OPERATION_UNARY_CAST_CHAR_TYPE |
OPERATION_UNARY_CAST_UCHAR_TYPE |
OPERATION_UNARY_CAST_SHORT_TYPE |
OPERATION_UNARY_CAST_USHORT_TYPE |
OPERATION_UNARY_CAST_INT_TYPE |
OPERATION_UNARY_CAST_UINT_TYPE |
OPERATION_UNARY_CAST_LONG_TYPE |
OPERATION_UNARY_CAST_ULONG_TYPE |
OPERATION_UNARY_CAST_HALF_TYPE |
OPERATION_UNARY_CAST_FLOAT_TYPE |
OPERATION_UNARY_CAST_DOUBLE_TYPE |
OPERATION_UNARY_ABS_TYPE |
OPERATION_UNARY_ACOS_TYPE |
OPERATION_UNARY_ASIN_TYPE |
OPERATION_UNARY_ATAN_TYPE |
OPERATION_UNARY_CEIL_TYPE |
OPERATION_UNARY_COS_TYPE |
OPERATION_UNARY_COSH_TYPE |
OPERATION_UNARY_EXP_TYPE |
OPERATION_UNARY_FABS_TYPE |
OPERATION_UNARY_FLOOR_TYPE |
OPERATION_UNARY_LOG_TYPE |
OPERATION_UNARY_LOG10_TYPE |
OPERATION_UNARY_SIN_TYPE |
OPERATION_UNARY_SINH_TYPE |
OPERATION_UNARY_SQRT_TYPE |
OPERATION_UNARY_TAN_TYPE |
OPERATION_UNARY_TANH_TYPE |
OPERATION_UNARY_TRANS_TYPE |
OPERATION_UNARY_NORM_1_TYPE |
OPERATION_UNARY_NORM_2_TYPE |
OPERATION_UNARY_NORM_INF_TYPE |
OPERATION_UNARY_MAX_TYPE |
OPERATION_UNARY_MIN_TYPE |
OPERATION_BINARY_ACCESS_TYPE |
OPERATION_BINARY_ASSIGN_TYPE |
OPERATION_BINARY_INPLACE_ADD_TYPE |
OPERATION_BINARY_INPLACE_SUB_TYPE |
OPERATION_BINARY_ADD_TYPE |
OPERATION_BINARY_SUB_TYPE |
OPERATION_BINARY_MULT_TYPE |
OPERATION_BINARY_DIV_TYPE |
OPERATION_BINARY_ELEMENT_ARGFMAX_TYPE |
OPERATION_BINARY_ELEMENT_ARGFMIN_TYPE |
OPERATION_BINARY_ELEMENT_ARGMAX_TYPE |
OPERATION_BINARY_ELEMENT_ARGMIN_TYPE |
OPERATION_BINARY_ELEMENT_PROD_TYPE |
OPERATION_BINARY_ELEMENT_DIV_TYPE |
OPERATION_BINARY_ELEMENT_EQ_TYPE |
OPERATION_BINARY_ELEMENT_NEQ_TYPE |
OPERATION_BINARY_ELEMENT_GREATER_TYPE |
OPERATION_BINARY_ELEMENT_GEQ_TYPE |
OPERATION_BINARY_ELEMENT_LESS_TYPE |
OPERATION_BINARY_ELEMENT_LEQ_TYPE |
OPERATION_BINARY_ELEMENT_POW_TYPE |
OPERATION_BINARY_ELEMENT_FMAX_TYPE |
OPERATION_BINARY_ELEMENT_FMIN_TYPE |
OPERATION_BINARY_ELEMENT_MAX_TYPE |
OPERATION_BINARY_ELEMENT_MIN_TYPE |
OPERATION_BINARY_MATRIX_DIAG_TYPE |
OPERATION_BINARY_VECTOR_DIAG_TYPE |
OPERATION_BINARY_MATRIX_ROW_TYPE |
OPERATION_BINARY_MATRIX_COLUMN_TYPE |
OPERATION_BINARY_MAT_VEC_PROD_TYPE |
OPERATION_BINARY_MAT_MAT_PROD_TYPE |
OPERATION_BINARY_INNER_PROD_TYPE |

Definition at line 68 of file forwards.h.

enum viennacl::scheduler::operation_node_type_family

Optimization enum for grouping operations into unary or binary operations. Just for optimization of lookups.

Enumerator
OPERATION_INVALID_TYPE_FAMILY |
OPERATION_UNARY_TYPE_FAMILY |
OPERATION_BINARY_TYPE_FAMILY |
OPERATION_VECTOR_REDUCTION_TYPE_FAMILY |
OPERATION_ROWS_REDUCTION_TYPE_FAMILY |
OPERATION_COLUMNS_REDUCTION_TYPE_FAMILY |

Definition at line 53 of file forwards.h.

enum viennacl::scheduler::statement_node_numeric_type

Encodes the type of a node in the statement tree.

Enumerator
INVALID_NUMERIC_TYPE |
CHAR_TYPE |
UCHAR_TYPE |
SHORT_TYPE |
USHORT_TYPE |
INT_TYPE |
UINT_TYPE |
LONG_TYPE |
ULONG_TYPE |
HALF_TYPE |
FLOAT_TYPE |
DOUBLE_TYPE |

Definition at line 286 of file forwards.h.

enum viennacl::scheduler::statement_node_subtype

Encodes the type of a node in the statement tree.

Enumerator
INVALID_SUBTYPE |
HOST_SCALAR_TYPE |
DEVICE_SCALAR_TYPE |
DENSE_VECTOR_TYPE |
IMPLICIT_VECTOR_TYPE |
DENSE_MATRIX_TYPE |
IMPLICIT_MATRIX_TYPE |
COMPRESSED_MATRIX_TYPE |
COORDINATE_MATRIX_TYPE |
ELL_MATRIX_TYPE |
HYB_MATRIX_TYPE |

Definition at line 264 of file forwards.h.

enum viennacl::scheduler::statement_node_type_family

Groups the type of a node in the statement tree. Used for faster dispatching.

Enumerator
INVALID_TYPE_FAMILY |
COMPOSITE_OPERATION_FAMILY |
SCALAR_TYPE_FAMILY |
VECTOR_TYPE_FAMILY |
MATRIX_TYPE_FAMILY |

Definition at line 246 of file forwards.h.

## Function Documentation

void viennacl::scheduler::execute | ( | statement const & | s | ) |

inline

Examples:
  scheduler.cpp.

Definition at line 279 of file execute.hpp.

void viennacl::scheduler::execute_element_composite | ( | statement const & | s,
|  | statement_node const & | root_node
| ) |  |

inline

Deals with x = RHS where RHS is a vector expression.

Definition at line 334 of file execute_elementwise.hpp.

void viennacl::scheduler::execute_matrix_prod | ( | statement const & | s,
|  | statement_node const & | root_node
| ) |  |

inline

Definition at line 300 of file execute_matrix_prod.hpp.

void viennacl::scheduler::execute_scalar_assign_composite | ( | statement const & | s,
|  | statement_node const & | root_node
| ) |  |

inline

Deals with x = RHS where RHS is a vector expression.

Definition at line 37 of file execute_scalar_assign.hpp.

std::ostream& viennacl::scheduler::operator<< | ( | std::ostream & | os,
|  | viennacl::scheduler::statement_node const & | s_node
| ) |  |

inline

Print a single statement_node. Non-recursive.

Definition at line 219 of file io.hpp.

std::ostream& viennacl::scheduler::operator<< | ( | std::ostream & | os,
|  | viennacl::scheduler::statement const & | s
| ) |  |

inline

Writes a string identifying the scheduler statement to an output stream.

Typically used for debugging

Parameters

  os | The output stream
  s | The statement object

Definition at line 258 of file io.hpp.