aboutsummaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
Diffstat (limited to 'support')
-rw-r--r--support/ToolchainSupport.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/support/ToolchainSupport.h b/support/ToolchainSupport.h
index ab2a9fe80f..ad09c6535a 100644
--- a/support/ToolchainSupport.h
+++ b/support/ToolchainSupport.h
@@ -34,6 +34,8 @@
#include <string>
#include <type_traits>
+#include "support/Half.h"
+
namespace arm_compute
{
namespace support
@@ -319,6 +321,18 @@ inline void *align(std::size_t alignment, std::size_t size, void *&ptr, std::siz
return ptr = reinterpret_cast<void *>(aligned);
}
+
+// std::isfinite
+template <typename T, typename = typename std::enable_if<std::is_arithmetic<T>::value>::type>
+inline bool isfinite(T value)
+{
+ return std::isfinite(value);
+}
+
+inline bool isfinite(half_float::half value)
+{
+ return half_float::isfinite(value);
+}
} // namespace cpp11
namespace cpp14