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