#define __NEURUN_EXEC_EXECUTION_H__
#include "exec/IExecutor.h"
+#include "IODescription.h"
namespace neurun
{
* @brief Construct a new Execution object
* @param[in] executor Model executor
*/
- Execution(const std::shared_ptr<IExecutor> &executor) : _executor{executor}
- {
- // DO NOTHING
- }
+ Execution(const std::shared_ptr<IExecutor> &executor);
public:
/**
private:
const std::shared_ptr<IExecutor> _executor;
+ IODescription _io_desc;
};
} // namespace exec
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __NEURUN_EXEC_IO_DESCRIPTION_H__
+#define __NEURUN_EXEC_IO_DESCRIPTION_H__
+
+#include <vector>
+
+#include "model/OperandInfo.h"
+
+namespace neurun
+{
+namespace exec
+{
+
+struct InputDesc
+{
+ const model::OperandInfo info;
+ const void *buffer;
+ const size_t size;
+
+ InputDesc(void) = delete;
+ InputDesc(const model::OperandInfo &info, const void *buffer, const size_t size)
+ : info(info), buffer(buffer), size(size)
+ {
+ }
+};
+
+struct OutputDesc
+{
+ const model::OperandInfo info;
+ void *buffer;
+ const size_t size;
+
+ OutputDesc(void) = delete;
+ OutputDesc(const model::OperandInfo &info, void *buffer, const size_t size)
+ : info(info), buffer(buffer), size(size)
+ {
+ }
+};
+
+struct IODescription
+{
+ std::vector<std::unique_ptr<InputDesc>> inputs;
+ std::vector<std::unique_ptr<OutputDesc>> outputs;
+};
+
+} // namespace exec
+} // namespace neurun
+
+#endif // __NEURUN_EXEC_IO_DESCRIPTION_H__
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "exec/Execution.h"
+
+namespace neurun
+{
+namespace exec
+{
+
+Execution::Execution(const std::shared_ptr<IExecutor> &executor) : _executor{executor}, _io_desc{}
+{
+ _io_desc.inputs.resize(_executor->model().inputs.size());
+ _io_desc.outputs.resize(_executor->model().outputs.size());
+}
+
+} // namespace exec
+} // namespace neurun