aboutsummaryrefslogtreecommitdiffstats
path: root/eval/src/vespa/eval/instruction/simple_join_count.h
blob: 75f4b5cfde74bae09a58647a01d37c577a87b44e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/eval/eval/tensor_function.h>

namespace vespalib::eval {

/**
 * Tensor function that will count the number of cells in the result
 * of a join between two tensors with full mapped overlap consisting
 * of a single dimension.
 **/
class SimpleJoinCount : public tensor_function::Op2
{
private:
    uint64_t _dense_factor;
public:
    SimpleJoinCount(const TensorFunction &lhs_in, const TensorFunction &rhs_in, uint64_t dense_factor_in);
    InterpretedFunction::Instruction compile_self(const CTFContext &ctx) const override;
    bool result_is_mutable() const override { return true; }
    uint64_t dense_factor() const { return _dense_factor; }
    static const TensorFunction &optimize(const TensorFunction &expr, Stash &stash);
};

} // namespace