diff options
author | Arne Juul <arnej@verizonmedia.com> | 2021-03-11 13:25:40 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2021-03-16 13:12:16 +0000 |
commit | 2a605bcc9e79e73571ad7a6ba8556406780a1693 (patch) | |
tree | 411d3f2de540174e9bbb658d5b59df9720aed6b8 /eval | |
parent | 79c411dce42cafae399bd9cf00afeed573caa3b7 (diff) |
rename MixedMapFunction -> InplaceMapFunction
Diffstat (limited to 'eval')
-rw-r--r-- | eval/CMakeLists.txt | 2 | ||||
-rw-r--r-- | eval/src/tests/instruction/inplace_map_function/CMakeLists.txt | 9 | ||||
-rw-r--r-- | eval/src/tests/instruction/inplace_map_function/inplace_map_function_test.cpp (renamed from eval/src/tests/instruction/mixed_map_function/mixed_map_function_test.cpp) | 6 | ||||
-rw-r--r-- | eval/src/tests/instruction/mixed_map_function/CMakeLists.txt | 9 | ||||
-rw-r--r-- | eval/src/vespa/eval/eval/optimize_tensor_function.cpp | 4 | ||||
-rw-r--r-- | eval/src/vespa/eval/instruction/CMakeLists.txt | 2 | ||||
-rw-r--r-- | eval/src/vespa/eval/instruction/inplace_map_function.cpp (renamed from eval/src/vespa/eval/instruction/mixed_map_function.cpp) | 12 | ||||
-rw-r--r-- | eval/src/vespa/eval/instruction/inplace_map_function.h (renamed from eval/src/vespa/eval/instruction/mixed_map_function.h) | 6 |
8 files changed, 25 insertions, 25 deletions
diff --git a/eval/CMakeLists.txt b/eval/CMakeLists.txt index 7d3d94d7ed6..51b8b850747 100644 --- a/eval/CMakeLists.txt +++ b/eval/CMakeLists.txt @@ -63,7 +63,7 @@ vespa_define_module( src/tests/instruction/index_lookup_table src/tests/instruction/join_with_number src/tests/instruction/mixed_inner_product_function - src/tests/instruction/mixed_map_function + src/tests/instruction/inplace_map_function src/tests/instruction/mixed_simple_join_function src/tests/instruction/pow_as_map_optimizer src/tests/instruction/remove_trivial_dimension_optimizer diff --git a/eval/src/tests/instruction/inplace_map_function/CMakeLists.txt b/eval/src/tests/instruction/inplace_map_function/CMakeLists.txt new file mode 100644 index 00000000000..7b45cbed2e2 --- /dev/null +++ b/eval/src/tests/instruction/inplace_map_function/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +vespa_add_executable(eval_inplace_map_function_test_app TEST + SOURCES + inplace_map_function_test.cpp + DEPENDS + vespaeval + GTest::GTest +) +vespa_add_test(NAME eval_inplace_map_function_test_app COMMAND eval_inplace_map_function_test_app) diff --git a/eval/src/tests/instruction/mixed_map_function/mixed_map_function_test.cpp b/eval/src/tests/instruction/inplace_map_function/inplace_map_function_test.cpp index 6a6d569e8a4..de03ef3c3cb 100644 --- a/eval/src/tests/instruction/mixed_map_function/mixed_map_function_test.cpp +++ b/eval/src/tests/instruction/inplace_map_function/inplace_map_function_test.cpp @@ -1,7 +1,7 @@ // Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/eval/eval/tensor_function.h> -#include <vespa/eval/instruction/mixed_map_function.h> +#include <vespa/eval/instruction/inplace_map_function.h> #include <vespa/eval/eval/test/eval_fixture.h> #include <vespa/eval/eval/test/gen_spec.h> #include <vespa/vespalib/gtest/gtest.h> @@ -29,7 +29,7 @@ void verify_optimized(const vespalib::string &expr) { EvalFixture fixture(prod_factory, expr, param_repo, true, true); EXPECT_EQ(fixture.result(), EvalFixture::ref(expr, param_repo)); EXPECT_EQ(fixture.result(), slow_fixture.result()); - auto info = fixture.find_all<MixedMapFunction>(); + auto info = fixture.find_all<InplaceMapFunction>(); ASSERT_EQ(info.size(), 1u); EXPECT_TRUE(info[0]->result_is_mutable()); EXPECT_EQ(info[0]->inplace(), true); @@ -43,7 +43,7 @@ void verify_not_optimized(const vespalib::string &expr) { EvalFixture fixture(prod_factory, expr, param_repo, true); EXPECT_EQ(fixture.result(), EvalFixture::ref(expr, param_repo)); EXPECT_EQ(fixture.result(), slow_fixture.result()); - auto info = fixture.find_all<MixedMapFunction>(); + auto info = fixture.find_all<InplaceMapFunction>(); EXPECT_TRUE(info.empty()); EXPECT_TRUE(!(fixture.get_param(0) == fixture.result())); } diff --git a/eval/src/tests/instruction/mixed_map_function/CMakeLists.txt b/eval/src/tests/instruction/mixed_map_function/CMakeLists.txt deleted file mode 100644 index 4457773ed6c..00000000000 --- a/eval/src/tests/instruction/mixed_map_function/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_executable(eval_mixed_map_function_test_app TEST - SOURCES - mixed_map_function_test.cpp - DEPENDS - vespaeval - GTest::GTest -) -vespa_add_test(NAME eval_mixed_map_function_test_app COMMAND eval_mixed_map_function_test_app) diff --git a/eval/src/vespa/eval/eval/optimize_tensor_function.cpp b/eval/src/vespa/eval/eval/optimize_tensor_function.cpp index f1ce293b18c..51cf58f3a12 100644 --- a/eval/src/vespa/eval/eval/optimize_tensor_function.cpp +++ b/eval/src/vespa/eval/eval/optimize_tensor_function.cpp @@ -23,7 +23,7 @@ #include <vespa/eval/instruction/mixed_simple_join_function.h> #include <vespa/eval/instruction/join_with_number_function.h> #include <vespa/eval/instruction/pow_as_map_optimizer.h> -#include <vespa/eval/instruction/mixed_map_function.h> +#include <vespa/eval/instruction/inplace_map_function.h> #include <vespa/eval/instruction/vector_from_doubles_function.h> #include <vespa/eval/instruction/dense_tensor_create_function.h> #include <vespa/eval/instruction/dense_tensor_peek_function.h> @@ -71,7 +71,7 @@ const TensorFunction &optimize_for_factory(const ValueBuilderFactory &, const Te child.set(DenseLambdaPeekOptimizer::optimize(child.get(), stash)); child.set(FastRenameOptimizer::optimize(child.get(), stash)); child.set(PowAsMapOptimizer::optimize(child.get(), stash)); - child.set(MixedMapFunction::optimize(child.get(), stash)); + child.set(InplaceMapFunction::optimize(child.get(), stash)); child.set(MixedSimpleJoinFunction::optimize(child.get(), stash)); child.set(JoinWithNumberFunction::optimize(child.get(), stash)); child.set(DenseSingleReduceFunction::optimize(child.get(), stash)); diff --git a/eval/src/vespa/eval/instruction/CMakeLists.txt b/eval/src/vespa/eval/instruction/CMakeLists.txt index 7a299738e78..5dc5a0db171 100644 --- a/eval/src/vespa/eval/instruction/CMakeLists.txt +++ b/eval/src/vespa/eval/instruction/CMakeLists.txt @@ -28,7 +28,7 @@ vespa_add_library(eval_instruction OBJECT index_lookup_table.cpp join_with_number_function.cpp mixed_inner_product_function.cpp - mixed_map_function.cpp + inplace_map_function.cpp mixed_simple_join_function.cpp pow_as_map_optimizer.cpp remove_trivial_dimension_optimizer.cpp diff --git a/eval/src/vespa/eval/instruction/mixed_map_function.cpp b/eval/src/vespa/eval/instruction/inplace_map_function.cpp index 22dfb15be20..54c6be9bea1 100644 --- a/eval/src/vespa/eval/instruction/mixed_map_function.cpp +++ b/eval/src/vespa/eval/instruction/inplace_map_function.cpp @@ -1,6 +1,6 @@ // Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include "mixed_map_function.h" +#include "inplace_map_function.h" #include <vespa/vespalib/util/typify.h> #include <vespa/eval/eval/value.h> #include <vespa/eval/eval/operation.h> @@ -42,17 +42,17 @@ using MyTypify = TypifyValue<TypifyCellMeta,TypifyOp1>; //----------------------------------------------------------------------------- -MixedMapFunction::MixedMapFunction(const ValueType &result_type, +InplaceMapFunction::InplaceMapFunction(const ValueType &result_type, const TensorFunction &child, map_fun_t function_in) : Map(result_type, child, function_in) { } -MixedMapFunction::~MixedMapFunction() = default; +InplaceMapFunction::~InplaceMapFunction() = default; Instruction -MixedMapFunction::compile_self(const ValueBuilderFactory &, Stash &) const +InplaceMapFunction::compile_self(const ValueBuilderFactory &, Stash &) const { auto input_cell_meta = child().result_type().cell_meta().limit().not_scalar(); auto op = typify_invoke<2,MyTypify,MyGetFun>(input_cell_meta, function()); @@ -61,14 +61,14 @@ MixedMapFunction::compile_self(const ValueBuilderFactory &, Stash &) const } const TensorFunction & -MixedMapFunction::optimize(const TensorFunction &expr, Stash &stash) +InplaceMapFunction::optimize(const TensorFunction &expr, Stash &stash) { if (auto map = as<Map>(expr)) { if ((map->result_type() == map->child().result_type()) && (! map->child().result_type().is_double()) && map->child().result_is_mutable()) { - return stash.create<MixedMapFunction>(map->result_type(), map->child(), map->function()); + return stash.create<InplaceMapFunction>(map->result_type(), map->child(), map->function()); } } return expr; diff --git a/eval/src/vespa/eval/instruction/mixed_map_function.h b/eval/src/vespa/eval/instruction/inplace_map_function.h index 2e7ca7c9422..c04934b698f 100644 --- a/eval/src/vespa/eval/instruction/mixed_map_function.h +++ b/eval/src/vespa/eval/instruction/inplace_map_function.h @@ -9,14 +9,14 @@ namespace vespalib::eval { /** * Tensor function optimizing in-place map operations on tensors. **/ -class MixedMapFunction : public tensor_function::Map +class InplaceMapFunction : public tensor_function::Map { public: using map_fun_t = operation::op1_t; - MixedMapFunction(const ValueType &result_type, + InplaceMapFunction(const ValueType &result_type, const TensorFunction &child, map_fun_t function_in); - ~MixedMapFunction() override; + ~InplaceMapFunction() override; bool inplace() const { return child().result_is_mutable(); } InterpretedFunction::Instruction compile_self(const ValueBuilderFactory &factory, Stash &stash) const override; static const TensorFunction &optimize(const TensorFunction &expr, Stash &stash); |