#include <TensorContraction.h>
|
template<typename Device > |
static EIGEN_DEVICE_FUNC BlockMemHandle | allocate (Device &d, const Index bm, const Index bk, const Index bn, LhsScalar **lhs_block, RhsScalar **rhs_block) |
|
template<typename Device > |
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) |
|
template<typename Device > |
static EIGEN_DEVICE_FUNC void | deallocate (Device &d, BlockMemHandle handle) |
|
◆ BlockMemHandle
template<typename LhsScalar , typename RhsScalar >
◆ allocate()
template<typename LhsScalar , typename RhsScalar >
template<typename Device >
90 char* block_mem =
static_cast<char*
>(d.allocate(sz.lhs_size + sz.rhs_size));
91 *lhs_block =
static_cast<LhsScalar*
>(
static_cast<void*
>(block_mem));
92 *rhs_block =
static_cast<RhsScalar*
>(
static_cast<void*
>(block_mem + sz.lhs_size));
#define eigen_assert(x)
Definition: Macros.h:910
static EIGEN_DEVICE_FUNC BlockSizes ComputeLhsRhsBlockSizes(const Index bm, const Index bk, const Index bn)
Definition: TensorContraction.h:136
References Eigen::internal::TensorContractionBlockMemAllocator< LhsScalar, RhsScalar >::ComputeLhsRhsBlockSizes(), eigen_assert, Eigen::internal::TensorContractionBlockMemAllocator< LhsScalar, RhsScalar >::BlockSizes::lhs_size, and Eigen::internal::TensorContractionBlockMemAllocator< LhsScalar, RhsScalar >::BlockSizes::rhs_size.
Referenced by Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::allocate().
◆ allocateSlices()
template<typename LhsScalar , typename RhsScalar >
template<typename Device >
106 void* block_mem = d.allocate((num_lhs * sz.lhs_size + num_rhs * sz.rhs_size) * num_slices);
108 char* mem =
static_cast<char*
>(block_mem);
110 for (
Index x = 0;
x < num_slices;
x++) {
111 if (num_lhs > 0) lhs_blocks[
x].resize(num_lhs);
112 for (
Index m = 0;
m < num_lhs;
m++) {
113 lhs_blocks[
x][
m] =
static_cast<LhsScalar*
>(
static_cast<void*
>(mem));
116 if (num_rhs > 0) rhs_blocks[
x].resize(num_rhs);
117 for (
Index n = 0;
n < num_rhs;
n++) {
118 rhs_blocks[
x][
n] =
static_cast<RhsScalar*
>(
static_cast<void*
>(mem));
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
int * m
Definition: level2_cplx_impl.h:294
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
list x
Definition: plotDoE.py:28
References Eigen::internal::TensorContractionBlockMemAllocator< LhsScalar, RhsScalar >::ComputeLhsRhsBlockSizes(), eigen_assert, Eigen::internal::TensorContractionBlockMemAllocator< LhsScalar, RhsScalar >::BlockSizes::lhs_size, m, n, Eigen::internal::TensorContractionBlockMemAllocator< LhsScalar, RhsScalar >::BlockSizes::rhs_size, and plotDoE::x.
Referenced by Eigen::internal::TensorContractionKernel< ResScalar, LhsScalar, RhsScalar, StorageIndex, OutputMapper, LhsMapper, RhsMapper >::allocateSlices().
◆ ComputeLhsRhsBlockSizes()
template<typename LhsScalar , typename RhsScalar >
139 sz.lhs_size = numext::div_ceil<Index>(bm * bk *
sizeof(LhsScalar), align) * align;
140 sz.rhs_size = numext::div_ceil<Index>(bn * bk *
sizeof(RhsScalar), align) * align;
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T maxi(const T &x, const T &y)
Definition: MathFunctions.h:926
References EIGEN_MAX_ALIGN_BYTES, Eigen::internal::TensorContractionBlockMemAllocator< LhsScalar, RhsScalar >::BlockSizes::lhs_size, Eigen::numext::maxi(), and Eigen::internal::TensorContractionBlockMemAllocator< LhsScalar, RhsScalar >::BlockSizes::rhs_size.
Referenced by Eigen::internal::TensorContractionBlockMemAllocator< LhsScalar, RhsScalar >::allocate(), and Eigen::internal::TensorContractionBlockMemAllocator< LhsScalar, RhsScalar >::allocateSlices().
◆ deallocate()
template<typename LhsScalar , typename RhsScalar >
template<typename Device >
The documentation for this struct was generated from the following file: