Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
Realm::SparsityMapPublicImpl< N, T > Class Template Reference

#include <sparsity.h>

Inheritance diagram for Realm::SparsityMapPublicImpl< N, T >:
Collaboration diagram for Realm::SparsityMapPublicImpl< N, T >:

Public Member Functions

REALM_PUBLIC_API Event make_valid (bool precise=true)
 
REALM_PUBLIC_API bool is_valid (bool precise=true)
 
REALM_PUBLIC_API const std::vector< SparsityMapEntry< N, T > > & get_entries (void)
 
REALM_PUBLIC_API const std::vector< Rect< N, T > > & get_approx_rects (void)
 
REALM_PUBLIC_API bool overlaps (SparsityMapPublicImpl< N, T > *other, const Rect< N, T > &bounds, bool approx)
 
REALM_PUBLIC_API bool compute_covering (const Rect< N, T > &bounds, size_t max_rects, int max_overhead, std::vector< Rect< N, T > > &covering)
 

Protected Member Functions

 SparsityMapPublicImpl (void)
 

Protected Attributes

atomic< bool > entries_valid {false}
 
atomic< bool > approx_valid {false}
 
std::vector< SparsityMapEntry< N, T > > entries
 
std::vector< Rect< N, T > > approx_rects
 

Detailed Description

template<int N, typename T>
class Realm::SparsityMapPublicImpl< N, T >

SparsityMapPublicImpl is the public subset of the storage and functionality of the actual sparsity map implementation - this should be sufficient for all the needs of user code, but not for Realm internals (e.g. the part that actually computes new sparsity maps) - these objects are not allocated directly.

Constructor & Destructor Documentation

◆ SparsityMapPublicImpl()

template<int N, typename T >
Realm::SparsityMapPublicImpl< N, T >::SparsityMapPublicImpl ( void  )
protected

Member Function Documentation

◆ compute_covering()

template<int N, typename T >
REALM_PUBLIC_API bool Realm::SparsityMapPublicImpl< N, T >::compute_covering ( const Rect< N, T > &  bounds,
size_t  max_rects,
int  max_overhead,
std::vector< Rect< N, T > > &  covering 
)

Attempt to compute a set of covering rectangles. See IndexSpace<N,T>::compute_covering for a description of this.

Parameters
boundsthe bounds of the rectangle
max_rectsMaximum number of rectangles to use (0 = no limit).
max_overheadMaximum relative storage overhead (0 = no limit).
coveringVector to fill in with covering rectangles.
Returns
true if the covering was computed, false otherwise

◆ get_approx_rects()

template<int N, typename T >
REALM_PUBLIC_API const std::vector< Rect< N, T > > & Realm::SparsityMapPublicImpl< N, T >::get_approx_rects ( void  )

Get the approximate rectangles of this sparsity map. A sparsity map can exist in an approximate form as well - this is a bounded list of rectangles that are guaranteed to cover all actual entries.

Returns
the approximate rectangles of this sparsity map

◆ get_entries()

template<int N, typename T >
REALM_PUBLIC_API const std::vector< SparsityMapEntry< N, T > > & Realm::SparsityMapPublicImpl< N, T >::get_entries ( void  )

Get the entries of this sparsity map. A sparsity map entry is similar to an IndexSpace - it's a rectangle and optionally a reference to another SparsityMap OR a pointer to a HierarchicalBitMap, which is a dense array of bits describing the validity of each point in the rectangle.

Returns
the entries of this sparsity map

◆ is_valid()

template<int N, typename T >
REALM_PUBLIC_API bool Realm::SparsityMapPublicImpl< N, T >::is_valid ( bool  precise = true)

Check if this sparsity map is valid.

Parameters
preciseif true, the sparsity map is computed precisely
Returns
true if the sparsity map is valid, false otherwise

◆ make_valid()

template<int N, typename T >
REALM_PUBLIC_API Event Realm::SparsityMapPublicImpl< N, T >::make_valid ( bool  precise = true)

Make this sparsity map valid. Applications should call this method before attempting to use the contents of a sparsity map or otherwise defer the actual use until the returned event has triggered.

The valid sparsity map is called "completed" and is computed in a deferred fashion and fetched by other nodes on demand.

Parameters
preciseif true, the sparsity map is computed precisely
Returns
an event that triggers when the sparsity map is valid

◆ overlaps()

template<int N, typename T >
REALM_PUBLIC_API bool Realm::SparsityMapPublicImpl< N, T >::overlaps ( SparsityMapPublicImpl< N, T > *  other,
const Rect< N, T > &  bounds,
bool  approx 
)

Check if this sparsity map overlaps another sparsity map. This method is not cheap - try bounds-based checks first (see IndexSpace::overlaps).

Parameters
otherthe other sparsity map
boundsthe bounds of the other sparsity map
approxif true, use the approximate rectangles of this sparsity map
Returns
true if this sparsity map overlaps the other sparsity map, false otherwise

Member Data Documentation

◆ approx_rects

template<int N, typename T >
std::vector<Rect<N, T> > Realm::SparsityMapPublicImpl< N, T >::approx_rects
protected

◆ approx_valid

template<int N, typename T >
atomic<bool> Realm::SparsityMapPublicImpl< N, T >::approx_valid {false}
protected

◆ entries

template<int N, typename T >
std::vector<SparsityMapEntry<N, T> > Realm::SparsityMapPublicImpl< N, T >::entries
protected

◆ entries_valid

template<int N, typename T >
atomic<bool> Realm::SparsityMapPublicImpl< N, T >::entries_valid {false}
protected

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