From: 김용섭/On-Device Lab(SR)/Engineer/삼성전자 Date: Fri, 30 Aug 2019 00:59:05 +0000 (+0900) Subject: [neurun] Introduce ITensorManager to be used as MemoryManager (#7048) X-Git-Tag: accepted/tizen/unified/20190903.052428~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=36e40fbea1db60dd1c5dac3736ababab6c094e8f;p=platform%2Fcore%2Fml%2Fnnfw.git [neurun] Introduce ITensorManager to be used as MemoryManager (#7048) Introduce ITensorManager to be used as MemoryManager instead of existing MemoryManager in the future. Signed-off-by: Yongseop Kim --- diff --git a/runtimes/neurun/core/include/backend/ITensorManager.h b/runtimes/neurun/core/include/backend/ITensorManager.h new file mode 100644 index 0000000..43fafe7 --- /dev/null +++ b/runtimes/neurun/core/include/backend/ITensorManager.h @@ -0,0 +1,55 @@ +/* + * 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_BACKEND_ITENSOR_MANAGER_H__ +#define __NEURUN_BACKEND_ITENSOR_MANAGER_H__ + +namespace neurun +{ +namespace backend +{ + +// TODO Replace existing MemoryManager which TensorBuilder uses by this +/** + * @brief Interface as an abstract tensor manager which has MemoryManager + */ +struct ITensorManager +{ + virtual ~ITensorManager() = default; + + virtual void allocateConsts(void) = 0; + virtual void allocateNonconsts(void) = 0; + virtual void deallocateConsts(void) = 0; + virtual void deallocateNonconsts(void) = 0; +}; + +} // namespace backend +} // namespace neurun + +#include +#include + +namespace neurun +{ +namespace backend +{ + +using TensorManagerSet = std::unordered_set>; + +} // namespace backend +} // namespace neurun + +#endif // __NEURUN_BACKEND_ITENSOR_MANAGER_H__