From 3cae33ddd061566b8233e52c8dc56e517877ec64 Mon Sep 17 00:00:00 2001 From: Bogdan Teleaga Date: Sat, 12 Jun 2021 13:42:07 +0900 Subject: [PATCH] Add support for complex number datatypes This PR aims to add support for complex number datatypes. Only tested with `std::complex` but I imagine it works just as well with `std::complex`. --- include/cppflow/datatype.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/cppflow/datatype.h b/include/cppflow/datatype.h index 712f767..a02a273 100644 --- a/include/cppflow/datatype.h +++ b/include/cppflow/datatype.h @@ -10,6 +10,7 @@ #include #include #include +#include namespace cppflow { @@ -101,6 +102,10 @@ namespace cppflow { return TF_UINT32; if (std::is_same::value) return TF_UINT64; + if (std::is_same>::value) + return TF_COMPLEX64; + if (std::is_same>::value) + return TF_COMPLEX128; // decode with `c++filt --type $output` for gcc throw std::runtime_error{"Could not deduce type! type_name: " + std::string(typeid(T).name())};