diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2021-02-02 15:22:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-02 15:22:33 +0100 |
commit | 4b3b7543f0f8acf3f72d25d76e36d63841de278a (patch) | |
tree | b5aec5105ee8b4ac73f27b768ebe77237970e045 /eval | |
parent | e4aa66d6b83c910d947fab195c62376f6d3c2fdb (diff) | |
parent | d31f955c0f8f95cc4fa9fcff3146eca36f31268e (diff) |
Merge pull request #16331 from vespa-engine/toregge/check-attribute-support
Check for availability of attribute before using it.
Diffstat (limited to 'eval')
-rw-r--r-- | eval/src/vespa/eval/instruction/sparse_dot_product_function.cpp | 4 |
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); |