Skip to content

Commit

Permalink
#1544: Add unit test for Collection with indicies over 3 dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobDomagala committed Mar 14, 2022
1 parent 176190c commit 97e1015
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/vt/topos/mapping/dense/dense.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ using IdxPtr = Index*;
template <typename T = IdxBase> using Idx1DPtr = IdxType1D<T>*;
template <typename T = IdxBase> using Idx2DPtr = IdxType2D<T>*;
template <typename T = IdxBase> using Idx3DPtr = IdxType3D<T>*;
template <typename T, typename N> using IdxNDPtr = vt::index::IdxType<T, N>*;

template <typename Idx, index::NumDimensionsType ndim>
NodeType denseBlockMap(IdxPtr<Idx> idx, IdxPtr<Idx> max_idx, NodeType nnodes);
Expand All @@ -84,6 +85,8 @@ template <typename T = IdxBase>
NodeType defaultDenseIndex2DMap(Idx2DPtr<T> idx, Idx2DPtr<T> max, NodeType n);
template <typename T = IdxBase>
NodeType defaultDenseIndex3DMap(Idx3DPtr<T> idx, Idx3DPtr<T> max, NodeType n);
template <typename T, typename N>
NodeType defaultDenseIndex3DMap(IdxNDPtr<T,N> idx, IdxNDPtr<T,N> max, NodeType n);

template <typename T = IdxBase>
NodeType dense1DRoundRobinMap( Idx1DPtr<T> idx, Idx1DPtr<T> max, NodeType n);
Expand Down
17 changes: 17 additions & 0 deletions tests/unit/collection/test_construct.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,23 @@ struct ColMsg : CollectionMessage<TestCol> { };
using CollectionTestTypes = testing::Types<default_::TestCol>;
using CollectionTestDistTypes = testing::Types<default_::TestCol>;

using TestRange = vt::index::IdxType<vt::IdxBase, 4>;
struct TestColMulti : Collection<TestColMulti, TestRange>{

};

struct TestCollectionConst : TestParallelHarness {};

TEST_F(TestCollectionConst, test_collection_create) {
auto rng = TestRange(6, 6, 6, 6);
theCollection()->constructCollective<TestColMulti>(
rng,[=](TestRange my_idx) {
return std::make_unique<TestColMulti>();
}
);
// auto proxy = ConstructParams<TestColMulti>::constructCollective(rng);
}

INSTANTIATE_TYPED_TEST_SUITE_P(
test_construct_simple, TestConstruct, CollectionTestTypes, DEFAULT_NAME_GEN
);
Expand Down
1 change: 1 addition & 0 deletions tests/unit/collection/test_construct_no_idx.extended.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ struct ColMsg;
struct TestCol : Collection<TestCol,vt::Index1D> {
using MsgType = ColMsg;
};

struct ColMsg : CollectionMessage<TestCol> {};
} /* end namespace multi_param_no_idx_ */

Expand Down

0 comments on commit 97e1015

Please sign in to comment.