mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 03:39:01 +08:00
Fix lazyness of operator* with CUDA
This commit is contained in:
parent
cda47c42c2
commit
55d7181557
@ -24,12 +24,17 @@ template<int Rows, int Cols, int Depth> struct product_type_selector;
|
|||||||
|
|
||||||
template<int Size, int MaxSize> struct product_size_category
|
template<int Size, int MaxSize> struct product_size_category
|
||||||
{
|
{
|
||||||
enum { is_large = MaxSize == Dynamic ||
|
enum {
|
||||||
Size >= EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD ||
|
#ifndef EIGEN_CUDA_ARCH
|
||||||
(Size==Dynamic && MaxSize>=EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD),
|
is_large = MaxSize == Dynamic ||
|
||||||
value = is_large ? Large
|
Size >= EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD ||
|
||||||
: Size == 1 ? 1
|
(Size==Dynamic && MaxSize>=EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD),
|
||||||
: Small
|
#else
|
||||||
|
is_large = 0,
|
||||||
|
#endif
|
||||||
|
value = is_large ? Large
|
||||||
|
: Size == 1 ? 1
|
||||||
|
: Small
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -379,8 +384,6 @@ template<> struct gemv_dense_selector<OnTheRight,RowMajor,false>
|
|||||||
*
|
*
|
||||||
* \sa lazyProduct(), operator*=(const MatrixBase&), Cwise::operator*()
|
* \sa lazyProduct(), operator*=(const MatrixBase&), Cwise::operator*()
|
||||||
*/
|
*/
|
||||||
#ifndef EIGEN_CUDACC
|
|
||||||
|
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
inline const Product<Derived, OtherDerived>
|
inline const Product<Derived, OtherDerived>
|
||||||
@ -412,8 +415,6 @@ MatrixBase<Derived>::operator*(const MatrixBase<OtherDerived> &other) const
|
|||||||
return Product<Derived, OtherDerived>(derived(), other.derived());
|
return Product<Derived, OtherDerived>(derived(), other.derived());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // EIGEN_CUDACC
|
|
||||||
|
|
||||||
/** \returns an expression of the matrix product of \c *this and \a other without implicit evaluation.
|
/** \returns an expression of the matrix product of \c *this and \a other without implicit evaluation.
|
||||||
*
|
*
|
||||||
* The returned product will behave like any other expressions: the coefficients of the product will be
|
* The returned product will behave like any other expressions: the coefficients of the product will be
|
||||||
|
@ -160,20 +160,11 @@ template<typename Derived> class MatrixBase
|
|||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||||
Derived& operator-=(const MatrixBase<OtherDerived>& other);
|
Derived& operator-=(const MatrixBase<OtherDerived>& other);
|
||||||
|
|
||||||
#ifdef EIGEN_CUDACC
|
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
EIGEN_DEVICE_FUNC
|
EIGEN_DEVICE_FUNC
|
||||||
const Product<Derived,OtherDerived,LazyProduct>
|
|
||||||
operator*(const MatrixBase<OtherDerived> &other) const
|
|
||||||
{ return this->lazyProduct(other); }
|
|
||||||
#else
|
|
||||||
|
|
||||||
template<typename OtherDerived>
|
|
||||||
const Product<Derived,OtherDerived>
|
const Product<Derived,OtherDerived>
|
||||||
operator*(const MatrixBase<OtherDerived> &other) const;
|
operator*(const MatrixBase<OtherDerived> &other) const;
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
EIGEN_DEVICE_FUNC
|
EIGEN_DEVICE_FUNC
|
||||||
const Product<Derived,OtherDerived,LazyProduct>
|
const Product<Derived,OtherDerived,LazyProduct>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user