aboutsummaryrefslogtreecommitdiffstats
path: root/eval/src/vespa/eval/instruction/fast_rename_optimizer.h
blob: eb5bc116b7cd3207d6747bfec9e1be1f4a2f0ffa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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 optimizer for efficient non-transposing renames.
 **/
struct FastRenameOptimizer {
    static bool is_stable_rename(const ValueType &from_type, const ValueType &to_type,
                                 const std::vector<vespalib::string> &from,
                                 const std::vector<vespalib::string> &to);
    static const TensorFunction &optimize(const TensorFunction &expr, Stash &stash);
};

} // namespace vespalib::eval