ONE - On-device Neural Engine
Loading...
Searching...
No Matches
impl Namespace Reference

Functions

template<typename T >
OMStatus CircleMean (OMRuntimeKernel &rt_kernel)
 
template<typename T >
OMStatus CircleReduceMax (OMRuntimeKernel &rt_kernel)
 
template<typename T >
OMStatus CircleReduceProd (OMRuntimeKernel &rt_kernel)
 
template<typename T >
OMStatus CircleSum (OMRuntimeKernel &rt_kernel)
 

Function Documentation

◆ CircleMean()

template<typename T >
OMStatus impl::CircleMean ( OMRuntimeKernel rt_kernel)

Definition at line 32 of file Mean.cpp.

33{
34 constexpr static T kInitValue = 0;
35
36 core::OMReduceDataContext<T> ctx(rt_kernel);
37 pal::Reducer<T, pal::ReduceSumFn> reducer(ctx, kInitValue);
38
39 bool is_ok = reducer.Mean();
40 if (!is_ok)
41 {
42 OM_LOG_AND_RETURN(UnknownError, "Unknown error encountered");
43 }
44
45 return Ok;
46}
#define OM_LOG_AND_RETURN(err, msg)
Definition OMLog.h:31

References onert_micro::execute::pal::Reducer< T, ReduceFn >::Mean(), onert_micro::Ok, OM_LOG_AND_RETURN, and onert_micro::UnknownError.

◆ CircleReduceMax()

template<typename T >
OMStatus impl::CircleReduceMax ( OMRuntimeKernel rt_kernel)

Definition at line 32 of file ReduceMax.cpp.

33{
34 constexpr static T kInitValue = std::numeric_limits<T>::lowest();
35
36 core::OMReduceDataContext<T> ctx(rt_kernel);
37 pal::Reducer<T, pal::ReduceMaxFn> reducer(ctx, kInitValue);
38
39 bool is_ok = reducer.Reduce();
40 if (!is_ok)
41 {
42 OM_LOG_AND_RETURN(UnknownError, "Unknown error encountered");
43 }
44
45 return Ok;
46}

References onert_micro::Ok, OM_LOG_AND_RETURN, onert_micro::execute::pal::Reducer< T, ReduceFn >::Reduce(), and onert_micro::UnknownError.

◆ CircleReduceProd()

template<typename T >
OMStatus impl::CircleReduceProd ( OMRuntimeKernel rt_kernel)

Definition at line 34 of file ReduceProd.cpp.

35{
36 constexpr static T kInitValue = 1;
37
38 core::OMReduceDataContext<T> ctx(rt_kernel);
39 pal::Reducer<T, pal::ReduceProductFn> reducer(ctx, kInitValue);
40
41 bool is_ok = reducer.Reduce();
42 if (!is_ok)
43 {
44 OM_LOG_AND_RETURN(UnknownError, "Unknown error encountered");
45 }
46
47 return Ok;
48}

References onert_micro::Ok, OM_LOG_AND_RETURN, onert_micro::execute::pal::Reducer< T, ReduceFn >::Reduce(), and onert_micro::UnknownError.

◆ CircleSum()

template<typename T >
OMStatus impl::CircleSum ( OMRuntimeKernel rt_kernel)

Definition at line 30 of file Sum.cpp.

31{
32 constexpr static T kInitValue = 0;
33
34 core::OMReduceDataContext<T> ctx(rt_kernel);
35 pal::Reducer<T, pal::ReduceSumFn> reducer(ctx, kInitValue);
36
37 bool is_ok = reducer.Reduce();
38 if (!is_ok)
39 {
40 OM_LOG_AND_RETURN(UnknownError, "Unknown error encountered");
41 }
42
43 return Ok;
44}

References onert_micro::Ok, OM_LOG_AND_RETURN, onert_micro::execute::pal::Reducer< T, ReduceFn >::Reduce(), and onert_micro::UnknownError.