summaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-12-20 19:25:28 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2018-01-10 11:37:05 +0100
commit383885b34791e120e2feb5686006f33b9924f359 (patch)
tree93f9978b8e939dd42a1b6f4a2b7d1967448b5e9f /eval
parent1a03533217f012dc84a9d7a8a3768a4b155c5ca0 (diff)
Use XXH32 for hashing.
Diffstat (limited to 'eval')
-rw-r--r--eval/src/vespa/eval/tensor/sparse/sparse_tensor_address_ref.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/eval/src/vespa/eval/tensor/sparse/sparse_tensor_address_ref.h b/eval/src/vespa/eval/tensor/sparse/sparse_tensor_address_ref.h
index 321690085be..91a5307d9d0 100644
--- a/eval/src/vespa/eval/tensor/sparse/sparse_tensor_address_ref.h
+++ b/eval/src/vespa/eval/tensor/sparse/sparse_tensor_address_ref.h
@@ -3,14 +3,10 @@
#pragma once
#include <vespa/vespalib/util/stash.h>
+#include <vespa/vespalib/xxhash/xxhash.h>
#include <cstring>
-namespace vespalib {
-
-// From vespalib/util/hashmap.h
-size_t hashValue(const void * buf, size_t sz);
-
-namespace tensor {
+namespace vespalib::tensor {
/**
* A reference to a compact sparse immutable address to a tensor cell.
@@ -44,7 +40,7 @@ public:
uint32_t hash() const { return _hash; }
- uint32_t calcHash() const { return hashValue(_start, _size); }
+ uint32_t calcHash() const { return XXH32(_start, _size, 0); }
bool operator<(const SparseTensorAddressRef &rhs) const {
size_t minSize = std::min(_size, rhs._size);
@@ -67,5 +63,4 @@ public:
uint32_t size() const { return _size; }
};
-} // namespace vespalib::tensor
-} // namespace vespalib
+}