summaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@oath.com>2018-01-31 14:48:46 +0000
committerHåvard Pettersen <havardpe@oath.com>2018-01-31 14:48:46 +0000
commit7a3ba9eb59425c933af0c954bc9cf22fac436ad8 (patch)
treed37ae0850553c6d47e062bb8eb8730a6d7475ed0 /eval
parent7db5bb4ee89517521d08861b5094e68a6931e585 (diff)
remove recursive eval from optimized tensor function operations
Diffstat (limited to 'eval')
-rw-r--r--eval/src/vespa/eval/tensor/dense/dense_dot_product_function.cpp10
-rw-r--r--eval/src/vespa/eval/tensor/dense/dense_dot_product_function.h1
-rw-r--r--eval/src/vespa/eval/tensor/dense/dense_xw_product_function.cpp15
-rw-r--r--eval/src/vespa/eval/tensor/dense/dense_xw_product_function.h1
4 files changed, 0 insertions, 27 deletions
diff --git a/eval/src/vespa/eval/tensor/dense/dense_dot_product_function.cpp b/eval/src/vespa/eval/tensor/dense/dense_dot_product_function.cpp
index 48bc6e3b110..58c2db85627 100644
--- a/eval/src/vespa/eval/tensor/dense/dense_dot_product_function.cpp
+++ b/eval/src/vespa/eval/tensor/dense/dense_dot_product_function.cpp
@@ -43,15 +43,5 @@ DenseDotProductFunction::compile_self(Stash &) const
return eval::InterpretedFunction::Instruction(my_op, (uint64_t)(_hwAccelerator.get()));
}
-const eval::Value &
-DenseDotProductFunction::eval(const eval::TensorEngine &engine, const eval::LazyParams &params, Stash &stash) const
-{
- DenseTensorView::CellsRef lhsCells = getCellsRef(lhs().eval(engine, params, stash));
- DenseTensorView::CellsRef rhsCells = getCellsRef(rhs().eval(engine, params, stash));
- size_t numCells = std::min(lhsCells.size(), rhsCells.size());
- double result = _hwAccelerator->dotProduct(lhsCells.cbegin(), rhsCells.cbegin(), numCells);
- return stash.create<eval::DoubleValue>(result);
-}
-
}
diff --git a/eval/src/vespa/eval/tensor/dense/dense_dot_product_function.h b/eval/src/vespa/eval/tensor/dense/dense_dot_product_function.h
index b496986453f..1c38654c014 100644
--- a/eval/src/vespa/eval/tensor/dense/dense_dot_product_function.h
+++ b/eval/src/vespa/eval/tensor/dense/dense_dot_product_function.h
@@ -19,7 +19,6 @@ public:
DenseDotProductFunction(const eval::TensorFunction &lhs_in,
const eval::TensorFunction &rhs_in);
eval::InterpretedFunction::Instruction compile_self(Stash &stash) const override;
- const eval::Value &eval(const eval::TensorEngine &engine, const eval::LazyParams &params, Stash &stash) const override;
};
}
diff --git a/eval/src/vespa/eval/tensor/dense/dense_xw_product_function.cpp b/eval/src/vespa/eval/tensor/dense/dense_xw_product_function.cpp
index 4684116e413..06afe7dd164 100644
--- a/eval/src/vespa/eval/tensor/dense/dense_xw_product_function.cpp
+++ b/eval/src/vespa/eval/tensor/dense/dense_xw_product_function.cpp
@@ -98,20 +98,5 @@ DenseXWProductFunction::compile_self(Stash &) const
return eval::InterpretedFunction::Instruction(my_op, (uint64_t)(&_self));
}
-const eval::Value &
-DenseXWProductFunction::eval(const eval::TensorEngine &engine, const eval::LazyParams &params, Stash &stash) const
-{
- DenseTensorView::CellsRef vectorCells = getCellsRef(lhs().eval(engine, params, stash));
- DenseTensorView::CellsRef matrixCells = getCellsRef(rhs().eval(engine, params, stash));
-
- ArrayRef<double> outputCells = stash.create_array<double>(_self._resultSize);
- if (_self._commonDimensionInnermost) {
- multiDotProduct(_self, vectorCells, matrixCells, outputCells);
- } else {
- transposedProduct(_self, vectorCells, matrixCells, outputCells);
- }
- return stash.create<DenseTensorView>(result_type(), outputCells);
-}
-
}
diff --git a/eval/src/vespa/eval/tensor/dense/dense_xw_product_function.h b/eval/src/vespa/eval/tensor/dense/dense_xw_product_function.h
index 9655bc1c386..516954d0246 100644
--- a/eval/src/vespa/eval/tensor/dense/dense_xw_product_function.h
+++ b/eval/src/vespa/eval/tensor/dense/dense_xw_product_function.h
@@ -49,7 +49,6 @@ public:
bool matrixHasCommonDimensionInnermost() const { return _self._commonDimensionInnermost; }
eval::InterpretedFunction::Instruction compile_self(Stash &stash) const override;
- const eval::Value &eval(const eval::TensorEngine &engine, const eval::LazyParams &params, Stash &stash) const override;
};
}