ViennaCL - The Vienna Computing Library  1.5.2
Namespaces | Macros | Functions
execute_matrix_prod.hpp File Reference

Deals with matrix-vector and matrix-matrix products. More...

#include "viennacl/forwards.h"
#include "viennacl/scheduler/forwards.h"
#include "viennacl/scheduler/execute_util.hpp"
#include "viennacl/scheduler/execute_generic_dispatcher.hpp"
#include "viennacl/linalg/vector_operations.hpp"
#include "viennacl/linalg/matrix_operations.hpp"
#include "viennacl/linalg/sparse_matrix_operations.hpp"
#include "viennacl/compressed_matrix.hpp"
#include "viennacl/coordinate_matrix.hpp"
#include "viennacl/ell_matrix.hpp"
#include "viennacl/hyb_matrix.hpp"

Go to the source code of this file.

Namespaces

 viennacl
 Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
 
 viennacl::scheduler
 Contains the scheduling functionality which allows for dynamic kernel generation as well as the fusion of multiple statements into a single kernel.
 
 viennacl::scheduler::detail
 Implementation details for the scheduler.
 

Macros

#define VIENNACL_SCHEDULER_GENERATE_MATRIX_MATRIX_PROD(LAYOUTA, MEMBERA, LAYOUTB, MEMBERB, LAYOUTC, MEMBERC)
 
#define VIENNACL_SCHEDULER_GENERATE_MATRIX_MATRIX_PROD(LAYOUTA, MEMBERA, LAYOUTB, MEMBERB, MAJORB, LAYOUTC, MEMBERC)
 
#define VIENNACL_SCHEDULER_GENERATE_MATRIX_MATRIX_PROD(LAYOUTA, MEMBERA, MAJORA, LAYOUTB, MEMBERB, LAYOUTC, MEMBERC)
 
#define VIENNACL_SCHEDULER_GENERATE_MATRIX_MATRIX_PROD(LAYOUTA, MEMBERA, MAJORA, LAYOUTB, MEMBERB, MAJORB, LAYOUTC, MEMBERC)
 

Functions

bool matrix_prod_temporary_required (statement const &s, lhs_rhs_element const &elem)
 
void matrix_matrix_prod (statement const &s, lhs_rhs_element result, lhs_rhs_element const &A, lhs_rhs_element const &B, double alpha, double beta)
 
void matrix_vector_prod (statement const &s, lhs_rhs_element result, lhs_rhs_element const &A, lhs_rhs_element const &x)
 
void execute_matrix_prod (statement const &s, statement_node const &root_node)
 

Detailed Description

Deals with matrix-vector and matrix-matrix products.

Macro Definition Documentation

#define VIENNACL_SCHEDULER_GENERATE_MATRIX_MATRIX_PROD (   LAYOUTA,
  MEMBERA,
  LAYOUTB,
  MEMBERB,
  LAYOUTC,
  MEMBERC 
)
Value:
if (A.subtype == LAYOUTA && B.subtype == LAYOUTB && result.subtype == LAYOUTC)\
{\
switch (result.numeric_type)\
{\
viennacl::linalg::prod_impl(*A.matrix_##MEMBERA##_float, *B.matrix_##MEMBERB##_float, *result.matrix_##MEMBERC##_float, static_cast<float>(alpha), static_cast<float>(beta)); break;\
viennacl::linalg::prod_impl(*A.matrix_##MEMBERA##_double, *B.matrix_##MEMBERB##_double, *result.matrix_##MEMBERC##_double, alpha, beta); break;\
default:\
throw statement_not_supported_exception("Invalid numeric type in matrix-matrix multiplication");\
}\
}
Definition: forwards.h:217
void prod_impl(const matrix_base< NumericT, F > &mat, const vector_base< NumericT > &vec, vector_base< NumericT > &result)
Carries out matrix-vector multiplication.
Definition: matrix_operations.hpp:350
Definition: forwards.h:216
#define VIENNACL_SCHEDULER_GENERATE_MATRIX_MATRIX_PROD (   LAYOUTA,
  MEMBERA,
  LAYOUTB,
  MEMBERB,
  MAJORB,
  LAYOUTC,
  MEMBERC 
)
Value:
if (A.subtype == LAYOUTA && leaf.lhs.subtype == LAYOUTB && result.subtype == LAYOUTC)\
{\
switch (result.numeric_type)\
{\
viennacl::linalg::prod_impl(*A.matrix_##MEMBERA##_float, \
viennacl::matrix_expression< const matrix_base<float, MAJORB>,\
const matrix_base<float, MAJORB>,\
op_trans> (*(leaf.lhs.matrix_##MEMBERB##_float), *(leaf.lhs.matrix_##MEMBERB##_float)), \
*result.matrix_##MEMBERC##_float, static_cast<float>(alpha), static_cast<float>(beta)); break;\
viennacl::linalg::prod_impl(*A.matrix_##MEMBERA##_double,\
viennacl::matrix_expression< const matrix_base<double, MAJORB>,\
const matrix_base<double, MAJORB>,\
op_trans>(*(leaf.lhs.matrix_##MEMBERB##_double), *(leaf.lhs.matrix_##MEMBERB##_double)), \
*result.matrix_##MEMBERC##_double, alpha, beta); break;\
default:\
throw statement_not_supported_exception("Invalid numeric type in matrix-matrix multiplication");\
}\
}
Definition: forwards.h:217
Expression template class for representing a tree of expressions which ultimately result in a matrix...
Definition: forwards.h:283
void prod_impl(const matrix_base< NumericT, F > &mat, const vector_base< NumericT > &vec, vector_base< NumericT > &result)
Carries out matrix-vector multiplication.
Definition: matrix_operations.hpp:350
Definition: forwards.h:216
#define VIENNACL_SCHEDULER_GENERATE_MATRIX_MATRIX_PROD (   LAYOUTA,
  MEMBERA,
  MAJORA,
  LAYOUTB,
  MEMBERB,
  LAYOUTC,
  MEMBERC 
)
Value:
if (leaf.lhs.subtype == LAYOUTA && B.subtype == LAYOUTB && result.subtype == LAYOUTC)\
{\
switch (result.numeric_type)\
{\
viennacl::linalg::prod_impl(viennacl::matrix_expression< const matrix_base<float, MAJORA>,\
const matrix_base<float, MAJORA>,\
op_trans>(*leaf.lhs.matrix_##MEMBERA##_float, *leaf.lhs.matrix_##MEMBERA##_float), \
*B.matrix_##MEMBERB##_float,\
*result.matrix_##MEMBERC##_float, static_cast<float>(alpha), static_cast<float>(beta)); break;\
viennacl::linalg::prod_impl(viennacl::matrix_expression< const matrix_base<double, MAJORA>,\
const matrix_base<double, MAJORA>,\
op_trans>(*leaf.lhs.matrix_##MEMBERA##_double, *leaf.lhs.matrix_##MEMBERA##_double), \
*B.matrix_##MEMBERB##_double,\
*result.matrix_##MEMBERC##_double, alpha, beta); break;\
default:\
throw statement_not_supported_exception("Invalid numeric type in matrix-matrix multiplication");\
}\
}
Definition: forwards.h:217
Expression template class for representing a tree of expressions which ultimately result in a matrix...
Definition: forwards.h:283
void prod_impl(const matrix_base< NumericT, F > &mat, const vector_base< NumericT > &vec, vector_base< NumericT > &result)
Carries out matrix-vector multiplication.
Definition: matrix_operations.hpp:350
Definition: forwards.h:216
#define VIENNACL_SCHEDULER_GENERATE_MATRIX_MATRIX_PROD (   LAYOUTA,
  MEMBERA,
  MAJORA,
  LAYOUTB,
  MEMBERB,
  MAJORB,
  LAYOUTC,
  MEMBERC 
)
Value:
if (leafA.lhs.subtype == LAYOUTA && leafB.lhs.subtype == LAYOUTB && result.subtype == LAYOUTC)\
{\
switch (result.numeric_type)\
{\
viennacl::linalg::prod_impl(viennacl::matrix_expression< const matrix_base<float, MAJORA>,\
const matrix_base<float, MAJORA>,\
op_trans>(*leafA.lhs.matrix_##MEMBERA##_float, *leafA.lhs.matrix_##MEMBERA##_float), \
viennacl::matrix_expression< const matrix_base<float, MAJORB>,\
const matrix_base<float, MAJORB>,\
op_trans>(*leafB.lhs.matrix_##MEMBERB##_float, *leafB.lhs.matrix_##MEMBERB##_float), \
*result.matrix_##MEMBERC##_float, static_cast<float>(alpha), static_cast<float>(beta)); break;\
viennacl::linalg::prod_impl(viennacl::matrix_expression< const matrix_base<double, MAJORA>,\
const matrix_base<double, MAJORA>,\
op_trans>(*leafA.lhs.matrix_##MEMBERA##_double, *leafA.lhs.matrix_##MEMBERA##_double), \
viennacl::matrix_expression< const matrix_base<double, MAJORB>,\
const matrix_base<double, MAJORB>,\
op_trans>(*leafB.lhs.matrix_##MEMBERB##_double, *leafB.lhs.matrix_##MEMBERB##_double), \
*result.matrix_##MEMBERC##_double, alpha, beta); break;\
default:\
throw statement_not_supported_exception("Invalid numeric type in matrix-matrix multiplication");\
}\
}
Definition: forwards.h:217
Expression template class for representing a tree of expressions which ultimately result in a matrix...
Definition: forwards.h:283
void prod_impl(const matrix_base< NumericT, F > &mat, const vector_base< NumericT > &vec, vector_base< NumericT > &result)
Carries out matrix-vector multiplication.
Definition: matrix_operations.hpp:350
Definition: forwards.h:216