ONE - On-device Neural Engine
Loading...
Searching...
No Matches
OMUtils.h
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#ifndef ONERT_MICRO_CORE_UTILS_H
18#define ONERT_MICRO_CORE_UTILS_H
19
20#include "OMLog.h"
21#include "OMStatus.h"
23#include "core/OMRuntimeShape.h"
24
25#include <cassert>
26#include <cstdint>
27
28namespace onert_micro
29{
30namespace core
31{
32namespace utils
33{
34
35OMStatus checkCondition(bool cond);
36
37template <typename T> const T *castInputData(uint8_t *tensor_data)
38{
39 return tensor_data != nullptr ? reinterpret_cast<const T *>(tensor_data) : nullptr;
40}
41
42template <typename T> T *castOutputData(uint8_t *tensor_data)
43{
44 return tensor_data != nullptr ? reinterpret_cast<T *>(tensor_data) : nullptr;
45}
46
47} // namespace utils
48} // namespace core
49} // namespace onert_micro
50
51#endif // ONERT_MICRO_CORE_UTILS_H
T * castOutputData(uint8_t *tensor_data)
Definition OMUtils.h:42
const T * castInputData(uint8_t *tensor_data)
Definition OMUtils.h:37
OMStatus checkCondition(bool cond)
Definition OMUtils.cpp:22
Definition utils.py:1