mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Remove V2 suffix from TensorBlock
This commit is contained in:
@@ -114,7 +114,7 @@ struct TensorEvaluator<const TensorBroadcastingOp<Broadcast, ArgType>, Device>
|
||||
enum {
|
||||
IsAligned = true,
|
||||
PacketAccess = TensorEvaluator<ArgType, Device>::PacketAccess,
|
||||
BlockAccessV2 = TensorEvaluator<ArgType, Device>::BlockAccessV2,
|
||||
BlockAccess = TensorEvaluator<ArgType, Device>::BlockAccess,
|
||||
PreferBlockAccess = true,
|
||||
Layout = TensorEvaluator<ArgType, Device>::Layout,
|
||||
RawAccess = false
|
||||
@@ -130,12 +130,12 @@ struct TensorEvaluator<const TensorBroadcastingOp<Broadcast, ArgType>, Device>
|
||||
typedef internal::TensorBlockDescriptor<NumDims, Index> TensorBlockDesc;
|
||||
typedef internal::TensorBlockScratchAllocator<Device> TensorBlockScratch;
|
||||
|
||||
typedef typename TensorEvaluator<const ArgType, Device>::TensorBlockV2
|
||||
typedef typename TensorEvaluator<const ArgType, Device>::TensorBlock
|
||||
ArgTensorBlock;
|
||||
|
||||
typedef typename internal::TensorMaterializedBlock<ScalarNoConst, NumDims,
|
||||
Layout, Index>
|
||||
TensorBlockV2;
|
||||
TensorBlock;
|
||||
//===--------------------------------------------------------------------===//
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op,
|
||||
@@ -617,19 +617,19 @@ struct TensorEvaluator<const TensorBroadcastingOp<Broadcast, ArgType>, Device>
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
internal::TensorBlockV2ResourceRequirements getResourceRequirements() const {
|
||||
internal::TensorBlockResourceRequirements getResourceRequirements() const {
|
||||
// TODO(wuke): Targeting L1 size is 30% faster than targeting L{-1} on large
|
||||
// tensors. But this might need further tuning.
|
||||
const size_t target_block_size = numext::maxi<size_t>(
|
||||
1, m_device.firstLevelCacheSize() / sizeof(Scalar));
|
||||
|
||||
return internal::TensorBlockV2ResourceRequirements::merge(
|
||||
{internal::TensorBlockV2ShapeType::kSkewedInnerDims, target_block_size},
|
||||
return internal::TensorBlockResourceRequirements::merge(
|
||||
{internal::TensorBlockShapeType::kSkewedInnerDims, target_block_size},
|
||||
m_impl.getResourceRequirements());
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlockV2
|
||||
blockV2(TensorBlockDesc& desc, TensorBlockScratch& scratch,
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlock
|
||||
block(TensorBlockDesc& desc, TensorBlockScratch& scratch,
|
||||
bool /*root_of_expr_ast*/ = false) const {
|
||||
BlockBroadcastingParams params = blockBroadcastingParams(desc);
|
||||
|
||||
@@ -638,8 +638,8 @@ struct TensorEvaluator<const TensorBroadcastingOp<Broadcast, ArgType>, Device>
|
||||
}
|
||||
|
||||
// Prepare storage for the materialized broadcasting result.
|
||||
const typename TensorBlockV2::Storage block_storage =
|
||||
TensorBlockV2::prepareStorage(desc, scratch);
|
||||
const typename TensorBlock::Storage block_storage =
|
||||
TensorBlock::prepareStorage(desc, scratch);
|
||||
ScalarNoConst* materialized_output = block_storage.data();
|
||||
|
||||
// We potentially will need to materialize input blocks.
|
||||
@@ -843,10 +843,10 @@ struct TensorEvaluator<const TensorBroadcastingOp<Broadcast, ArgType>, Device>
|
||||
return params;
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlockV2 emptyBlock() const {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlock emptyBlock() const {
|
||||
DSizes<Index, NumDims> dimensions;
|
||||
for (int i = 0; i < NumDims; ++i) dimensions[i] = 0;
|
||||
return TensorBlockV2(internal::TensorBlockKind::kView, NULL, dimensions);
|
||||
return TensorBlock(internal::TensorBlockKind::kView, NULL, dimensions);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index BroadcastBlockAlongBcastDim(
|
||||
@@ -856,7 +856,7 @@ struct TensorEvaluator<const TensorBroadcastingOp<Broadcast, ArgType>, Device>
|
||||
size_t* materialized_input_size) const {
|
||||
if (params.bcast_dim_size == 1) {
|
||||
// We just need one block read using the ready-set values above.
|
||||
return BroadcastBlockV2(
|
||||
return BroadcastBlock(
|
||||
params.input_block_sizes, params.input_block_strides,
|
||||
params.bcast_block_sizes, params.bcast_block_strides,
|
||||
params.bcast_input_strides, bcast_offset, 0, scratch,
|
||||
@@ -873,7 +873,7 @@ struct TensorEvaluator<const TensorBroadcastingOp<Broadcast, ArgType>, Device>
|
||||
params.bcast_block_strides[broadcast_bcast_dim] =
|
||||
params.output_strides[params.bcast_dim];
|
||||
|
||||
return BroadcastBlockV2(
|
||||
return BroadcastBlock(
|
||||
params.input_block_sizes, params.input_block_strides,
|
||||
params.bcast_block_sizes, params.bcast_block_strides,
|
||||
params.bcast_input_strides, bcast_offset, 0, scratch,
|
||||
@@ -942,7 +942,7 @@ struct TensorEvaluator<const TensorBroadcastingOp<Broadcast, ArgType>, Device>
|
||||
params.output_strides[params.bcast_dim] *
|
||||
params.input_dims[params.bcast_dim];
|
||||
|
||||
num_output_coeffs += BroadcastBlockV2(
|
||||
num_output_coeffs += BroadcastBlock(
|
||||
params.input_block_sizes, params.input_block_strides,
|
||||
params.bcast_block_sizes, params.bcast_block_strides,
|
||||
params.bcast_input_strides, bcast_offset, 0, scratch,
|
||||
@@ -964,7 +964,7 @@ struct TensorEvaluator<const TensorBroadcastingOp<Broadcast, ArgType>, Device>
|
||||
const Index offset = (first_multiple - bcast_dim_left_index) *
|
||||
m_outputStrides[params.bcast_dim];
|
||||
|
||||
num_output_coeffs += BroadcastBlockV2(
|
||||
num_output_coeffs += BroadcastBlock(
|
||||
params.input_block_sizes, params.input_block_strides,
|
||||
params.bcast_block_sizes, params.bcast_block_strides,
|
||||
params.bcast_input_strides, bcast_offset, offset, scratch,
|
||||
@@ -987,7 +987,7 @@ struct TensorEvaluator<const TensorBroadcastingOp<Broadcast, ArgType>, Device>
|
||||
const Index offset = (last_multiple - bcast_dim_left_index) *
|
||||
m_outputStrides[params.bcast_dim];
|
||||
|
||||
num_output_coeffs += BroadcastBlockV2(
|
||||
num_output_coeffs += BroadcastBlock(
|
||||
params.input_block_sizes, params.input_block_strides,
|
||||
params.bcast_block_sizes, params.bcast_block_strides,
|
||||
params.bcast_input_strides, bcast_offset, offset, scratch,
|
||||
@@ -1005,7 +1005,7 @@ struct TensorEvaluator<const TensorBroadcastingOp<Broadcast, ArgType>, Device>
|
||||
params.bcast_block_strides[copy_bcast_dim] =
|
||||
params.output_strides[params.bcast_dim];
|
||||
|
||||
num_output_coeffs += BroadcastBlockV2(
|
||||
num_output_coeffs += BroadcastBlock(
|
||||
params.input_block_sizes, params.input_block_strides,
|
||||
params.bcast_block_sizes, params.bcast_block_strides,
|
||||
params.bcast_input_strides, bcast_offset, 0, scratch,
|
||||
@@ -1016,7 +1016,7 @@ struct TensorEvaluator<const TensorBroadcastingOp<Broadcast, ArgType>, Device>
|
||||
}
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index BroadcastBlockV2(
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index BroadcastBlock(
|
||||
const Dimensions& input_block_sizes,
|
||||
const Dimensions& input_block_strides,
|
||||
const BroadcastDimensions& bcast_block_sizes,
|
||||
@@ -1032,7 +1032,7 @@ struct TensorEvaluator<const TensorBroadcastingOp<Broadcast, ArgType>, Device>
|
||||
IsColMajor ? indexColMajor(input_offset) : indexRowMajor(input_offset),
|
||||
input_block_sizes);
|
||||
|
||||
ArgTensorBlock input_block = m_impl.blockV2(input_desc, scratch);
|
||||
ArgTensorBlock input_block = m_impl.block(input_desc, scratch);
|
||||
|
||||
// ---------------------------------------------------------------------- //
|
||||
// Materialize input block into a temporary memory buffer only if it's not
|
||||
@@ -1071,14 +1071,14 @@ struct TensorEvaluator<const TensorBroadcastingOp<Broadcast, ArgType>, Device>
|
||||
// ---------------------------------------------------------------------- //
|
||||
// Copy data from materialized input block to the materialized output, using
|
||||
// given broadcast strides (strides with zeroes).
|
||||
typedef internal::TensorBlockIOV2<ScalarNoConst, Index, 2 * NumDims, Layout>
|
||||
TensorBlockIOV2;
|
||||
typedef internal::TensorBlockIO<ScalarNoConst, Index, 2 * NumDims, Layout>
|
||||
TensorBlockIO;
|
||||
|
||||
typename TensorBlockIOV2::Src src(bcast_input_strides, input_buffer);
|
||||
typename TensorBlockIOV2::Dst dst(bcast_block_sizes, bcast_block_strides,
|
||||
typename TensorBlockIO::Src src(bcast_input_strides, input_buffer);
|
||||
typename TensorBlockIO::Dst dst(bcast_block_sizes, bcast_block_strides,
|
||||
materialized_output + offset);
|
||||
|
||||
return TensorBlockIOV2::Copy(dst, src);
|
||||
return TensorBlockIO::Copy(dst, src);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user