mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-24 02:29:33 +08:00
Explicitly construct tensor block dimensions from evaluator dimensions
This commit is contained in:
parent
281e631839
commit
4863375723
@ -282,8 +282,9 @@ class TensorExecutor<Expression, ThreadPoolDevice, Vectorizable, /*Tileable*/ tr
|
|||||||
TensorOpCost cost = evaluator.costPerCoeff(Vectorizable);
|
TensorOpCost cost = evaluator.costPerCoeff(Vectorizable);
|
||||||
double taskSize = TensorCostModel<ThreadPoolDevice>::taskSize(1, cost);
|
double taskSize = TensorCostModel<ThreadPoolDevice>::taskSize(1, cost);
|
||||||
size_t block_size = static_cast<size_t>(1.0 / taskSize);
|
size_t block_size = static_cast<size_t>(1.0 / taskSize);
|
||||||
TensorBlockMapper block_mapper(evaluator.dimensions(), block_shape,
|
TensorBlockMapper block_mapper(
|
||||||
block_size);
|
typename TensorBlockMapper::Dimensions(evaluator.dimensions()),
|
||||||
|
block_shape, block_size);
|
||||||
block_size = block_mapper.block_dims_total_size();
|
block_size = block_mapper.block_dims_total_size();
|
||||||
const size_t aligned_blocksize =
|
const size_t aligned_blocksize =
|
||||||
EIGEN_MAX_ALIGN_BYTES *
|
EIGEN_MAX_ALIGN_BYTES *
|
||||||
|
@ -976,7 +976,8 @@ struct TensorEvaluator<const TensorReductionOp<Op, Dims, ArgType, MakePointer_>,
|
|||||||
// find that scattered reads are not worth supporting in
|
// find that scattered reads are not worth supporting in
|
||||||
// TensorSliceBlockMapper.
|
// TensorSliceBlockMapper.
|
||||||
TensorSliceBlockMapper block_mapper(
|
TensorSliceBlockMapper block_mapper(
|
||||||
input_tensor_dims, tensor_slice_offsets, tensor_slice_extents,
|
typename TensorSliceBlockMapper::Dimensions(input_tensor_dims),
|
||||||
|
tensor_slice_offsets, tensor_slice_extents,
|
||||||
target_input_block_sizes, DimensionList<Index, NumInputDims>());
|
target_input_block_sizes, DimensionList<Index, NumInputDims>());
|
||||||
|
|
||||||
const Index num_outputs_to_update =
|
const Index num_outputs_to_update =
|
||||||
@ -1232,7 +1233,6 @@ struct TensorEvaluator<const TensorReductionOp<Op, Dims, ArgType, MakePointer_>,
|
|||||||
} else if (!first_preserved_dim_allocated) {
|
} else if (!first_preserved_dim_allocated) {
|
||||||
// TODO(andydavis) Include output block size in this L1 working set
|
// TODO(andydavis) Include output block size in this L1 working set
|
||||||
// calculation.
|
// calculation.
|
||||||
const Index allocated = max_coeff_count - coeff_to_allocate;
|
|
||||||
const Index alloc_size = numext::maxi(
|
const Index alloc_size = numext::maxi(
|
||||||
static_cast<Index>(1), coeff_to_allocate / reducer_overhead);
|
static_cast<Index>(1), coeff_to_allocate / reducer_overhead);
|
||||||
(*target_input_block_sizes)[dim] =
|
(*target_input_block_sizes)[dim] =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user