Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper > Struct Template Reference

#include <TensorContraction.h>

Public Types

enum  { HasBeta = false }
 
typedef LhsScalar * LhsBlock
 
typedef RhsScalar * RhsBlock
 
typedef TensorContractionBlockMemAllocator< LhsScalar, RhsScalar > BlockMemAllocator
 
typedef BlockMemAllocator::BlockMemHandle BlockMemHandle
 
typedef internal::gebp_traits< LhsScalar, RhsScalar > Traits
 
typedef internal::gemm_pack_lhs< LhsScalar, StorageIndex, typename LhsMapper::SubMapper, Traits::mr, Traits::LhsProgress, typename Traits::LhsPacket4Packing, ColMajorLhsPacker
 
typedef internal::gemm_pack_rhs< RhsScalar, StorageIndex, typename RhsMapper::SubMapper, Traits::nr, ColMajorRhsPacker
 
typedef internal::gebp_kernel< LhsScalar, RhsScalar, StorageIndex, OutputMapper, Traits::mr, Traits::nr, false, false > GebpKernel
 

Public Member Functions

EIGEN_DEVICE_FUNC TensorContractionKernel (StorageIndex m_, StorageIndex k_, StorageIndex n_, StorageIndex bm_, StorageIndex bk_, StorageIndex bn_)
 
template<typename Device >
EIGEN_DEVICE_FUNC BlockMemHandle allocate (Device &d, LhsBlock *lhs_block, RhsBlock *rhs_block)
 
template<typename Device >
EIGEN_DEVICE_FUNC BlockMemHandle allocateSlices (Device &d, const StorageIndex num_lhs, const StorageIndex num_rhs, const StorageIndex num_slices, std::vector< LhsBlock > *lhs_blocks, std::vector< RhsBlock > *rhs_blocks)
 
EIGEN_DEVICE_FUNC EIGEN_DONT_INLINE void packLhs (LhsBlock *lhsBlock, const typename LhsMapper::SubMapper &data_mapper, const StorageIndex depth, const StorageIndex rows)
 
EIGEN_DEVICE_FUNC EIGEN_DONT_INLINE void packRhs (RhsBlock *rhsBlock, const typename RhsMapper::SubMapper &data_mapper, const StorageIndex depth, const StorageIndex cols)
 
EIGEN_DEVICE_FUNC EIGEN_DONT_INLINE void invoke (const OutputMapper &output_mapper, const LhsBlock &lhsBlock, const RhsBlock &rhsBlock, const StorageIndex rows, const StorageIndex depth, const StorageIndex cols, const ResScalar alpha, const ResScalar beta)
 

Static Public Member Functions

template<typename Device >
static EIGEN_DEVICE_FUNC void deallocate (Device &d, BlockMemHandle handle)
 

Private Attributes

const StorageIndex m
 
const StorageIndex k
 
const StorageIndex n
 
const StorageIndex bm
 
const StorageIndex bk
 
const StorageIndex bn
 

Member Typedef Documentation

◆ BlockMemAllocator

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
typedef TensorContractionBlockMemAllocator<LhsScalar, RhsScalar> Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::BlockMemAllocator

◆ BlockMemHandle

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
typedef BlockMemAllocator::BlockMemHandle Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::BlockMemHandle

◆ GebpKernel

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
typedef internal::gebp_kernel<LhsScalar, RhsScalar, StorageIndex, OutputMapper, Traits::mr, Traits::nr, false, false> Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::GebpKernel

◆ LhsBlock

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
typedef LhsScalar* Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::LhsBlock

◆ LhsPacker

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
typedef internal::gemm_pack_lhs<LhsScalar, StorageIndex, typename LhsMapper::SubMapper, Traits::mr, Traits::LhsProgress, typename Traits::LhsPacket4Packing, ColMajor> Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::LhsPacker

◆ RhsBlock

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
typedef RhsScalar* Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::RhsBlock

◆ RhsPacker

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
typedef internal::gemm_pack_rhs<RhsScalar, StorageIndex, typename RhsMapper::SubMapper, Traits::nr, ColMajor> Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::RhsPacker

◆ Traits

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
typedef internal::gebp_traits<LhsScalar, RhsScalar> Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::Traits

Member Enumeration Documentation

◆ anonymous enum

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
anonymous enum
Enumerator
HasBeta 
178 { HasBeta = false };
@ HasBeta
Definition: TensorContraction.h:178

Constructor & Destructor Documentation

◆ TensorContractionKernel()

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
EIGEN_DEVICE_FUNC Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::TensorContractionKernel ( StorageIndex  m_,
StorageIndex  k_,
StorageIndex  n_,
StorageIndex  bm_,
StorageIndex  bk_,
StorageIndex  bn_ 
)
inline
182  : m(m_), k(k_), n(n_), bm(bm_), bk(bk_), bn(bn_) {}
const StorageIndex m
Definition: TensorContraction.h:250
const StorageIndex n
Definition: TensorContraction.h:252
const StorageIndex bm
Definition: TensorContraction.h:253
const StorageIndex bk
Definition: TensorContraction.h:254
const StorageIndex k
Definition: TensorContraction.h:251
const StorageIndex bn
Definition: TensorContraction.h:255

Member Function Documentation

◆ allocate()

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
template<typename Device >
EIGEN_DEVICE_FUNC BlockMemHandle Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::allocate ( Device &  d,
LhsBlock lhs_block,
RhsBlock rhs_block 
)
inline

◆ allocateSlices()

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
template<typename Device >
EIGEN_DEVICE_FUNC BlockMemHandle Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::allocateSlices ( Device &  d,
const StorageIndex  num_lhs,
const StorageIndex  num_rhs,
const StorageIndex  num_slices,
std::vector< LhsBlock > *  lhs_blocks,
std::vector< RhsBlock > *  rhs_blocks 
)
inline
213  {
214  return BlockMemAllocator::allocateSlices(d, bm, bk, bn, num_lhs, num_rhs, num_slices, lhs_blocks, rhs_blocks);
215  }
static EIGEN_DEVICE_FUNC BlockMemHandle allocateSlices(Device &d, const Index bm, const Index bk, const Index bn, const Index num_lhs, const Index num_rhs, const Index num_slices, std::vector< LhsScalar * > *lhs_blocks, std::vector< RhsScalar * > *rhs_blocks)
Definition: TensorContraction.h:97

References Eigen::internal::TensorContractionBlockMemAllocator< LhsScalar, RhsScalar >::allocateSlices(), Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::bk, Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::bm, and Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::bn.

◆ deallocate()

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
template<typename Device >
static EIGEN_DEVICE_FUNC void Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::deallocate ( Device &  d,
BlockMemHandle  handle 
)
inlinestatic
218  {
220  }
static EIGEN_DEVICE_FUNC void deallocate(Device &d, BlockMemHandle handle)
Definition: TensorContraction.h:127

References Eigen::internal::TensorContractionBlockMemAllocator< LhsScalar, RhsScalar >::deallocate().

◆ invoke()

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
EIGEN_DEVICE_FUNC EIGEN_DONT_INLINE void Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::invoke ( const OutputMapper &  output_mapper,
const LhsBlock lhsBlock,
const RhsBlock rhsBlock,
const StorageIndex  rows,
const StorageIndex  depth,
const StorageIndex  cols,
const ResScalar  alpha,
const ResScalar  beta 
)
inline
236  {
237  // Default GEBP kernel does not support beta.
238  eigen_assert(beta == ResScalar(1));
239  static const int kComputeStrideFromBlockDimensions = -1;
240  GebpKernel()(output_mapper, lhsBlock, rhsBlock, rows, depth, cols, alpha,
241  /*strideA*/ kComputeStrideFromBlockDimensions,
242  /*strideB*/ kComputeStrideFromBlockDimensions,
243  /*offsetA*/ 0, /*offsetB*/ 0);
244  }
#define eigen_assert(x)
Definition: Macros.h:910
int rows
Definition: Tutorial_commainit_02.cpp:1
int cols
Definition: Tutorial_commainit_02.cpp:1
RealScalar alpha
Definition: level1_cplx_impl.h:151
Scalar beta
Definition: level2_cplx_impl.h:36
internal::gebp_kernel< LhsScalar, RhsScalar, StorageIndex, OutputMapper, Traits::mr, Traits::nr, false, false > GebpKernel
Definition: TensorContraction.h:203

References alpha, beta, cols, eigen_assert, and rows.

◆ packLhs()

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
EIGEN_DEVICE_FUNC EIGEN_DONT_INLINE void Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::packLhs ( LhsBlock lhsBlock,
const typename LhsMapper::SubMapper &  data_mapper,
const StorageIndex  depth,
const StorageIndex  rows 
)
inline
223  {
224  LhsPacker()(*lhsBlock, data_mapper, depth, rows, /*stride*/ 0,
225  /*offset*/ 0);
226  }
internal::gemm_pack_lhs< LhsScalar, StorageIndex, typename LhsMapper::SubMapper, Traits::mr, Traits::LhsProgress, typename Traits::LhsPacket4Packing, ColMajor > LhsPacker
Definition: TensorContraction.h:196

References rows.

◆ packRhs()

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
EIGEN_DEVICE_FUNC EIGEN_DONT_INLINE void Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::packRhs ( RhsBlock rhsBlock,
const typename RhsMapper::SubMapper &  data_mapper,
const StorageIndex  depth,
const StorageIndex  cols 
)
inline
229  {
230  RhsPacker()(*rhsBlock, data_mapper, depth, cols);
231  }
internal::gemm_pack_rhs< RhsScalar, StorageIndex, typename RhsMapper::SubMapper, Traits::nr, ColMajor > RhsPacker
Definition: TensorContraction.h:199

References cols.

Member Data Documentation

◆ bk

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
const StorageIndex Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::bk
private

◆ bm

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
const StorageIndex Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::bm
private

◆ bn

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
const StorageIndex Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::bn
private

◆ k

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
const StorageIndex Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::k
private

◆ m

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
const StorageIndex Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::m
private

◆ n

template<typename ResScalar , typename LhsScalar , typename RhsScalar , typename StorageIndex , typename OutputMapper , typename LhsMapper , typename RhsMapper >
const StorageIndex Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::n
private

The documentation for this struct was generated from the following file: