diff options
Diffstat (limited to 'runtimes/neurun/src/backend/acl_cl/TensorBuilder.h')
-rw-r--r-- | runtimes/neurun/src/backend/acl_cl/TensorBuilder.h | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/runtimes/neurun/src/backend/acl_cl/TensorBuilder.h b/runtimes/neurun/src/backend/acl_cl/TensorBuilder.h deleted file mode 100644 index 64d81721a..000000000 --- a/runtimes/neurun/src/backend/acl_cl/TensorBuilder.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2018 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_ACL_CL_TENSOR_BUILDER_H__ -#define __NEURUN_BACKEND_ACL_CL_TENSOR_BUILDER_H__ - -#include "backend/interface/ITensorBuilder.h" -#include "backend/acl_cl/operand/CLTensor.h" -#include "backend/acl_cl/operand/CLSubTensor.h" -#include "backend/acl_cl/operand/Object.h" - -#include <unordered_map> - -namespace neurun -{ -namespace backend -{ -namespace acl_cl -{ - -class TensorBuilder : public ITensorBuilder -{ -public: - TensorBuilder(); - - /** - * @brief Register tensor information to allocate on ACL-CL backend - * @param[in] ind Operand index - * @param[in] info Tensor information - */ - virtual void registerTensorInfo(const model::operand::Index &ind, - const compiler::TensorInfo &info) override; - /** - * @brief Register subtensor information to allocate on ACL-CL backend - * @param[in] ind Operand index - * @param[in] info Tensor information - */ - virtual void registerSubTensorInfo(const model::operand::Index &ind, - const compiler::SubTensorInfo &info) override; - - virtual void notifyFirstUse(const model::operand::Index &) override; - virtual void notifyLastUse(const model::operand::Index &) override; - - virtual void prepare(void) override; - virtual void allocate(void) override; - - virtual std::shared_ptr<::neurun::backend::operand::ITensor> - tensorAt(const model::operand::Index &ind) override; - virtual std::shared_ptr<backend::operand::IObject> - wrapTensor(const model::operand::Index &ind) override; - virtual void iterate(const IterateFunction &fn) override; - - std::shared_ptr<::neurun::backend::acl_cl::operand::ICLTensor> - at(const ::neurun::model::operand::Index &ind); - /** - * @brief Check child tensor is allocated as subtensor of parent tensor - * @param[in] parent Index of parent - * @param[in] child Index of child - * @return @c true if child is allocated as subtensor of parent, otherwise @c false - */ - bool isSubTensorOf(const model::operand::Index &parent, const model::operand::Index &child); - -private: - std::unordered_map<model::operand::Index, compiler::TensorInfo> _tensor_info_map; - std::unordered_map<model::operand::Index, compiler::SubTensorInfo> _subtensor_info_map; - std::unordered_map<model::operand::Index, - std::shared_ptr<::neurun::backend::acl_cl::operand::CLTensor>> - _tensors; - std::unordered_map<model::operand::Index, - std::shared_ptr<::neurun::backend::acl_cl::operand::CLSubTensor>> - _subtensors; - std::unordered_map<model::operand::Index, - std::shared_ptr<::neurun::backend::acl_cl::operand::Object>> - _objects; -}; - -} // namespace acl_cl -} // namespace backend -} // namespace neurun - -#endif // __NEURUN_BACKEND_ACL_CL_TENSOR_BUILDER_H__ |