From 1bf03cbe777457a6dc8b9a5bd34da5e8b23d900d Mon Sep 17 00:00:00 2001 From: Andrey Prokopenko Date: Tue, 11 Jun 2024 15:20:25 -0400 Subject: [PATCH] Use MPI_BYTE for unknown types --- src/impl/KokkosComm_types.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/impl/KokkosComm_types.hpp b/src/impl/KokkosComm_types.hpp index 548f21de..897816c2 100644 --- a/src/impl/KokkosComm_types.hpp +++ b/src/impl/KokkosComm_types.hpp @@ -25,10 +25,7 @@ template MPI_Datatype mpi_type() { using T = std::decay_t; - if constexpr (std::is_same_v) - return MPI_BYTE; - - else if constexpr (std::is_same_v) + if constexpr (std::is_same_v) return MPI_CHAR; else if constexpr (std::is_same_v) return MPI_UNSIGNED_CHAR; @@ -99,6 +96,9 @@ MPI_Datatype mpi_type() { else if constexpr (std::is_same_v>) return MPI_DOUBLE_COMPLEX; + else if constexpr (std::is_trivially_copyable_v) + return MPI_BYTE; + else { static_assert(std::is_void_v, "mpi_type not implemented"); return MPI_CHAR; // unreachable