ViennaCL - The Vienna Computing Library  1.5.0
Namespaces | Defines | Functions
viennacl/scheduler/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

namespace  viennacl
 

Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.


namespace  viennacl::scheduler
 

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


namespace  viennacl::scheduler::detail
 

Implementation details for the scheduler.


Defines

#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.


Define 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)\
            {\
            case FLOAT_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;\
            case DOUBLE_TYPE:\
              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");\
            }\
          }
#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)\
            {\
            case FLOAT_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;\
            case DOUBLE_TYPE:\
              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");\
            }\
          }
#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)\
            {\
            case FLOAT_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;\
            case DOUBLE_TYPE:\
              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");\
            }\
          }
#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)\
            {\
            case FLOAT_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;\
            case DOUBLE_TYPE:\
              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");\
            }\
          }