ViennaCL - The Vienna Computing Library  1.7.1
Free open-source GPU-accelerated linear algebra and solver library.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
op_executor.hpp
Go to the documentation of this file.
1 #ifndef VIENNACL_LINALG_DETAIL_OP_EXECUTOR_HPP
2 #define VIENNACL_LINALG_DETAIL_OP_EXECUTOR_HPP
3 
4 /* =========================================================================
5  Copyright (c) 2010-2016, Institute for Microelectronics,
6  Institute for Analysis and Scientific Computing,
7  TU Wien.
8  Portions of this software are copyright by UChicago Argonne, LLC.
9 
10  -----------------
11  ViennaCL - The Vienna Computing Library
12  -----------------
13 
14  Project Head: Karl Rupp rupp@iue.tuwien.ac.at
15 
16  (A list of authors and contributors can be found in the manual)
17 
18  License: MIT (X11), see file LICENSE in the base directory
19 ============================================================================= */
20 
26 #include "viennacl/forwards.h"
27 
28 namespace viennacl
29 {
30 namespace linalg
31 {
32 namespace detail
33 {
34 
35 template<typename NumericT, typename B>
36 bool op_aliasing(vector_base<NumericT> const & /*lhs*/, B const & /*b*/)
37 {
38  return false;
39 }
40 
41 template<typename NumericT>
43 {
44  return lhs.handle() == b.handle();
45 }
46 
47 template<typename NumericT, typename LhsT, typename RhsT, typename OpT>
49 {
50  return op_aliasing(lhs, rhs.lhs()) || op_aliasing(lhs, rhs.rhs());
51 }
52 
53 
54 template<typename NumericT, typename B>
55 bool op_aliasing(matrix_base<NumericT> const & /*lhs*/, B const & /*b*/)
56 {
57  return false;
58 }
59 
60 template<typename NumericT>
62 {
63  return lhs.handle() == b.handle();
64 }
65 
66 template<typename NumericT, typename LhsT, typename RhsT, typename OpT>
68 {
69  return op_aliasing(lhs, rhs.lhs()) || op_aliasing(lhs, rhs.rhs());
70 }
71 
72 
79 template<typename A, typename OP, typename T>
80 struct op_executor {};
81 
82 }
83 }
84 }
85 
86 #endif // VIENNACL_LINALG_DETAIL_OP_EXECUTOR_HPP
Worker class for decomposing expression templates.
Definition: op_executor.hpp:80
Expression template class for representing a tree of expressions which ultimately result in a matrix...
Definition: forwards.h:341
This file provides the forward declarations for the main types used within ViennaCL.
lhs_reference_type lhs() const
Get left hand side operand.
Definition: vector.hpp:74
An expression template class that represents a binary operation that yields a vector.
Definition: forwards.h:239
bool op_aliasing(vector_base< NumericT > const &, B const &)
Definition: op_executor.hpp:36
rhs_reference_type rhs() const
Get right hand side operand.
Definition: vector.hpp:77
handle_type & handle()
Returns the OpenCL handle, non-const-version.
Definition: matrix_def.hpp:244
RHS & rhs() const
Get right hand side operand.
Definition: matrix.hpp:69
LHS & lhs() const
Get left hand side operand.
Definition: matrix.hpp:66
const handle_type & handle() const
Returns the memory handle.
Definition: vector_def.hpp:128