From 4716040703be1ee906439385d20475dcddad5ce3 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Mon, 25 Oct 2010 10:15:22 -0400 Subject: bug #86 : use internal:: namespace instead of ei_ prefix --- Eigen/src/Core/products/GeneralMatrixMatrix.h | 108 +++++++++++++------------- 1 file changed, 56 insertions(+), 52 deletions(-) (limited to 'Eigen/src/Core/products/GeneralMatrixMatrix.h') diff --git a/Eigen/src/Core/products/GeneralMatrixMatrix.h b/Eigen/src/Core/products/GeneralMatrixMatrix.h index 1cdfb84d1..39e65599d 100644 --- a/Eigen/src/Core/products/GeneralMatrixMatrix.h +++ b/Eigen/src/Core/products/GeneralMatrixMatrix.h @@ -25,27 +25,29 @@ #ifndef EIGEN_GENERAL_MATRIX_MATRIX_H #define EIGEN_GENERAL_MATRIX_MATRIX_H -template class ei_level3_blocking; +namespace internal { + +template class level3_blocking; /* Specialization for a row-major destination matrix => simple transposition of the product */ template< typename Index, typename LhsScalar, int LhsStorageOrder, bool ConjugateLhs, typename RhsScalar, int RhsStorageOrder, bool ConjugateRhs> -struct ei_general_matrix_matrix_product +struct general_matrix_matrix_product { - typedef typename ei_scalar_product_traits::ReturnType ResScalar; + typedef typename scalar_product_traits::ReturnType ResScalar; static EIGEN_STRONG_INLINE void run( Index rows, Index cols, Index depth, const LhsScalar* lhs, Index lhsStride, const RhsScalar* rhs, Index rhsStride, ResScalar* res, Index resStride, ResScalar alpha, - ei_level3_blocking& blocking, + level3_blocking& blocking, GemmParallelInfo* info = 0) { // transpose the product such that the result is column major - ei_general_matrix_matrix_product @@ -59,29 +61,29 @@ template< typename Index, typename LhsScalar, int LhsStorageOrder, bool ConjugateLhs, typename RhsScalar, int RhsStorageOrder, bool ConjugateRhs> -struct ei_general_matrix_matrix_product +struct general_matrix_matrix_product { -typedef typename ei_scalar_product_traits::ReturnType ResScalar; +typedef typename scalar_product_traits::ReturnType ResScalar; static void run(Index rows, Index cols, Index depth, const LhsScalar* _lhs, Index lhsStride, const RhsScalar* _rhs, Index rhsStride, ResScalar* res, Index resStride, ResScalar alpha, - ei_level3_blocking& blocking, + level3_blocking& blocking, GemmParallelInfo* info = 0) { - ei_const_blas_data_mapper lhs(_lhs,lhsStride); - ei_const_blas_data_mapper rhs(_rhs,rhsStride); + const_blas_data_mapper lhs(_lhs,lhsStride); + const_blas_data_mapper rhs(_rhs,rhsStride); - typedef ei_gebp_traits Traits; + typedef gebp_traits Traits; Index kc = blocking.kc(); // cache block size along the K direction Index mc = std::min(rows,blocking.mc()); // cache block size along the M direction //Index nc = blocking.nc(); // cache block size along the N direction - ei_gemm_pack_lhs pack_lhs; - ei_gemm_pack_rhs pack_rhs; - ei_gebp_kernel gebp; + gemm_pack_lhs pack_lhs; + gemm_pack_rhs pack_rhs; + gebp_kernel gebp; #ifdef EIGEN_HAS_OPENMP if(info) @@ -94,7 +96,7 @@ static void run(Index rows, Index cols, Index depth, std::size_t sizeW = kc*Traits::WorkSpaceFactor; RhsScalar* w = ei_aligned_stack_new(RhsScalar, sizeW); RhsScalar* blockB = blocking.blockB(); - ei_internal_assert(blockB!=0); + eigen_internal_assert(blockB!=0); // For each horizontal panel of the rhs, and corresponding vertical panel of the lhs... for(Index k=0; k for "large" GEMM, i.e., -* implementation of the high level wrapper to ei_general_matrix_matrix_product +* implementation of the high level wrapper to general_matrix_matrix_product **********************************************************************************/ template -struct ei_traits > - : ei_traits, Lhs, Rhs> > +struct traits > + : traits, Lhs, Rhs> > {}; template -struct ei_gemm_functor +struct gemm_functor { - ei_gemm_functor(const Lhs& lhs, const Rhs& rhs, Dest& dest, Scalar actualAlpha, + gemm_functor(const Lhs& lhs, const Rhs& rhs, Dest& dest, Scalar actualAlpha, BlockingType& blocking) : m_lhs(lhs), m_rhs(rhs), m_dest(dest), m_actualAlpha(actualAlpha), m_blocking(blocking) {} @@ -250,10 +252,10 @@ struct ei_gemm_functor }; template class ei_gemm_blocking_space; +bool FiniteAtCompileTime = MaxRows!=Dynamic && MaxCols!=Dynamic && MaxDepth != Dynamic> class gemm_blocking_space; template -class ei_level3_blocking +class level3_blocking { typedef _LhsScalar LhsScalar; typedef _RhsScalar RhsScalar; @@ -269,7 +271,7 @@ class ei_level3_blocking public: - ei_level3_blocking() + level3_blocking() : m_blockA(0), m_blockB(0), m_blockW(0), m_mc(0), m_nc(0), m_kc(0) {} @@ -283,19 +285,19 @@ class ei_level3_blocking }; template -class ei_gemm_blocking_space - : public ei_level3_blocking< - typename ei_meta_if::ret, - typename ei_meta_if::ret> +class gemm_blocking_space + : public level3_blocking< + typename meta_if::ret, + typename meta_if::ret> { enum { Transpose = StorageOrder==RowMajor, ActualRows = Transpose ? MaxCols : MaxRows, ActualCols = Transpose ? MaxRows : MaxCols }; - typedef typename ei_meta_if::ret LhsScalar; - typedef typename ei_meta_if::ret RhsScalar; - typedef ei_gebp_traits Traits; + typedef typename meta_if::ret LhsScalar; + typedef typename meta_if::ret RhsScalar; + typedef gebp_traits Traits; enum { SizeA = ActualRows * MaxDepth, SizeB = ActualCols * MaxDepth, @@ -308,7 +310,7 @@ class ei_gemm_blocking_spacem_mc = ActualRows; this->m_nc = ActualCols; @@ -325,17 +327,17 @@ class ei_gemm_blocking_space -class ei_gemm_blocking_space - : public ei_level3_blocking< - typename ei_meta_if::ret, - typename ei_meta_if::ret> +class gemm_blocking_space + : public level3_blocking< + typename meta_if::ret, + typename meta_if::ret> { enum { Transpose = StorageOrder==RowMajor }; - typedef typename ei_meta_if::ret LhsScalar; - typedef typename ei_meta_if::ret RhsScalar; - typedef ei_gebp_traits Traits; + typedef typename meta_if::ret LhsScalar; + typedef typename meta_if::ret RhsScalar; + typedef gebp_traits Traits; DenseIndex m_sizeA; DenseIndex m_sizeB; @@ -343,7 +345,7 @@ class ei_gemm_blocking_spacem_mc = Transpose ? cols : rows; this->m_nc = Transpose ? rows : cols; @@ -358,19 +360,19 @@ class ei_gemm_blocking_spacem_blockA==0) - this->m_blockA = ei_aligned_new(m_sizeA); + this->m_blockA = aligned_new(m_sizeA); } void allocateB() { if(this->m_blockB==0) - this->m_blockB = ei_aligned_new(m_sizeB); + this->m_blockB = aligned_new(m_sizeB); } void allocateW() { if(this->m_blockW==0) - this->m_blockW = ei_aligned_new(m_sizeW); + this->m_blockW = aligned_new(m_sizeW); } void allocateAll() @@ -380,14 +382,16 @@ class ei_gemm_blocking_spacem_blockA, m_sizeA); - ei_aligned_delete(this->m_blockB, m_sizeB); - ei_aligned_delete(this->m_blockW, m_sizeW); + aligned_delete(this->m_blockA, m_sizeA); + aligned_delete(this->m_blockB, m_sizeB); + aligned_delete(this->m_blockW, m_sizeW); } }; +} // end namespace internal + template class GeneralProduct : public ProductBase, Lhs, Rhs> @@ -404,13 +408,13 @@ class GeneralProduct GeneralProduct(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs) { - typedef ei_scalar_product_op BinOp; + typedef internal::scalar_product_op BinOp; EIGEN_CHECK_BINARY_COMPATIBILIY(BinOp,LhsScalar,RhsScalar); } template void scaleAndAddTo(Dest& dst, Scalar alpha) const { - ei_assert(dst.rows()==m_lhs.rows() && dst.cols()==m_rhs.cols()); + eigen_assert(dst.rows()==m_lhs.rows() && dst.cols()==m_rhs.cols()); const ActualLhsType lhs = LhsBlasTraits::extract(m_lhs); const ActualRhsType rhs = RhsBlasTraits::extract(m_rhs); @@ -418,12 +422,12 @@ class GeneralProduct Scalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(m_lhs) * RhsBlasTraits::extractScalarFactor(m_rhs); - typedef ei_gemm_blocking_space<(Dest::Flags&RowMajorBit) ? RowMajor : ColMajor,LhsScalar,RhsScalar, + typedef internal::gemm_blocking_space<(Dest::Flags&RowMajorBit) ? RowMajor : ColMajor,LhsScalar,RhsScalar, Dest::MaxRowsAtCompileTime,Dest::MaxColsAtCompileTime,MaxDepthAtCompileTime> BlockingType; - typedef ei_gemm_functor< + typedef internal::gemm_functor< Scalar, Index, - ei_general_matrix_matrix_product< + internal::general_matrix_matrix_product< Index, LhsScalar, (_ActualLhsType::Flags&RowMajorBit) ? RowMajor : ColMajor, bool(LhsBlasTraits::NeedToConjugate), RhsScalar, (_ActualRhsType::Flags&RowMajorBit) ? RowMajor : ColMajor, bool(RhsBlasTraits::NeedToConjugate), @@ -432,7 +436,7 @@ class GeneralProduct BlockingType blocking(dst.rows(), dst.cols(), lhs.cols()); - ei_parallelize_gemm<(Dest::MaxRowsAtCompileTime>32 || Dest::MaxRowsAtCompileTime==Dynamic)>(GemmFunctor(lhs, rhs, dst, actualAlpha, blocking), this->rows(), this->cols(), Dest::Flags&RowMajorBit); + internal::parallelize_gemm<(Dest::MaxRowsAtCompileTime>32 || Dest::MaxRowsAtCompileTime==Dynamic)>(GemmFunctor(lhs, rhs, dst, actualAlpha, blocking), this->rows(), this->cols(), Dest::Flags&RowMajorBit); } }; -- cgit v1.2.3