From 8c39827061c12598130e21129f162b6273a2a22b Mon Sep 17 00:00:00 2001 From: Alejandro Gallo Date: Thu, 27 Jan 2022 20:39:00 +0100 Subject: [PATCH] Add type traits --- atrip.org | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/atrip.org b/atrip.org index 30be0ca..43a7f04 100644 --- a/atrip.org +++ b/atrip.org @@ -8,7 +8,6 @@ The algorithm uses two main data types, the =Slice= and the ** The slice - #+begin_src c++ :tangle (atrip-slice-h) #pragma once #include @@ -18,9 +17,20 @@ The algorithm uses two main data types, the =Slice= and the #include #include +#include namespace atrip { +namespace traits { + template bool isComplex() { return false; }; + template <> bool isComplex() { return true; }; +namespace mpi { + template MPI_Datatype datatypeOf(void); + template <> MPI_Datatype datatypeOf() { return MPI_DOUBLE; } + template <> MPI_Datatype datatypeOf() { return MPI_DOUBLE_COMPLEX; } +} +} + struct Slice {