1818
1919#include " KokkosComm.hpp"
2020
21+ namespace {
22+
2123template <typename T>
2224class Allgather : public testing ::Test {
2325 public:
@@ -27,17 +29,14 @@ class Allgather : public testing::Test {
2729using ScalarTypes = ::testing::Types<int , int64_t , float , double , Kokkos::complex <float >, Kokkos::complex <double >>;
2830TYPED_TEST_SUITE (Allgather, ScalarTypes);
2931
30- TYPED_TEST (Allgather, 0D) {
31- using TestScalar = typename TestFixture::Scalar;
32-
32+ template <typename Scalar>
33+ void test_allgather_0d () {
3334 int rank, size;
3435 MPI_Comm_rank (MPI_COMM_WORLD, &rank);
3536 MPI_Comm_size (MPI_COMM_WORLD, &size);
3637
37- const int nContrib = 10 ;
38-
39- Kokkos::View<TestScalar> sv (" sv" );
40- Kokkos::View<TestScalar *> rv (" rv" , size);
38+ Kokkos::View<Scalar> sv (" sv" );
39+ Kokkos::View<Scalar *> rv (" rv" , size);
4140
4241 // fill send buffer
4342 Kokkos::parallel_for (
@@ -51,17 +50,18 @@ TYPED_TEST(Allgather, 0D) {
5150 EXPECT_EQ (errs, 0 );
5251}
5352
54- TYPED_TEST (Allgather, 1D_contig) {
55- using TestScalar = typename TestFixture::Scalar;
53+ TYPED_TEST (Allgather, 0D) { test_allgather_0d<typename TestFixture::Scalar>(); }
5654
55+ template <typename Scalar>
56+ void test_allgather_1d_contig () {
5757 int rank, size;
5858 MPI_Comm_rank (MPI_COMM_WORLD, &rank);
5959 MPI_Comm_size (MPI_COMM_WORLD, &size);
6060
6161 const int nContrib = 10 ;
6262
63- Kokkos::View<TestScalar *> sv (" sv" , nContrib);
64- Kokkos::View<TestScalar *> rv (" rv" , size * nContrib);
63+ Kokkos::View<Scalar *> sv (" sv" , nContrib);
64+ Kokkos::View<Scalar *> rv (" rv" , size * nContrib);
6565
6666 // fill send buffer
6767 Kokkos::parallel_for (
@@ -80,3 +80,7 @@ TYPED_TEST(Allgather, 1D_contig) {
8080 errs);
8181 EXPECT_EQ (errs, 0 );
8282}
83+
84+ TYPED_TEST (Allgather, 1D_contig) { test_allgather_1d_contig<typename TestFixture::Scalar>(); }
85+
86+ } // namespace
0 commit comments