8#ifndef EIGEN_CXX11_TENSOR_TENSOR_BLOCK_H
9#define EIGEN_CXX11_TENSOR_TENSOR_BLOCK_H
16template <
typename Scalar,
typename IndexType,
int NumDims,
int Layout>
25template <
int Layout,
typename IndexType,
int NumDims>
29 if (NumDims == 0)
return strides;
33 if (
static_cast<int>(Layout) ==
static_cast<int>(
ColMajor)) {
35 for (
int i = 1;
i < NumDims; ++
i) {
40 for (
int i = NumDims - 2;
i >= 0; --
i) {
48template <
int Layout,
typename IndexType,
size_t NumDims>
54template <
int Layout, std::ptrdiff_t... Indices>
91 template <
typename Scalar>
99 template <
typename Scalar>
122 template <
typename Scalar>
129 template <
typename Scalar>
178 TensorOpCost rhs_cost) {
179 return lhs_cost + rhs_cost;
187template <
int NumDims,
typename IndexType = Eigen::Index>
235 template <
typename Scalar>
238 return static_cast<Scalar*
>(m_data);
249 template <
typename Scalar>
257 template <
int Layout,
typename Scalar>
263 template <
int Layout>
266 const Dimensions& desc_dims = desc.dimensions();
268 for (
int i = 0;
i < NumDims; ++
i) {
269 if (desc_dims[
i] == 1)
continue;
278 size_t m_data_type_size;
298 IndexType
offset()
const {
return m_offset; }
300 IndexType
dimension(
int index)
const {
return m_dimensions[index]; }
305 template <
int Layout,
typename Scalar>
312 template <
int Layout,
typename Scalar,
typename DstStr
idesIndexType>
321 m_destination.m_data =
NULL;
338 const IndexType m_offset;
340 DestinationBuffer m_destination;
346template <
int NumDims,
int Layout,
typename IndexType = Eigen::Index>
356 : m_tensor_dimensions(dimensions), m_requirements(
requirements) {
358 InitializeBlockDimensions();
362 return m_total_block_count;
371 return m_block_dimensions;
384 for (
int i = NumDims - 1;
i >= 0; --
i) {
390 const IndexType
coord =
idx * m_block_dimensions[dim];
392 m_block_dimensions[dim]);
396 return {
offset, dimensions};
400 void InitializeBlockDimensions() {
404 numext::maxi<IndexType>(1,
static_cast<IndexType
>(m_requirements.
size));
413 for (
int i = 0;
i < NumDims; ++
i) {
414 m_block_dimensions[
i] = 1;
416 m_total_block_count = 0;
421 if (tensor_size <= target_block_size) {
422 m_block_dimensions = m_tensor_dimensions;
423 m_total_block_count = 1;
426 for (
int i = 0;
i < NumDims; ++
i) {
427 m_tensor_strides[
i] = 0;
428 m_block_strides[
i] = 1;
433 static const bool isColMajor = Layout ==
static_cast<int>(
ColMajor);
437 IndexType coeff_to_allocate = target_block_size;
439 for (
int i = 0;
i < NumDims; ++
i) {
440 const int dim = isColMajor ?
i : NumDims -
i - 1;
441 m_block_dimensions[dim] =
442 numext::mini(coeff_to_allocate, m_tensor_dimensions[dim]);
443 coeff_to_allocate =
divup(
445 numext::maxi(
static_cast<IndexType
>(1), m_block_dimensions[dim]));
452 const IndexType dim_size_target = convert_index<IndexType>(
453 std::pow(
static_cast<float>(target_block_size),
454 1.0f /
static_cast<float>(m_block_dimensions.
rank())));
456 for (
int i = 0;
i < NumDims; ++
i) {
461 m_block_dimensions[
i] =
466 IndexType total_size = m_block_dimensions.
TotalSize();
467 for (
int i = 0;
i < NumDims; ++
i) {
468 const int dim = isColMajor ?
i : NumDims -
i - 1;
470 if (m_block_dimensions[dim] < m_tensor_dimensions[dim]) {
471 const IndexType total_size_other_dims =
472 total_size / m_block_dimensions[dim];
473 const IndexType alloc_avail =
474 divup<IndexType>(target_block_size, total_size_other_dims);
475 if (alloc_avail == m_block_dimensions[dim]) {
479 m_block_dimensions[dim] =
481 total_size = total_size_other_dims * m_block_dimensions[dim];
490 numext::mini<IndexType>(target_block_size,
494 DSizes<IndexType, NumDims> block_count;
495 for (
int i = 0;
i < NumDims; ++
i) {
496 block_count[
i] =
divup(m_tensor_dimensions[
i], m_block_dimensions[
i]);
498 m_total_block_count =
array_prod(block_count);
501 m_tensor_strides = strides<Layout>(m_tensor_dimensions);
502 m_block_strides = strides<Layout>(block_count);
505 DSizes<IndexType, NumDims> m_tensor_dimensions;
506 TensorBlockResourceRequirements m_requirements;
508 DSizes<IndexType, NumDims> m_block_dimensions;
509 IndexType m_total_block_count;
511 DSizes<IndexType, NumDims> m_tensor_strides;
512 DSizes<IndexType, NumDims> m_block_strides;
524template <
typename Device>
528 : m_device(device), m_allocation_index(0) {}
531 for (
size_t i = 0;
i < m_allocations.size(); ++
i) {
532 m_device.deallocate(m_allocations[
i].ptr);
538 if (m_allocations.capacity() == 0) m_allocations.reserve(8);
553 m_device.deallocate(m_allocations[m_allocation_index].ptr);
554 m_allocations[m_allocation_index].ptr = m_device.allocate(
size);
555 m_allocations[m_allocation_index].size =
size;
569 return m_allocations[m_allocation_index++].ptr;
572 void reset() { m_allocation_index = 0; }
580 const Device& m_device;
581 int m_allocation_index;
583 std::vector<Allocation> m_allocations;
627template <
typename XprType>
629 typedef typename XprType::Scalar
type;
654template <
typename Scalar,
int NumDims,
int Layout,
665 m_dimensions(dimensions),
666 m_expr(m_data, m_dimensions),
702 m_materialized_in_output
705 m_data, m_dimensions, !m_strided_storage);
723 bool m_materialized_in_output;
724 bool m_strided_storage;
729 template <
typename TensorBlockScratch>
734 typedef typename TensorBlockDesc::DestinationBuffer DestinationBuffer;
736 if (desc.destination().kind() == DestinationBuffer::kContiguous) {
738 desc.DropDestinationBuffer();
739 return Storage(buffer, desc.dimensions(),
744 }
else if (desc.destination().kind() == DestinationBuffer::kStrided &&
747 desc.DropDestinationBuffer();
748 return Storage(buffer, desc.dimensions(), desc.destination().strides(),
752 void*
mem = scratch.allocate(desc.size() *
sizeof(
Scalar));
761 template <
typename DataDimensions,
typename TensorBlockScratch>
781 for (
int i = 0;
i < NumDims; ++
i) {
783 if (
data_dims[dim] != desc.dimensions()[dim])
break;
792 if (desc.dimension(dim) != 1) {
813 data, desc.offset());
834template <
typename UnaryOp,
typename ArgTensorBlock>
836 static const bool NoArgBlockAccess =
841 NoArgBlockAccess,
void,
848 : m_arg_block(
arg_block), m_functor(functor) {}
857 ArgTensorBlock m_arg_block;
865template <
typename BinaryOp,
typename LhsTensorBlock,
typename RhsTensorBlock>
867 static const bool NoArgBlockAccess =
873 NoArgBlockAccess,
void,
875 const typename RhsTensorBlock::XprType> >::type
882 const BinaryOp& functor)
885 m_functor(functor) {}
890 return XprType(m_left_block.expr(), m_right_block.expr(), m_functor);
896 m_left_block.cleanup();
897 m_right_block.cleanup();
911template <
typename BlockFactory,
typename ArgTensorBlock>
913 typedef typename ArgTensorBlock::XprType ArgXprType;
918 NoArgBlockAccess,
void,
928 XprType expr()
const {
return m_factory.expr(m_arg_block.expr()); }
933 ArgTensorBlock m_arg_block;
941template <
typename BlockFactory,
typename Arg1TensorBlock,
942 typename Arg2TensorBlock,
typename Arg3TensorBlock>
944 typedef typename Arg1TensorBlock::XprType Arg1XprType;
945 typedef typename Arg2TensorBlock::XprType Arg2XprType;
946 typedef typename Arg3TensorBlock::XprType Arg3XprType;
954 NoArgBlockAccess,
void,
955 typename BlockFactory::template
XprType<Arg1XprType, Arg2XprType,
971 return m_factory.expr(m_arg1_block.expr(), m_arg2_block.expr(),
972 m_arg3_block.expr());
976 m_arg1_block.cleanup();
977 m_arg2_block.cleanup();
978 m_arg3_block.cleanup();
992template <
typename Scalar,
typename IndexType>
1028 template <
typename Str
idedLinearBufferCopy::Kind kind>
1031 const size_t count) {
1037 template <
typename Str
idedLinearBufferCopy::Kind kind>
1046 if (!Vectorizable) {
1053 const IndexType vectorized_size =
count - PacketSize;
1059 const IndexType unrolled_size =
count - 4 * PacketSize;
1061 for (;
i <= unrolled_size;
i += 4 * PacketSize) {
1062 for (
int j = 0;
j < 4; ++
j) {
1063 Packet p = ploadu<Packet>(src +
i +
j * PacketSize);
1064 pstoreu<Scalar, Packet>(dst +
i +
j * PacketSize,
p);
1067 for (;
i <= vectorized_size;
i += PacketSize) {
1068 Packet p = ploadu<Packet>(src +
i);
1069 pstoreu<Scalar, Packet>(dst +
i,
p);
1078 for (;
i <= vectorized_size;
i += PacketSize) {
1079 Packet p = ploadu<Packet>(src +
i);
1080 pscatter<Scalar, Packet>(dst +
i * dst_stride,
p, dst_stride);
1083 dst[
i * dst_stride] = src[
i];
1089 const IndexType unrolled_size =
count - 4 * PacketSize;
1090 Packet p = pload1<Packet>(src);
1091 for (;
i <= unrolled_size;
i += 4 * PacketSize) {
1092 for (
int j = 0;
j < 4; ++
j) {
1093 pstoreu<Scalar, Packet>(dst +
i +
j * PacketSize,
p);
1096 for (;
i <= vectorized_size;
i += PacketSize) {
1097 pstoreu<Scalar, Packet>(dst +
i,
p);
1106 Packet p = pload1<Packet>(src);
1107 for (;
i <= vectorized_size;
i += PacketSize) {
1108 pscatter<Scalar, Packet>(dst +
i * dst_stride,
p, dst_stride);
1111 dst[
i * dst_stride] = *src;
1117 for (;
i <= vectorized_size;
i += PacketSize) {
1118 Packet p = pgather<Scalar, Packet>(src +
i * src_stride, src_stride);
1119 pstoreu<Scalar, Packet>(dst +
i,
p);
1122 dst[
i] = src[
i * src_stride];
1128 dst[
i * dst_stride] = src[
i * src_stride];
1142template <
typename Scalar,
typename IndexType,
int NumDims,
int Layout>
1144 static const bool IsColMajor = (Layout ==
ColMajor);
1190 int inner_dim = IsColMajor ? 0 : NumDims - 1;
1214 const int dst_dim = IsColMajor ?
i : NumDims -
i - 1;
1240 const int dst_dim = IsColMajor ?
i : NumDims -
i - 1;
1254 IndexType input_stride =
1264 const int dst_dim = IsColMajor ?
i + 1 : NumDims -
i - 2;
1280#define COPY_INNER_DIM(KIND) \
1281 IndexType num_copied = 0; \
1282 for (num_copied = 0; num_copied < block_total_size; \
1283 num_copied += dst_inner_dim_size) { \
1284 LinCopy::template Run<KIND>( \
1285 typename LinCopy::Dst(output_offset, output_stride, dst.data), \
1286 typename LinCopy::Src(input_offset, input_stride, src.data), \
1287 dst_inner_dim_size); \
1289 for (int j = 0; j < idx; ++j) { \
1290 if (++it[j].count < it[j].size) { \
1291 input_offset += it[j].input_stride; \
1292 output_offset += it[j].output_stride; \
1296 input_offset -= it[j].input_span; \
1297 output_offset -= it[j].output_span; \
1302 if (input_stride == 1 && output_stride == 1) {
1304 }
else if (input_stride == 1 && output_stride != 1) {
1306 }
else if (input_stride == 0 && output_stride == 1) {
1308 }
else if (input_stride == 0 && output_stride != 1) {
1310 }
else if (output_stride == 1) {
1316#undef COPY_INNER_DIM
1329 struct BlockIteratorState {
1330 BlockIteratorState()
1340 IndexType input_stride;
1341 IndexType output_stride;
1342 IndexType input_span;
1343 IndexType output_span;
1349 static int NumSqueezableInnerDims(
const DimensionsMap& dim_map) {
1350 int num_squeezable_dims = 0;
1351 for (
int i = 0;
i < NumDims; ++
i) {
1352 const int dim = IsColMajor ?
i : NumDims -
i - 1;
1353 if (dim_map[dim] != dim)
break;
1354 num_squeezable_dims++;
1356 return num_squeezable_dims;
1379template <
typename Scalar,
int NumDims,
typename TensorBlockExpr,
1393 template <
bool Vectorizable,
typename Evaluator>
1394 struct InnerDimAssign {
1396 const Evaluator&
eval,
1398 for (IndexType
i = 0;
i <
count; ++
i) {
1404 template <
typename Evaluator>
1405 struct InnerDimAssign<
true, Evaluator> {
1407 const Evaluator&
eval,
1416 for (
int j = 0;
j < 4; ++
j) {
1455 template <
typename TargetDimsIndexType,
typename TargetStr
idesIndexType>
1474 static const int Layout = TensorBlockEvaluator::Layout;
1478 const IndexType output_size = NumDims == 0 ? 1 :
target.dims.TotalSize();
1487 for (
Index i = 1;
i < NumDims; ++
i) {
1522 InnerDimAssign<Vectorizable && TensorBlockEvaluator::PacketAccess,
1531 for (
int j = 0;
j <
idx; ++
j) {
1543 struct BlockIteratorState {
1544 BlockIteratorState()
1545 :
count(0),
size(0), output_stride(0), output_span(0) {}
1549 IndexType output_stride;
1550 IndexType output_span;
int i
Definition BiCGSTAB_step_by_step.cpp:9
#define EIGEN_RESTRICT
Definition Macros.h:1160
#define EIGEN_ALWAYS_INLINE
Definition Macros.h:932
#define EIGEN_UNUSED_VARIABLE(var)
Definition Macros.h:1076
#define EIGEN_DEVICE_FUNC
Definition Macros.h:976
#define eigen_assert(x)
Definition Macros.h:1037
#define EIGEN_STRONG_INLINE
Definition Macros.h:917
#define COPY_INNER_DIM(KIND)
float * p
Definition Tutorial_Map_using.cpp:9
Scalar Scalar int size
Definition benchVecAdd.cpp:17
SCALAR Scalar
Definition bench_gemm.cpp:46
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Definition CwiseBinaryOp.h:84
Definition TensorExpr.h:197
Definition TensorCostModel.h:25
Definition EmulateArray.h:21
Definition TensorBlock.h:993
Kind
Definition TensorBlock.h:1002
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Run(const Dst &dst, const Src &src, const size_t count)
Definition TensorBlock.h:1029
Definition TensorBlock.h:1381
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Run(const Target &target, const TensorBlockExpr &expr)
Definition TensorBlock.h:1465
static Target target(const Dimensions &target_dims, const Dimensions &target_strides, Scalar *target_data, IndexType target_offset=0)
Definition TensorBlock.h:1449
static Target target(const DSizes< TargetDimsIndexType, NumDims > &target_dims, const DSizes< TargetStridesIndexType, NumDims > &target_strides, Scalar *target_data, IndexType target_offset=0)
Definition TensorBlock.h:1456
Definition TensorBlock.h:202
const Dimensions & strides() const
Definition TensorBlock.h:241
DestinationBufferKind
Definition TensorBlock.h:204
@ kEmpty
Definition TensorBlock.h:214
@ kStrided
Definition TensorBlock.h:232
@ kContiguous
Definition TensorBlock.h:220
const DestinationBufferKind & kind() const
Definition TensorBlock.h:242
friend class TensorBlockDescriptor
Definition TensorBlock.h:245
Scalar * data() const
Definition TensorBlock.h:236
Definition TensorBlock.h:188
TensorBlockDescriptor WithOffset(IndexType offset) const
Definition TensorBlock.h:331
void AddDestinationBuffer(Scalar *dst_base, const DSizes< DstStridesIndexType, NumDims > &dst_strides)
Definition TensorBlock.h:313
void AddDestinationBuffer(Scalar *dst_base, const Dimensions &dst_strides)
Definition TensorBlock.h:306
const DestinationBuffer & destination() const
Definition TensorBlock.h:303
DSizes< IndexType, NumDims > Dimensions
Definition TensorBlock.h:190
IndexType size() const
Definition TensorBlock.h:301
IndexType offset() const
Definition TensorBlock.h:298
bool HasDestinationBuffer() const
Definition TensorBlock.h:326
IndexType dimension(int index) const
Definition TensorBlock.h:300
const Dimensions & dimensions() const
Definition TensorBlock.h:299
TensorBlockDescriptor(const IndexType offset, const Dimensions &dimensions, const DestinationBuffer &destination)
Definition TensorBlock.h:287
TensorBlockDescriptor & DropDestinationBuffer()
Definition TensorBlock.h:320
TensorBlockDescriptor(const IndexType offset, const Dimensions &dimensions)
Definition TensorBlock.h:293
Definition TensorBlock.h:1143
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE IndexType Copy(const Dst &dst, const Src &src, const DimensionsMap &dst_to_src_dim_map)
Definition TensorBlock.h:1178
DSizes< IndexType, NumDims > Dimensions
Definition TensorBlock.h:1149
DSizes< int, NumDims > DimensionsMap
Definition TensorBlock.h:1150
static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE IndexType Copy(const Dst &dst, const Src &src)
Definition TensorBlock.h:1321
Definition TensorBlock.h:347
TensorBlockMapper(const DSizes< IndexType, NumDims > &dimensions, const TensorBlockResourceRequirements &requirements)
Definition TensorBlock.h:354
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE IndexType blockCount() const
Definition TensorBlock.h:361
DSizes< IndexType, NumDims > Dimensions
Definition TensorBlock.h:351
TensorBlockMapper()=default
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE IndexType blockTotalSize() const
Definition TensorBlock.h:365
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DSizes< IndexType, NumDims > & blockDimensions() const
Definition TensorBlock.h:370
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE BlockDescriptor blockDescriptor(IndexType block_index) const
Definition TensorBlock.h:375
Definition TensorBlock.h:617
void XprType
Definition TensorBlock.h:619
Definition TensorBlock.h:525
~TensorBlockScratchAllocator()
Definition TensorBlock.h:530
void * allocate(size_t size)
Definition TensorBlock.h:536
TensorBlockScratchAllocator(const Device &device)
Definition TensorBlock.h:527
void reset()
Definition TensorBlock.h:572
Definition TensorBlock.h:866
XprScalar< XprType >::type Scalar
Definition TensorBlock.h:878
TensorCwiseBinaryBlock(const LhsTensorBlock &left_block, const RhsTensorBlock &right_block, const BinaryOp &functor)
Definition TensorBlock.h:880
TensorBlockKind kind() const
Definition TensorBlock.h:887
XprType expr() const
Definition TensorBlock.h:889
void cleanup()
Definition TensorBlock.h:895
const Scalar * data() const
Definition TensorBlock.h:893
conditional< NoArgBlockAccess, void, TensorCwiseBinaryOp< BinaryOp, consttypenameLhsTensorBlock::XprType, consttypenameRhsTensorBlock::XprType > >::type XprType
Definition TensorBlock.h:876
Definition TensorBlock.h:835
const Scalar * data() const
Definition TensorBlock.h:853
XprScalar< XprType >::type Scalar
Definition TensorBlock.h:845
TensorCwiseUnaryBlock(const ArgTensorBlock &arg_block, const UnaryOp &functor)
Definition TensorBlock.h:847
void cleanup()
Definition TensorBlock.h:854
TensorBlockKind kind() const
Definition TensorBlock.h:850
conditional< NoArgBlockAccess, void, TensorCwiseUnaryOp< UnaryOp, consttypenameArgTensorBlock::XprType > >::type XprType
Definition TensorBlock.h:843
XprType expr() const
Definition TensorBlock.h:852
Definition TensorRef.h:81
Definition TensorBlock.h:694
Scalar * data() const
Definition TensorBlock.h:696
const Dimensions & dimensions() const
Definition TensorBlock.h:697
const Dimensions & strides() const
Definition TensorBlock.h:698
TensorMaterializedBlock AsTensorMaterializedBlock() const
Definition TensorBlock.h:700
friend class TensorMaterializedBlock
Definition TensorBlock.h:709
Definition TensorBlock.h:656
TensorMaterializedBlock(TensorBlockKind kind, const Scalar *data, const Dimensions &dimensions, bool valid_expr=true)
Definition TensorBlock.h:661
const Scalar * data() const
Definition TensorBlock.h:681
static EIGEN_STRONG_INLINE TensorMaterializedBlock materialize(const Scalar *data, const DataDimensions &data_dims, TensorBlockDesc &desc, TensorBlockScratch &scratch)
Definition TensorBlock.h:762
TensorBlockKind kind() const
Definition TensorBlock.h:673
static EIGEN_STRONG_INLINE Storage prepareStorage(TensorBlockDesc &desc, TensorBlockScratch &scratch, bool allow_strided_storage=false)
Definition TensorBlock.h:730
const XprType & expr() const
Definition TensorBlock.h:677
internal::TensorBlockDescriptor< NumDims, IndexType > TensorBlockDesc
Definition TensorBlock.h:684
DSizes< IndexType, NumDims > Dimensions
Definition TensorBlock.h:658
TensorMap< const Tensor< Scalar, NumDims, Layout > > XprType
Definition TensorBlock.h:659
void cleanup()
Definition TensorBlock.h:682
Definition TensorBlock.h:943
XprType expr() const
Definition TensorBlock.h:970
TensorBlockKind kind() const
Definition TensorBlock.h:969
TensorTernaryExprBlock(const Arg1TensorBlock &arg1_block, const Arg2TensorBlock &arg2_block, const Arg3TensorBlock &arg3_block, const BlockFactory &factory)
Definition TensorBlock.h:960
const Scalar * data() const
Definition TensorBlock.h:974
conditional< NoArgBlockAccess, void, typenameBlockFactory::templateXprType< Arg1XprType, Arg2XprType, Arg3XprType >::type >::type XprType
Definition TensorBlock.h:956
XprScalar< XprType >::type Scalar
Definition TensorBlock.h:958
void cleanup()
Definition TensorBlock.h:975
Definition TensorBlock.h:912
TensorUnaryExprBlock(const ArgTensorBlock &arg_block, const BlockFactory &factory)
Definition TensorBlock.h:923
XprType expr() const
Definition TensorBlock.h:928
XprScalar< XprType >::type Scalar
Definition TensorBlock.h:921
const Scalar * data() const
Definition TensorBlock.h:929
conditional< NoArgBlockAccess, void, typenameBlockFactory::templateXprType< ArgXprType >::type >::type XprType
Definition TensorBlock.h:919
void cleanup()
Definition TensorBlock.h:930
TensorBlockKind kind() const
Definition TensorBlock.h:927
std::vector< Array2i > sizes
Definition dense_solvers.cpp:12
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate offset
Definition gnuplot_common_settings.hh:64
@ ColMajor
Definition Constants.h:319
RealScalar s
Definition level1_cplx_impl.h:126
TensorBlockKind
Definition TensorBlock.h:589
@ kMaterializedInOutput
Definition TensorBlock.h:610
@ kMaterializedInScratch
Definition TensorBlock.h:601
@ kView
Definition TensorBlock.h:596
@ kExpr
Definition TensorBlock.h:592
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::ptrdiff_t array_prod(const Sizes< Indices... > &)
Definition TensorDimensions.h:140
EIGEN_ALWAYS_INLINE DSizes< IndexType, NumDims > strides(const DSizes< IndexType, NumDims > &dimensions)
Definition TensorBlock.h:26
TensorBlockShapeType
Definition TensorBlock.h:73
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T maxi(const T &x, const T &y)
Definition MathFunctions.h:1091
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)
Definition MathFunctions.h:1083
Namespace containing all symbols from the Eigen library.
Definition bench_norm.cpp:85
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool dimensions_match(Dims1 dims1, Dims2 dims2)
Definition TensorDimensions.h:484
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T divup(const X x, const Y y)
Definition TensorMeta.h:30
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
Definition BandTriangularSolver.h:13
uint8_t count
Definition ref_serial.h:256
Definition TensorDimensions.h:263
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DenseIndex TotalSize() const
Definition TensorDimensions.h:271
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rank() const
Definition TensorDimensions.h:267
Definition TensorDeviceDefault.h:17
Definition TensorBlock.h:1011
Dst(IndexType o, IndexType s, Scalar *d)
Definition TensorBlock.h:1012
IndexType offset
Definition TensorBlock.h:1014
Scalar * data
Definition TensorBlock.h:1016
IndexType stride
Definition TensorBlock.h:1015
Definition TensorBlock.h:1019
const Scalar * data
Definition TensorBlock.h:1025
Src(IndexType o, IndexType s, const Scalar *d)
Definition TensorBlock.h:1020
IndexType offset
Definition TensorBlock.h:1023
IndexType stride
Definition TensorBlock.h:1024
Definition TensorBlock.h:1435
Dimensions strides
Definition TensorBlock.h:1444
Dimensions dims
Definition TensorBlock.h:1443
Scalar * data
Definition TensorBlock.h:1445
Target(const Dimensions &target_dims, const Dimensions &target_strides, Scalar *target_data, IndexType target_offset=0)
Definition TensorBlock.h:1436
IndexType offset
Definition TensorBlock.h:1446
Definition TensorBlock.h:1152
IndexType offset
Definition TensorBlock.h:1160
Dimensions strides
Definition TensorBlock.h:1158
Dimensions dims
Definition TensorBlock.h:1157
Scalar * data
Definition TensorBlock.h:1159
Dst(const Dimensions &dst_dims, const Dimensions &dst_strides, Scalar *dst, IndexType dst_offset=0)
Definition TensorBlock.h:1153
Definition TensorBlock.h:1163
const Scalar * data
Definition TensorBlock.h:1169
Dimensions strides
Definition TensorBlock.h:1168
IndexType offset
Definition TensorBlock.h:1170
Src(const Dimensions &src_strides, const Scalar *src, IndexType src_offset=0)
Definition TensorBlock.h:1164
Definition TensorBlock.h:75
static EIGEN_DEVICE_FUNC TensorBlockResourceRequirements withShapeAndSize(TensorBlockShapeType shape_type, size_t size_in_bytes)
Definition TensorBlock.h:100
static EIGEN_DEVICE_FUNC TensorBlockResourceRequirements withShapeAndSize(TensorBlockShapeType shape_type, size_t size_in_bytes, TensorOpCost cost)
Definition TensorBlock.h:92
static EIGEN_DEVICE_FUNC TensorBlockResourceRequirements skewed(size_t size_in_bytes)
Definition TensorBlock.h:123
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlockResourceRequirements any()
Definition TensorBlock.h:155
size_t size
Definition TensorBlock.h:77
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlockResourceRequirements merge(const TensorBlockResourceRequirements &lhs, const TensorBlockResourceRequirements &rhs)
Definition TensorBlock.h:138
static EIGEN_DEVICE_FUNC TensorBlockResourceRequirements uniform(size_t size_in_bytes)
Definition TensorBlock.h:130
TensorOpCost cost_per_coeff
Definition TensorBlock.h:78
TensorBlockShapeType shape_type
Definition TensorBlock.h:76
EIGEN_DEVICE_FUNC TensorBlockResourceRequirements & addCostPerCoeff(TensorOpCost cost)
Definition TensorBlock.h:145
void type
Definition TensorBlock.h:633
Definition TensorBlock.h:628
XprType::Scalar type
Definition TensorBlock.h:629
Definition XprHelper.h:332
Definition GenericPacketMath.h:107
Definition ForwardDeclarations.h:17
std::ptrdiff_t j
Definition tut_arithmetic_redux_minmax.cpp:2
Definition PacketMath.h:47