ONE - On-device Neural Engine
Loading...
Searching...
No Matches
GatherND.cpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved
3 * Copyright 2021 The TensorFlow Authors. All Rights Reserved.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#include "OMStatus.h"
19
20#include "core/OMUtils.h"
21#include "core/OMKernelData.h"
22
24#include "execute/OMUtils.h"
27#include "PALGatherND.h"
28
29using namespace onert_micro;
30using namespace onert_micro::core;
31using namespace onert_micro::execute;
32
33// NOTE: doesn't currently support dynamic shapes
34namespace onert_micro
35{
36namespace execute
37{
38
40{
41
42 uint8_t *input_data;
43 uint8_t *position_data;
44 uint8_t *output_data;
45
46 core::OMRuntimeShape input_shape;
47 core::OMRuntimeShape position_shape;
49
50 circle::TensorType inputType;
51
52 OMStatus status =
53 execute::readKernelDataTISO(execute_args, input_data, position_data, output_data, input_shape,
54 position_shape, output_shape, inputType);
55
56 switch (inputType)
57 {
58#ifndef DIS_FLOAT
59 case circle::TensorType_FLOAT32:
60 {
61 pal::GatherND<float, int32_t>(input_shape, utils::castInputData<float>(input_data),
62 position_shape, utils::castInputData<int32_t>(position_data),
63 utils::castOutputData<float>(output_data));
64 }
65 break;
66#endif // DIS_FLOAT
67 default:
68 {
69 status = UnsupportedActivation;
70 assert(false && "Unsupported type.");
71 }
72 }
73
74 return status;
75}
76
77} // namespace execute
78} // namespace onert_micro
const luci_interpreter::RuntimeShape output_shape
OMStatus readKernelDataTISO(const OMExecuteArgs &execute_args, uint8_t *&input_data1, uint8_t *&input_data2, uint8_t *&output_data, core::OMRuntimeShape &input1_shape_ref, core::OMRuntimeShape &input2_shape_ref, core::OMRuntimeShape &output_shape_ref, circle::TensorType &tensor_type)
OMStatus execute_kernel_CircleGatherND(const OMExecuteArgs &execute_args)
Definition GatherND.cpp:39
@ UnsupportedActivation
Definition OMStatus.h:28