ONE - On-device Neural Engine
Loading...
Searching...
No Matches
PALCeil.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_EXECUTE_PAL_CEIL_COMMON_H
18
#define ONERT_MICRO_EXECUTE_PAL_CEIL_COMMON_H
19
20
#include "
core/OMRuntimeShape.h
"
21
#include "
OMStatus.h
"
22
#include "
PALSISOOperation.h
"
23
#include "
PALUtils.h
"
24
#include <cmath>
25
26
namespace
onert_micro
27
{
28
namespace
execute
29
{
30
namespace
pal
31
{
32
33
template
<
typename
T>
34
inline
OMStatus
Ceil
(
const
core::OMRuntimeShape
&input_shape,
const
T *input_data,
35
const
core::OMRuntimeShape
&
output_shape
, T *output_data)
36
{
37
const
uint32_t flat_size = input_shape.
flatSize
();
38
39
if
(flat_size == -1)
40
return
UnknownError
;
41
42
assert(input_data !=
nullptr
);
43
assert(output_data !=
nullptr
);
44
45
assert(input_shape ==
output_shape
);
46
47
for
(
int
i = 0; i < flat_size; i++)
48
{
49
output_data[i] = std::ceil(input_data[i]);
50
}
51
52
return
Ok
;
53
}
54
}
// namespace pal
55
}
// namespace execute
56
}
// namespace onert_micro
57
58
#endif
// ONERT_MICRO_EXECUTE_PAL_CEIL_COMMON_H
OMRuntimeShape.h
OMStatus.h
PALSISOOperation.h
onert_micro::core::OMRuntimeShape
Definition
OMRuntimeShape.h:34
onert_micro::core::OMRuntimeShape::flatSize
int flatSize() const
Definition
OMRuntimeShape.h:64
output_shape
const luci_interpreter::RuntimeShape output_shape
Definition
PALComparisons.h:32
onert_micro::execute::pal::Ceil
OMStatus Ceil(const core::OMRuntimeShape &input_shape, const T *input_data, const core::OMRuntimeShape &output_shape, T *output_data)
Definition
PALCeil.h:34
onert_micro
Definition
OMMemoryManager.h:26
onert_micro::OMStatus
OMStatus
Definition
OMStatus.h:24
onert_micro::UnknownError
@ UnknownError
Definition
OMStatus.h:30
onert_micro::Ok
@ Ok
Definition
OMStatus.h:25
PALUtils.h
onert-micro
onert-micro
include
pal
common
PALCeil.h
Generated by
1.9.8