/* * Copyright 2019-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include #include #include #include #include namespace InferenceProcess { struct DataPtr { void *data; size_t size; DataPtr(void *data = nullptr, size_t size = 0); void invalidate(); void clean(); }; struct InferenceJob { std::string name; DataPtr networkModel; std::vector input; std::vector output; std::vector expectedOutput; InferenceJob(); InferenceJob(const std::string &name, const DataPtr &networkModel, const std::vector &input, const std::vector &output, const std::vector &expectedOutput); void invalidate(); void clean(); }; class InferenceProcess { public: InferenceProcess(uint8_t *_tensorArena, size_t _tensorArenaSize) : tensorArena(_tensorArena), tensorArenaSize(_tensorArenaSize) { } bool runJob(InferenceJob &job); private: uint8_t *tensorArena; const size_t tensorArenaSize; }; } /* namespace InferenceProcess */