Skip to content

Commit 1bf03cb

Browse files
committed
Use MPI_BYTE for unknown types
1 parent fc25da1 commit 1bf03cb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/impl/KokkosComm_types.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ template <typename Scalar>
2525
MPI_Datatype mpi_type() {
2626
using T = std::decay_t<Scalar>;
2727

28-
if constexpr (std::is_same_v<T, std::byte>)
29-
return MPI_BYTE;
30-
31-
else if constexpr (std::is_same_v<T, char>)
28+
if constexpr (std::is_same_v<T, char>)
3229
return MPI_CHAR;
3330
else if constexpr (std::is_same_v<T, unsigned char>)
3431
return MPI_UNSIGNED_CHAR;
@@ -99,6 +96,9 @@ MPI_Datatype mpi_type() {
9996
else if constexpr (std::is_same_v<T, Kokkos::complex<double>>)
10097
return MPI_DOUBLE_COMPLEX;
10198

99+
else if constexpr (std::is_trivially_copyable_v<T>)
100+
return MPI_BYTE;
101+
102102
else {
103103
static_assert(std::is_void_v<T>, "mpi_type not implemented");
104104
return MPI_CHAR; // unreachable

0 commit comments

Comments
 (0)