ONE - On-device Neural Engine
Loading...
Searching...
No Matches
nncc::core::ADT::kernel Namespace Reference

Data Structures

struct  Accessor
 
class  Buffer
 
class  IndexEnumerator
 
class  Layout
 
struct  NCHWLayout
 
struct  NHWCLayout
 
class  Overlay
 
struct  OverlayFactory
 
struct  Reader
 
class  Shape
 
struct  View
 
class  ViewImpl
 

Functions

template<typename T , typename LayoutImpl >
Buffer< T > make_buffer (const Shape &shape)
 
template<typename T , typename LayoutImpl >
Overlay< T, T * > make_overlay (const Shape &shape, T *base)
 
uint32_t num_elements (const Shape &shape)
 Return the number of elements in a kernel of a given shape.
 
bool operator== (const Shape &lhs, const Shape &rhs)
 

Function Documentation

◆ make_buffer()

template<typename T , typename LayoutImpl >
Buffer< T > nncc::core::ADT::kernel::make_buffer ( const Shape shape)

Definition at line 62 of file Buffer.h.

63{
64 return Buffer<T>{shape, LayoutImpl{}};
65}

◆ make_overlay()

template<typename T , typename LayoutImpl >
Overlay< T, T * > nncc::core::ADT::kernel::make_overlay ( const Shape shape,
T *  base 
)

◆ num_elements()

uint32_t nncc::core::ADT::kernel::num_elements ( const Shape shape)
inline

Return the number of elements in a kernel of a given shape.

WARN The result is valid only when the expected value is less than 2^32 - 1

Definition at line 61 of file Shape.h.

62{
63 return shape.count() * shape.depth() * shape.height() * shape.width();
64}
uint32_t width(void) const
Definition Shape.h:47
uint32_t height(void) const
Definition Shape.h:46
uint32_t count(void) const
Definition Shape.h:44
uint32_t depth(void) const
Definition Shape.h:45

References nncc::core::ADT::kernel::Shape::count(), nncc::core::ADT::kernel::Shape::depth(), nncc::core::ADT::kernel::Shape::height(), and nncc::core::ADT::kernel::Shape::width().

Referenced by ConvBackend::ConvBackend().

◆ operator==()

bool nncc::core::ADT::kernel::operator== ( const Shape lhs,
const Shape rhs 
)

Definition at line 28 of file Shape.cpp.

29{
30 return (l.count() == r.count()) && (l.depth() == r.depth()) && (l.height() == r.height()) &&
31 (l.width() == r.width());
32}