From f197813f370c7977bdd6023c13e08dfaf1f9498d Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Thu, 31 Mar 2016 13:09:23 -0700 Subject: Added the ability to hash a fp16 --- Eigen/src/Core/arch/CUDA/Half.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Eigen') diff --git a/Eigen/src/Core/arch/CUDA/Half.h b/Eigen/src/Core/arch/CUDA/Half.h index a2a2bac37..44645522a 100644 --- a/Eigen/src/Core/arch/CUDA/Half.h +++ b/Eigen/src/Core/arch/CUDA/Half.h @@ -414,6 +414,13 @@ using ::log; using ::sqrt; using ::floor; using ::ceil; +template <> + +struct hash { + size_t operator()(const Eigen::half& a) const { + return std::hash()(a.x); + } +}; } // end namespace std -- cgit v1.2.3