diff options
Diffstat (limited to 'eval/src')
-rw-r--r-- | eval/src/vespa/eval/tensor/dense/dense_generic_join.h (renamed from eval/src/vespa/eval/tensor/dense/dense_tensor_apply.h) | 4 | ||||
-rw-r--r-- | eval/src/vespa/eval/tensor/dense/dense_generic_join.hpp (renamed from eval/src/vespa/eval/tensor/dense/dense_tensor_apply.hpp) | 14 | ||||
-rw-r--r-- | eval/src/vespa/eval/tensor/dense/dense_tensor_view.cpp | 8 |
3 files changed, 13 insertions, 13 deletions
diff --git a/eval/src/vespa/eval/tensor/dense/dense_tensor_apply.h b/eval/src/vespa/eval/tensor/dense/dense_generic_join.h index cd524b27171..daf678d4916 100644 --- a/eval/src/vespa/eval/tensor/dense/dense_tensor_apply.h +++ b/eval/src/vespa/eval/tensor/dense/dense_generic_join.h @@ -15,10 +15,10 @@ namespace vespalib::tensor::dense { */ template <typename Function> std::unique_ptr<Tensor> -apply(const DenseTensorView &lhs, const Tensor &rhs, Function &&func); +generic_join(const DenseTensorView &lhs, const Tensor &rhs, Function &&func); template <typename Function> std::unique_ptr<Tensor> -apply(const DenseTensorView &lhs, const DenseTensorView &rhs, Function &&func); +generic_join(const DenseTensorView &lhs, const DenseTensorView &rhs, Function &&func); } diff --git a/eval/src/vespa/eval/tensor/dense/dense_tensor_apply.hpp b/eval/src/vespa/eval/tensor/dense/dense_generic_join.hpp index 409e1ad087f..aa08e6982bb 100644 --- a/eval/src/vespa/eval/tensor/dense/dense_tensor_apply.hpp +++ b/eval/src/vespa/eval/tensor/dense/dense_generic_join.hpp @@ -2,7 +2,7 @@ #pragma once -#include "dense_tensor_apply.h" +#include "dense_generic_join.h" #include "dense_dimension_combiner.h" #include "typed_dense_tensor_builder.h" @@ -10,14 +10,14 @@ namespace vespalib::tensor::dense { template <typename LCT, typename RCT, typename OCT, typename Function> std::unique_ptr<Tensor> -apply(DenseDimensionCombiner & combiner, +generic_join(DenseDimensionCombiner & combiner, TypedDenseTensorBuilder<OCT> & builder, const ConstArrayRef<LCT> & lhsCells, const ConstArrayRef<RCT> & rhsCells, Function &&func) __attribute__((noinline)); template <typename LCT, typename RCT, typename OCT, typename Function> std::unique_ptr<Tensor> -apply(DenseDimensionCombiner & combiner, +generic_join(DenseDimensionCombiner & combiner, TypedDenseTensorBuilder<OCT> & builder, const ConstArrayRef<LCT> & lhsCells, const ConstArrayRef<RCT> & rhsCells, Function &&func) @@ -35,7 +35,7 @@ apply(DenseDimensionCombiner & combiner, return builder.build(); } -struct CallApply { +struct CallGenericJoin { template <typename LCT, typename RCT, typename Function> static std::unique_ptr<Tensor> call(const ConstArrayRef<LCT> & lhsArr, @@ -45,20 +45,20 @@ struct CallApply { { using OCT = typename OutputCellType<LCT, RCT>::output_type; TypedDenseTensorBuilder<OCT> builder(combiner.result_type); - return apply(combiner, builder, lhsArr, rhsArr, std::move(func)); + return generic_join(combiner, builder, lhsArr, rhsArr, std::move(func)); } }; template <typename Function> std::unique_ptr<Tensor> -apply(const DenseTensorView &lhs, const Tensor &rhs, Function &&func) +generic_join(const DenseTensorView &lhs, const Tensor &rhs, Function &&func) { const DenseTensorView *view = dynamic_cast<const DenseTensorView *>(&rhs); if (view) { DenseDimensionCombiner combiner(lhs.fast_type(), view->fast_type()); TypedCells lhsCells = lhs.cellsRef(); TypedCells rhsCells = view->cellsRef(); - return dispatch_2<CallApply>(lhsCells, rhsCells, combiner, std::move(func)); + return dispatch_2<CallGenericJoin>(lhsCells, rhsCells, combiner, std::move(func)); } return Tensor::UP(); } diff --git a/eval/src/vespa/eval/tensor/dense/dense_tensor_view.cpp b/eval/src/vespa/eval/tensor/dense/dense_tensor_view.cpp index 1ae198d1171..d98cf52d279 100644 --- a/eval/src/vespa/eval/tensor/dense/dense_tensor_view.cpp +++ b/eval/src/vespa/eval/tensor/dense/dense_tensor_view.cpp @@ -1,7 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "dense_tensor_view.h" -#include "dense_tensor_apply.hpp" +#include "dense_generic_join.hpp" #include "dense_tensor_reduce.hpp" #include "dense_tensor_modify.h" #include <vespa/vespalib/util/stringfmt.h> @@ -302,12 +302,12 @@ DenseTensorView::join(join_fun_t function, const Tensor &arg) const return joinDenseTensors(*this, arg, "join", function); } if (function == eval::operation::Mul::f) { - return dense::apply(*this, arg, [](double a, double b) { return (a * b); }); + return dense::generic_join(*this, arg, [](double a, double b) { return (a * b); }); } if (function == eval::operation::Add::f) { - return dense::apply(*this, arg, [](double a, double b) { return (a + b); }); + return dense::generic_join(*this, arg, [](double a, double b) { return (a + b); }); } - return dense::apply(*this, arg, function); + return dense::generic_join(*this, arg, function); } Tensor::UP |