ONE - On-device Neural Engine
Loading...
Searching...
No Matches
BackendContext.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef __ONERT_BACKEND_TRIX_BACKEND_CONTEXT_H__
18#define __ONERT_BACKEND_TRIX_BACKEND_CONTEXT_H__
19
21#include "TensorBuilder.h"
22#include "KernelGenerator.h"
23#include "DevContext.h"
24
25namespace onert
26{
27namespace backend
28{
29namespace trix
30{
31
33{
34public:
36 std::shared_ptr<ITensorRegistry> tensor_registry = nullptr,
37 std::shared_ptr<TensorBuilder> tensor_builder = nullptr,
38 std::shared_ptr<KernelGenerator> kernel_gen = nullptr)
41 {
42 }
43
44 ITensorRegistry *genTensors() override;
45 FunctionMap genKernels() override;
46
47 std::shared_ptr<DevContext> dev_context() { return _dev_context; }
48
49public:
50 // TODO Make it private
51 std::shared_ptr<TensorBuilder> tensor_builder;
52 std::shared_ptr<KernelGenerator> kernel_gen;
53
54private:
55 std::shared_ptr<DevContext> _dev_context;
56};
57
58} // namespace trix
59} // namespace backend
60} // namespace onert
61
62#endif // __ONERT_BACKEND_TRIX_BACKEND_CONTEXT_H__
std::shared_ptr< ITensorRegistry > tensor_registry
const ContextData & data() const
const Backend * backend() const
ITensorRegistry * genTensors() override
std::shared_ptr< DevContext > dev_context()
std::shared_ptr< TensorBuilder > tensor_builder
std::shared_ptr< KernelGenerator > kernel_gen
BackendContext(const Backend *backend, ContextData &&data, std::shared_ptr< ITensorRegistry > tensor_registry=nullptr, std::shared_ptr< TensorBuilder > tensor_builder=nullptr, std::shared_ptr< KernelGenerator > kernel_gen=nullptr)
NPU device context of trix backend.
Definition DevContext.h:41
std::unordered_map< ir::OperationIndex, std::unique_ptr< exec::FunctionSequence > > FunctionMap