ONE - On-device Neural Engine
Loading...
Searching...
No Matches
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 31 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 24 of file LayoutSet.cc.

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

Member Function Documentation

◆ add()

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

Definition at line 38 of file LayoutSet.h.

38{ _set.insert(layout); }

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

◆ begin()

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

Definition at line 49 of file LayoutSet.h.

49{ return _set.begin(); }

◆ contains()

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

Definition at line 41 of file LayoutSet.h.

41{ 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 50 of file LayoutSet.h.

50{ return _set.end(); }

◆ operator&()

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

Definition at line 42 of file LayoutSet.cc.

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

References add(), and contains().

◆ operator-()

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

Definition at line 55 of file LayoutSet.cc.

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

References remove().

◆ operator|()

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

Definition at line 32 of file LayoutSet.cc.

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

References add().

◆ remove()

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

Definition at line 39 of file LayoutSet.h.

39{ _set.erase(layout); }

Referenced by operator-().

◆ size()

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

Definition at line 40 of file LayoutSet.h.

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

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