From 97e101587b3c4c59f7855bfcb95f0a4f9bc271bf Mon Sep 17 00:00:00 2001 From: Jacob Domagala Date: Mon, 14 Mar 2022 21:27:54 +0100 Subject: [PATCH] #1544: Add unit test for Collection with indicies over 3 dimensions --- src/vt/topos/mapping/dense/dense.h | 3 +++ tests/unit/collection/test_construct.cc | 17 +++++++++++++++++ .../test_construct_no_idx.extended.cc | 1 + 3 files changed, 21 insertions(+) diff --git a/src/vt/topos/mapping/dense/dense.h b/src/vt/topos/mapping/dense/dense.h index ed819498e2..83598acfab 100644 --- a/src/vt/topos/mapping/dense/dense.h +++ b/src/vt/topos/mapping/dense/dense.h @@ -74,6 +74,7 @@ using IdxPtr = Index*; template using Idx1DPtr = IdxType1D*; template using Idx2DPtr = IdxType2D*; template using Idx3DPtr = IdxType3D*; +template using IdxNDPtr = vt::index::IdxType*; template NodeType denseBlockMap(IdxPtr idx, IdxPtr max_idx, NodeType nnodes); @@ -84,6 +85,8 @@ template NodeType defaultDenseIndex2DMap(Idx2DPtr idx, Idx2DPtr max, NodeType n); template NodeType defaultDenseIndex3DMap(Idx3DPtr idx, Idx3DPtr max, NodeType n); +template +NodeType defaultDenseIndex3DMap(IdxNDPtr idx, IdxNDPtr max, NodeType n); template NodeType dense1DRoundRobinMap( Idx1DPtr idx, Idx1DPtr max, NodeType n); diff --git a/tests/unit/collection/test_construct.cc b/tests/unit/collection/test_construct.cc index db6065eabe..21250b5170 100644 --- a/tests/unit/collection/test_construct.cc +++ b/tests/unit/collection/test_construct.cc @@ -64,6 +64,23 @@ struct ColMsg : CollectionMessage { }; using CollectionTestTypes = testing::Types; using CollectionTestDistTypes = testing::Types; +using TestRange = vt::index::IdxType; +struct TestColMulti : Collection{ + +}; + +struct TestCollectionConst : TestParallelHarness {}; + +TEST_F(TestCollectionConst, test_collection_create) { + auto rng = TestRange(6, 6, 6, 6); + theCollection()->constructCollective( + rng,[=](TestRange my_idx) { + return std::make_unique(); + } + ); + // auto proxy = ConstructParams::constructCollective(rng); +} + INSTANTIATE_TYPED_TEST_SUITE_P( test_construct_simple, TestConstruct, CollectionTestTypes, DEFAULT_NAME_GEN ); diff --git a/tests/unit/collection/test_construct_no_idx.extended.cc b/tests/unit/collection/test_construct_no_idx.extended.cc index bc96984b3e..321b2f9256 100644 --- a/tests/unit/collection/test_construct_no_idx.extended.cc +++ b/tests/unit/collection/test_construct_no_idx.extended.cc @@ -57,6 +57,7 @@ struct ColMsg; struct TestCol : Collection { using MsgType = ColMsg; }; + struct ColMsg : CollectionMessage {}; } /* end namespace multi_param_no_idx_ */