diff options
author | Håvard Pettersen <havardpe@oath.com> | 2018-03-05 10:14:34 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2018-03-05 10:14:34 +0000 |
commit | aca4faecd8e5e2c28dbfd1db9ae9116792098020 (patch) | |
tree | e6628dfbb3a50b22f603b43e4851f87959885e32 /eval | |
parent | 74463fea2a4a75f885f16ebe9a556fa80a0248a7 (diff) |
let DenseInplaceMapFunction inherit tensor_function::Map
Diffstat (limited to 'eval')
3 files changed, 4 insertions, 6 deletions
diff --git a/eval/src/vespa/eval/eval/tensor_function.h b/eval/src/vespa/eval/eval/tensor_function.h index 1f8c0588436..35f4e8073b3 100644 --- a/eval/src/vespa/eval/eval/tensor_function.h +++ b/eval/src/vespa/eval/eval/tensor_function.h @@ -208,7 +208,7 @@ public: map_fun_t function_in) : Op1(result_type_in, child_in), _function(function_in) {} map_fun_t function() const { return _function; } - InterpretedFunction::Instruction compile_self(Stash &stash) const final override; + InterpretedFunction::Instruction compile_self(Stash &stash) const override; }; //----------------------------------------------------------------------------- diff --git a/eval/src/vespa/eval/tensor/dense/dense_inplace_map_function.cpp b/eval/src/vespa/eval/tensor/dense/dense_inplace_map_function.cpp index 162bdb2ebfe..a0aba25f342 100644 --- a/eval/src/vespa/eval/tensor/dense/dense_inplace_map_function.cpp +++ b/eval/src/vespa/eval/tensor/dense/dense_inplace_map_function.cpp @@ -38,8 +38,7 @@ bool isConcreteDenseTensor(const ValueType &type) { DenseInplaceMapFunction::DenseInplaceMapFunction(const eval::ValueType &result_type, const eval::TensorFunction &child, map_fun_t function_in) - : eval::tensor_function::Op1(result_type, child), - _function(function_in) + : eval::tensor_function::Map(result_type, child, function_in) { } @@ -50,7 +49,7 @@ DenseInplaceMapFunction::~DenseInplaceMapFunction() eval::InterpretedFunction::Instruction DenseInplaceMapFunction::compile_self(Stash &) const { - return eval::InterpretedFunction::Instruction(my_inplace_map_op, (uint64_t)_function); + return eval::InterpretedFunction::Instruction(my_inplace_map_op, (uint64_t)function()); } const TensorFunction & diff --git a/eval/src/vespa/eval/tensor/dense/dense_inplace_map_function.h b/eval/src/vespa/eval/tensor/dense/dense_inplace_map_function.h index f02f83edae1..bfa5760aa3c 100644 --- a/eval/src/vespa/eval/tensor/dense/dense_inplace_map_function.h +++ b/eval/src/vespa/eval/tensor/dense/dense_inplace_map_function.h @@ -9,7 +9,7 @@ namespace vespalib::tensor { /** * Tensor function for inplace map operation on mutable dense tensors. **/ -class DenseInplaceMapFunction : public eval::tensor_function::Op1 +class DenseInplaceMapFunction : public eval::tensor_function::Map { public: using map_fun_t = ::vespalib::eval::tensor_function::map_fun_t; @@ -20,7 +20,6 @@ public: const eval::TensorFunction &child, map_fun_t function_in); ~DenseInplaceMapFunction(); - map_fun_t function() const { return _function; } bool result_is_mutable() const override { return true; } eval::InterpretedFunction::Instruction compile_self(Stash &stash) const override; static const eval::TensorFunction &optimize(const eval::TensorFunction &expr, Stash &stash); |