ViennaCL - The Vienna Computing Library  1.5.1
viennacl/linalg/detail/op_executor.hpp
Go to the documentation of this file.
00001 #ifndef VIENNACL_LINALG_DETAIL_OP_EXECUTOR_HPP
00002 #define VIENNACL_LINALG_DETAIL_OP_EXECUTOR_HPP
00003 
00004 /* =========================================================================
00005    Copyright (c) 2010-2014, Institute for Microelectronics,
00006                             Institute for Analysis and Scientific Computing,
00007                             TU Wien.
00008    Portions of this software are copyright by UChicago Argonne, LLC.
00009 
00010                             -----------------
00011                   ViennaCL - The Vienna Computing Library
00012                             -----------------
00013 
00014    Project Head:    Karl Rupp                   rupp@iue.tuwien.ac.at
00015 
00016    (A list of authors and contributors can be found in the PDF manual)
00017 
00018    License:         MIT (X11), see file LICENSE in the base directory
00019 ============================================================================= */
00020 
00026 #include "viennacl/forwards.h"
00027 
00028 namespace viennacl
00029 {
00030   namespace linalg
00031   {
00032     namespace detail
00033     {
00034       template <typename T, typename B>
00035       bool op_aliasing(vector_base<T> const & /*lhs*/, B const & /*b*/)
00036       {
00037         return false;
00038       }
00039 
00040       template <typename T>
00041       bool op_aliasing(vector_base<T> const & lhs, vector_base<T> const & b)
00042       {
00043         return lhs.handle() == b.handle();
00044       }
00045 
00046       template <typename T, typename LHS, typename RHS, typename OP>
00047       bool op_aliasing(vector_base<T> const & lhs, vector_expression<const LHS, const RHS, OP> const & rhs)
00048       {
00049         return op_aliasing(lhs, rhs.lhs()) || op_aliasing(lhs, rhs.rhs());
00050       }
00051 
00052 
00053       template <typename T, typename F, typename B>
00054       bool op_aliasing(matrix_base<T, F> const & /*lhs*/, B const & /*b*/)
00055       {
00056         return false;
00057       }
00058 
00059       template <typename T, typename F>
00060       bool op_aliasing(matrix_base<T, F> const & lhs, matrix_base<T, F> const & b)
00061       {
00062         return lhs.handle() == b.handle();
00063       }
00064 
00065       template <typename T, typename F, typename LHS, typename RHS, typename OP>
00066       bool op_aliasing(matrix_base<T, F> const & lhs, matrix_expression<const LHS, const RHS, OP> const & rhs)
00067       {
00068         return op_aliasing(lhs, rhs.lhs()) || op_aliasing(lhs, rhs.rhs());
00069       }
00070 
00071 
00078       template <typename A, typename OP, typename T>
00079       struct op_executor {};
00080 
00081     }
00082   }
00083 }
00084 
00085 #endif // VIENNACL_LINALG_DETAIL_OP_EXECUTOR_HPP