diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-03-31 13:09:23 -0700 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-03-31 13:09:23 -0700 |
commit | f197813f370c7977bdd6023c13e08dfaf1f9498d (patch) | |
tree | 950e2a0738a29235fd266d8a15f6efe4610ae3d9 | |
parent | 0f5cc504fe2e024c723943c55cf87eedfe12dd8f (diff) |
Added the ability to hash a fp16
-rw-r--r-- | Eigen/src/Core/arch/CUDA/Half.h | 7 |
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 |