From 240bda74b2193138af78ee5f81236a4020963d1e Mon Sep 17 00:00:00 2001 From: Evgenii Maltsev Date: Wed, 4 Dec 2024 04:34:40 +0400 Subject: [PATCH] [onert/odc] Auto-compilation. Input/output buffers in Execution (#14383) This PR for `odc:auto-compilation` introduces input/output buffers in Execution. ONE-DCO-1.0-Signed-off-by: Evgenii Maltsev e.maltsev@samsung.com --- runtime/onert/core/include/exec/Execution.h | 14 ++++++++++++++ runtime/onert/core/src/exec/Execution.cc | 10 ++++++++++ 2 files changed, 24 insertions(+) diff --git a/runtime/onert/core/include/exec/Execution.h b/runtime/onert/core/include/exec/Execution.h index 6ff482019e3..1043005fbb1 100644 --- a/runtime/onert/core/include/exec/Execution.h +++ b/runtime/onert/core/include/exec/Execution.h @@ -176,6 +176,20 @@ class Execution size_t getInputTotalSize(ir::IOIndex ind) const; size_t getOutputTotalSize(ir::IOIndex ind) const; + /** + * @brief Get pointer of Input Buffer + * @param[in] index Input index + * @return Pointer of Input Buffer + */ + const void *getInputBuffer(ir::IOIndex ind) const; + + /** + * @brief Get pointer of Output Buffer + * @param[in] index Output index + * @return Pointer of Output Buffer + */ + void *getOutputBuffer(ir::IOIndex ind); + ExecutionOptions &executionOptions() { return _ctx.options; } private: diff --git a/runtime/onert/core/src/exec/Execution.cc b/runtime/onert/core/src/exec/Execution.cc index 895a82ff833..f2800e094a5 100644 --- a/runtime/onert/core/src/exec/Execution.cc +++ b/runtime/onert/core/src/exec/Execution.cc @@ -223,5 +223,15 @@ size_t Execution::getOutputTotalSize(ir::IOIndex ind) const return _ctx.desc.outputs.at(ind.value())->info.total_size(); } +const void *Execution::getInputBuffer(ir::IOIndex ind) const +{ + return _ctx.desc.inputs.at(ind.value())->buffer; +} + +void *Execution::getOutputBuffer(ir::IOIndex ind) +{ + return _ctx.desc.outputs.at(ind.value())->buffer; +} + } // namespace exec } // namespace onert