ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
onert::ir::LayoutSet Class Reference

#include <LayoutSet.h>

Public Member Functions

 LayoutSet ()=default
 
 LayoutSet (std::initializer_list< Layout > layouts)
 
void add (const Layout &layout)
 
void remove (const Layout &layout)
 
uint32_t size () const
 
bool contains (const Layout &layout) const
 
LayoutSet operator| (const LayoutSet &other) const
 
LayoutSet operator& (const LayoutSet &other) const
 
LayoutSet operator- (const LayoutSet &other) const
 
std::unordered_set< Layout >::const_iterator begin () const
 
std::unordered_set< Layout >::const_iterator end () const
 

Detailed Description

Definition at line 29 of file LayoutSet.h.

Constructor & Destructor Documentation

◆ LayoutSet() [1/2]

onert::ir::LayoutSet::LayoutSet ( )
default

◆ LayoutSet() [2/2]

onert::ir::LayoutSet::LayoutSet ( std::initializer_list< Layout layouts)

Definition at line 22 of file LayoutSet.cc.

23{
24 for (auto &&layout : layouts)
25 {
26 _set.insert(layout);
27 }
28}

Member Function Documentation

◆ add()

void onert::ir::LayoutSet::add ( const Layout layout)
inline

Definition at line 36 of file LayoutSet.h.

36{ _set.insert(layout); }

Referenced by operator&(), and operator|().

◆ begin()

std::unordered_set< Layout >::const_iterator onert::ir::LayoutSet::begin ( ) const
inline

Definition at line 47 of file LayoutSet.h.

47{ return _set.begin(); }

◆ contains()

bool onert::ir::LayoutSet::contains ( const Layout layout) const
inline

Definition at line 39 of file LayoutSet.h.

39{ return _set.find(layout) != _set.end(); }

Referenced by operator&().

◆ end()

std::unordered_set< Layout >::const_iterator onert::ir::LayoutSet::end ( ) const
inline

Definition at line 48 of file LayoutSet.h.

48{ return _set.end(); }

◆ operator&()

LayoutSet onert::ir::LayoutSet::operator& ( const LayoutSet other) const

Definition at line 40 of file LayoutSet.cc.

41{
42 LayoutSet ret;
43 for (auto &&layout : other)
44 {
45 if (contains(layout))
46 {
47 ret.add(layout);
48 }
49 }
50 return ret;
51}
bool contains(const Layout &layout) const
Definition LayoutSet.h:39

References add(), and contains().

◆ operator-()

LayoutSet onert::ir::LayoutSet::operator- ( const LayoutSet other) const

Definition at line 53 of file LayoutSet.cc.

54{
55 auto ret = *this;
56 for (auto &&layout : other)
57 {
58 ret.remove(layout);
59 }
60 return ret;
61}

References remove().

◆ operator|()

LayoutSet onert::ir::LayoutSet::operator| ( const LayoutSet other) const

Definition at line 30 of file LayoutSet.cc.

31{
32 auto ret = *this;
33 for (auto &&layout : other)
34 {
35 ret.add(layout);
36 }
37 return ret;
38}

References add().

◆ remove()

void onert::ir::LayoutSet::remove ( const Layout layout)
inline

Definition at line 37 of file LayoutSet.h.

37{ _set.erase(layout); }

Referenced by operator-().

◆ size()

uint32_t onert::ir::LayoutSet::size ( ) const
inline

Definition at line 38 of file LayoutSet.h.

38{ return static_cast<uint32_t>(_set.size()); }

The documentation for this class was generated from the following files: