aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-03-31 13:09:23 -0700
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-03-31 13:09:23 -0700
commitf197813f370c7977bdd6023c13e08dfaf1f9498d (patch)
tree950e2a0738a29235fd266d8a15f6efe4610ae3d9 /Eigen
parent0f5cc504fe2e024c723943c55cf87eedfe12dd8f (diff)
Added the ability to hash a fp16
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/Core/arch/CUDA/Half.h7
1 files changed, 7 insertions, 0 deletions
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<Eigen::half> {
+ size_t operator()(const Eigen::half& a) const {
+ return std::hash<unsigned short>()(a.x);
+ }
+};
} // end namespace std