summaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2021-02-02 11:31:56 +0100
committerTor Egge <Tor.Egge@broadpark.no>2021-02-02 11:31:56 +0100
commitd31f955c0f8f95cc4fa9fcff3146eca36f31268e (patch)
treee77e1b78a7f9ca7a457d5b70c5b48463a7edf0a1 /eval
parent10a9d8ec4d23b0ec8d1fa58d1ba148258f5f2bcb (diff)
Check for availability of attribute before using it.
Diffstat (limited to 'eval')
-rw-r--r--eval/src/vespa/eval/instruction/sparse_dot_product_function.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/eval/src/vespa/eval/instruction/sparse_dot_product_function.cpp b/eval/src/vespa/eval/instruction/sparse_dot_product_function.cpp
index 1c9e552521d..93ae2856372 100644
--- a/eval/src/vespa/eval/instruction/sparse_dot_product_function.cpp
+++ b/eval/src/vespa/eval/instruction/sparse_dot_product_function.cpp
@@ -35,7 +35,9 @@ void my_sparse_dot_product_op(InterpretedFunction::State &state, uint64_t num_ma
const LCT *lhs_cells = state.peek(1).cells().typify<LCT>().cbegin();
const RCT *rhs_cells = state.peek(0).cells().typify<RCT>().cbegin();
if (auto indexes = detect_type<FastValueIndex>(lhs_idx, rhs_idx)) {
+#if __has_cpp_attribute(likely)
[[likely]];
+#endif
const auto &lhs_fast = indexes.get<0>();
const auto &rhs_fast = indexes.get<1>();
double result = (rhs_fast.map.size() < lhs_fast.map.size())
@@ -43,7 +45,9 @@ void my_sparse_dot_product_op(InterpretedFunction::State &state, uint64_t num_ma
: my_fast_sparse_dot_product(lhs_fast, rhs_fast, lhs_cells, rhs_cells);
state.pop_pop_push(state.stash.create<ScalarValue<double>>(result));
} else {
+#if __has_cpp_attribute(unlikely)
[[unlikely]];
+#endif
double result = 0.0;
SparseJoinPlan plan(num_mapped_dims);
SparseJoinState sparse(plan, lhs_idx, rhs_idx);