diff options
author | Tor Egge <Tor.Egge@online.no> | 2023-02-23 11:33:31 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2023-02-23 11:33:31 +0100 |
commit | 7734ba98906e0c956d2e3f09bd358886d79a5f14 (patch) | |
tree | bb9cbf847362688809a50165e110cbc82b93636e /eval | |
parent | f66f816102ce0a7c3aaba72d1db61a83157259ed (diff) |
Move FastValueView to separate files.
Diffstat (limited to 'eval')
-rw-r--r-- | eval/src/vespa/eval/eval/fast_value.hpp | 12 | ||||
-rw-r--r-- | eval/src/vespa/eval/eval/fast_value_index.h | 24 |
2 files changed, 25 insertions, 11 deletions
diff --git a/eval/src/vespa/eval/eval/fast_value.hpp b/eval/src/vespa/eval/eval/fast_value.hpp index 2eaefa3670c..47f99d19055 100644 --- a/eval/src/vespa/eval/eval/fast_value.hpp +++ b/eval/src/vespa/eval/eval/fast_value.hpp @@ -1,7 +1,7 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "value_builder_factory.h" -#include "fast_addr_map.h" +#include "fast_value_index.h" #include "inline_operation.h" #include <vespa/eval/instruction/generic_join.h> #include <vespa/vespalib/stllike/hashtable.hpp> @@ -12,16 +12,6 @@ namespace vespalib::eval { //----------------------------------------------------------------------------- -// This is the class instructions will look for when optimizing sparse -// operations by calling inline functions directly. -struct FastValueIndex final : Value::Index { - FastAddrMap map; - FastValueIndex(size_t num_mapped_dims_in, const StringIdVector &labels, size_t expected_subspaces_in) - : map(num_mapped_dims_in, labels, expected_subspaces_in) {} - size_t size() const override { return map.size(); } - std::unique_ptr<View> create_view(ConstArrayRef<size_t> dims) const override; -}; - inline bool is_fast(const Value::Index &index) { return (std::type_index(typeid(index)) == std::type_index(typeid(FastValueIndex))); } diff --git a/eval/src/vespa/eval/eval/fast_value_index.h b/eval/src/vespa/eval/eval/fast_value_index.h new file mode 100644 index 00000000000..edf96490db6 --- /dev/null +++ b/eval/src/vespa/eval/eval/fast_value_index.h @@ -0,0 +1,24 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#pragma once + +#include "value.h" +#include "fast_addr_map.h" + +namespace vespalib::eval { + +/* + * Tensor value index, used to map labels to dense subspace indexes. + * + * This is the class instructions will look for when optimizing sparse + * operations by calling inline functions directly. + */ +struct FastValueIndex final : Value::Index { + FastAddrMap map; + FastValueIndex(size_t num_mapped_dims_in, const StringIdVector &labels, size_t expected_subspaces_in) + : map(num_mapped_dims_in, labels, expected_subspaces_in) {} + size_t size() const override { return map.size(); } + std::unique_ptr<View> create_view(ConstArrayRef<size_t> dims) const override; +}; + +} |