HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
hash_combine.h
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License.
3 
4 #pragma once
5 
6 namespace onnxruntime {
7 
8 // Combine hash value `seed` with hash value `h`, updating `seed` in place.
9 // TODO(edgchen1) find a better implementation? e.g., see a more recent version of boost::hash_combine()
10 inline void HashCombineWithHashValue(size_t h, size_t& seed) {
11  seed ^= h + 0x9e3779b9 + (seed << 6) + (seed >> 2);
12 }
13 
14 // Combine hash value `seed` with the hash value of `value`, updating `seed` in place.
15 // The hash value computation is specified by the `Hash` template parameter.
16 template <typename T, typename Hash = std::hash<T>>
17 inline void HashCombine(const T& value, size_t& seed) {
19 }
20 
21 } // namespace onnxruntime
STATIC_INLINE size_t Hash(const char *s, size_t len)
Definition: farmhash.h:2038
GLsizei const GLfloat * value
Definition: glcorearb.h:824
void HashCombine(const T &value, size_t &seed)
Definition: hash_combine.h:17
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2002
void HashCombineWithHashValue(size_t h, size_t &seed)
Definition: hash_combine.h:10
Definition: core.h:1131