ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Shape.cpp
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2024 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
#include "
OMStatus.h
"
18
19
#include "
core/OMUtils.h
"
20
#include "
import/OMKernelConfigureBuilder.h
"
21
#include "
execute/OMRuntimeKernel.h
"
22
23
using namespace
onert_micro
;
24
using namespace
onert_micro::core
;
25
26
namespace
27
{
28
29
constexpr
uint32_t inputTensorIdx = 0;
30
constexpr
uint32_t
outputTensorIdx
= 0;
31
32
}
// namespace
33
34
namespace
onert_micro
35
{
36
namespace
import
37
{
38
39
OMStatus
configure_kernel_CircleShape
(
const
OMConfigureArgs
&config_args)
40
{
41
OMRuntimeContext
&runtime_context = config_args.
runtime_context
;
42
uint16_t op_index = config_args.
kernel_index
;
43
44
onert_micro::execute::OMRuntimeKernel
runtime_kernel;
45
46
OMStatus
status = runtime_kernel.
readKernel
(op_index, runtime_context);
47
if
(status !=
Ok
)
48
return
status;
49
50
const
circle::Tensor *output = runtime_kernel.
outputs
[outputTensorIdx];
51
52
assert(output !=
nullptr
);
53
54
status = utils::checkCondition(output->type() == circle::TensorType_INT32);
55
56
return
status;
57
}
58
59
}
// namespace import
60
}
// namespace onert_micro
OMKernelConfigureBuilder.h
OMRuntimeKernel.h
OMStatus.h
onert_micro::core::OMRuntimeContext
Definition
OMRuntimeContext.h:37
onert_micro::execute::OMRuntimeKernel
Definition
OMRuntimeKernel.h:35
onert_micro::execute::OMRuntimeKernel::readKernel
OMStatus readKernel(uint16_t op_index, core::OMRuntimeContext &runtime_context)
Definition
OMRuntimeKernel.cpp:22
onert_micro::execute::OMRuntimeKernel::outputs
const circle::Tensor * outputs[maxOutputSize]
Definition
OMRuntimeKernel.h:52
OMUtils.h
TensorIndexTISO::outputTensorIdx
constexpr uint32_t outputTensorIdx
Definition
ReadKernelDataCommon.cpp:28
onert_micro::core
Definition
OMMemoryManager.h:28
onert_micro::import::configure_kernel_CircleShape
OMStatus configure_kernel_CircleShape(const OMConfigureArgs &config_args)
Definition
Shape.cpp:39
onert_micro
Definition
OMMemoryManager.h:26
onert_micro::OMStatus
OMStatus
Definition
OMStatus.h:24
onert_micro::Ok
@ Ok
Definition
OMStatus.h:25
onert_micro::import::OMConfigureArgs
Definition
OMConfigureArgs.h:32
onert_micro::import::OMConfigureArgs::runtime_context
core::OMRuntimeContext & runtime_context
Definition
OMConfigureArgs.h:34
onert_micro::import::OMConfigureArgs::kernel_index
uint16_t kernel_index
Definition
OMConfigureArgs.h:35
onert-micro
onert-micro
src
import
kernels
Shape.cpp
Generated by
1.9.8