Skip to content

Commit bab2df1

Browse files
author
Jack Poulson
committed
Adding missing commit.
1 parent dfc7979 commit bab2df1

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

compiler_bugs/MSVC/constexpr/constexpr.cpp

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,25 @@ enum Dist
2323
CIRC
2424
};
2525

26-
template<Dist U> constexpr Dist Collect() { return STAR; }
27-
template<> constexpr Dist Collect<CIRC>() { return CIRC; }
26+
template<Dist U> constexpr Dist Collect() { return (U == CIRC) ? CIRC : STAR; }
2827

2928
template<typename T,Dist U,Dist V>
3029
class DistMatrix { };
3130

3231
template<typename T,Dist U,Dist V>
3332
void AllGather
34-
( const DistMatrix<T, U, V >& A,
35-
DistMatrix<T,Collect<U>(),Collect<V>()>& B )
36-
{
37-
std::cout << "U=" << U << ", V=" << V << std::endl;
38-
}
33+
(const DistMatrix<T,U,V>& A, DistMatrix<T,Collect<U>(),Collect<V>()>& B)
34+
{ }
35+
36+
#ifdef USE_CONSTEXPR
37+
template void AllGather(const DistMatrix<int,MC,MR>& A, DistMatrix<int,Collect<MC>(),Collect<MR>()>& B);
38+
template void AllGather(const DistMatrix<double,CIRC,CIRC>& A, DistMatrix<double,Collect<CIRC>(),Collect<CIRC>()>& B);
39+
#else
40+
template void AllGather(const DistMatrix<int,MC,MR>& A, DistMatrix<int,STAR,STAR>& B);
41+
template void AllGather(const DistMatrix<double,CIRC,CIRC>& A, DistMatrix<double,CIRC,CIRC>& B);
42+
#endif
3943

40-
int main( int argc, char* argv[] )
44+
int main(int argc, char* argv[])
4145
{
42-
{
43-
DistMatrix<double,MC,MR> A;
44-
DistMatrix<double,STAR,STAR> B;
45-
AllGather( A, B );
46-
}
47-
{
48-
DistMatrix<int,CIRC,CIRC> A;
49-
DistMatrix<int,CIRC,CIRC> B;
50-
AllGather( A, B );
51-
}
52-
return 0;
46+
return 0;
5347
}

0 commit comments

Comments
 (0)