aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/test/cxx11_tensor_block_eval.cpp
diff options
context:
space:
mode:
authorGravatar Eugene Zhulenev <ezhulenev@google.com>2019-12-10 11:58:30 -0800
committerGravatar Eugene Zhulenev <ezhulenev@google.com>2019-12-10 14:31:44 -0800
commitdbca11e8805ec07660d8f966a1884ad0be302f15 (patch)
tree9da1438132a9a40de7ca3abafec2e559eb0449e3 /unsupported/test/cxx11_tensor_block_eval.cpp
parentc49f0d851ab77c9e4d782b453b4b0428bce903d3 (diff)
Remove TensorBlock.h and old TensorBlock/BlockMapper
Diffstat (limited to 'unsupported/test/cxx11_tensor_block_eval.cpp')
-rw-r--r--unsupported/test/cxx11_tensor_block_eval.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/unsupported/test/cxx11_tensor_block_eval.cpp b/unsupported/test/cxx11_tensor_block_eval.cpp
index 086dd8c11..700e84a19 100644
--- a/unsupported/test/cxx11_tensor_block_eval.cpp
+++ b/unsupported/test/cxx11_tensor_block_eval.cpp
@@ -61,21 +61,21 @@ static TensorBlockParams<NumDims> RandomBlock(DSizes<Index, NumDims> dims,
template <int Layout, int NumDims>
static TensorBlockParams<NumDims> SkewedInnerBlock(
DSizes<Index, NumDims> dims) {
- using BlockMapper = internal::TensorBlockMapper<int, Index, NumDims, Layout>;
+ using BlockMapper = internal::TensorBlockV2Mapper<NumDims, Layout, Index>;
BlockMapper block_mapper(dims,
- internal::TensorBlockShapeType::kSkewedInnerDims,
- internal::random<Index>(1, dims.TotalSize()));
+ {internal::TensorBlockV2ShapeType::kSkewedInnerDims,
+ internal::random<size_t>(1, dims.TotalSize())});
- Index total_blocks = block_mapper.total_block_count();
+ Index total_blocks = block_mapper.blockCount();
Index block_index = internal::random<Index>(0, total_blocks - 1);
- auto block = block_mapper.GetBlockForIndex(block_index, nullptr);
- DSizes<Index, NumDims> sizes = block.block_sizes();
+ auto block = block_mapper.blockDescriptor(block_index);
+ DSizes<Index, NumDims> sizes = block.dimensions();
auto strides = internal::strides<Layout>(dims);
DSizes<Index, NumDims> offsets;
// Compute offsets for the first block coefficient.
- Index index = block.first_coeff_index();
+ Index index = block.offset();
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
for (int i = NumDims - 1; i > 0; --i) {
const Index idx = index / strides[i];
@@ -92,8 +92,7 @@ static TensorBlockParams<NumDims> SkewedInnerBlock(
if (NumDims > 0) offsets[NumDims - 1] = index;
}
- auto desc = TensorBlockDescriptor<NumDims>(block.first_coeff_index(), sizes);
- return {offsets, sizes, desc};
+ return {offsets, sizes, block};
}
template <int NumDims>