1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
6 * @brief a header file for IMemoryState interface
7 * @file ie_imemory_state.hpp
12 #include "details/ie_no_copy.hpp"
13 #include "ie_common.h"
16 namespace InferenceEngine {
19 * @brief manages data for reset operations
21 class IMemoryState : public details::no_copy {
23 using Ptr = std::shared_ptr<IMemoryState>;
26 * @brief Gets name of current memory state, if length of array is not enough name is truncated by len, null terminator is inserted as well.
27 * @param name preallocated buffer for receiving name
28 * @param len Length of the buffer
29 * @param resp Optional: pointer to an already allocated object to contain information in case of failure
30 * @return Status code of the operation: OK (0) for success
32 virtual StatusCode GetName(char *name, size_t len, ResponseDesc *resp) const noexcept = 0;
35 * @brief reset internal memory state for relevant iexecutable network, to a value specified in SetState
36 * @param resp Optional: pointer to an already allocated object to contain information in case of failure
37 * @return Status code of the operation: OK (0) for success*
39 virtual StatusCode Reset(ResponseDesc *resp) noexcept = 0;
42 * @brief Sets the new state that is used for all future Reset() operations as a base.
43 * This method can fail if Blob size does not match the internal state size or precision
44 * @param newState is the data to use as base state
45 * @param resp Optional: pointer to an already allocated object to contain information in case of failure
46 * @return Status code of the operation: OK (0) for success
48 virtual StatusCode SetState(Blob::Ptr newState, ResponseDesc *resp) noexcept = 0;
51 * @brief returns the value of the last memory state.
52 * @details Since we roll memory after each infer, we can query the input state always and still get the last state.
54 * @param resp Optional: pointer to an already allocated object to contain information in case of failure
55 * @return Status code of the operation: OK (0) for success
57 virtual StatusCode GetLastState(Blob::CPtr & lastState, ResponseDesc *resp) const noexcept = 0;
60 } // namespace InferenceEngine