Legion Runtime
Public Member Functions | Protected Member Functions | List of all members
Legion::FutureMap Class Reference

#include <legion.h>

Inheritance diagram for Legion::FutureMap:
Legion::Unserializable< FutureMap >

Public Member Functions

 FutureMap (const FutureMap &map)
 
 FutureMap (FutureMap &&map) noexcept
 
bool exists (void) const
 
bool operator== (const FutureMap &f) const
 
bool operator< (const FutureMap &f) const
 
Future operator[] (const DomainPoint &point) const
 
FutureMapoperator= (const FutureMap &f)
 
FutureMapoperator= (FutureMap &&f) noexcept
 
template<typename T >
get_result (const DomainPoint &point, bool silence_warnings=false, const char *warning_string=NULL) const
 
Future get_future (const DomainPoint &point) const
 
void get_void_result (const DomainPoint &point, bool silence_warnings=false, const char *warning_string=NULL) const
 
template<typename RT , typename PT , unsigned DIM>
RT get_result (const PT point[DIM]) const
 
template<typename PT , unsigned DIM>
Future get_future (const PT point[DIM]) const
 
template<typename PT , unsigned DIM>
void get_void_result (const PT point[DIM]) const
 
void wait_all_results (bool silence_warnings=false, const char *warning_string=NULL) const
 
Domain get_future_map_domain (void) const
 
- Public Member Functions inherited from Legion::Unserializable< FutureMap >
size_t legion_buffer_size (void)
 
size_t legion_serialize (void *buffer)
 
size_t legion_deserialize (const void *buffer)
 

Protected Member Functions

FRIEND_ALL_RUNTIME_CLASSES FutureMap (Internal::FutureMapImpl *impl)
 

Detailed Description

Future maps are the values returned from asynchronous index space task launches. Future maps store futures for each of the points in the index space launch. The application can either wait for a point or choose to extract a future for the given point which will be filled in when the task for that point completes.

Future maps are handles that can be passes by value or stored in data structures. However, future maps should not escape the context in which they are created as the runtime garbage collects them after the enclosing task context completes execution.

Member Function Documentation

◆ get_future() [1/2]

Future Legion::FutureMap::get_future ( const DomainPoint point) const

Non-blocking call that will return a future that will contain the value from the given index task point when it completes.

Parameters
pointthe point task to wait for
Returns
a future for the index task point

◆ get_future() [2/2]

template<typename PT , unsigned DIM>
Future Legion::FutureMap::get_future ( const PT  point[DIM]) const
inline

An older method for getting a future corresponding to a point in an index task launch. This call is non-blocking and actually waiting for the task to complete will necessitate waiting on the future.

Parameters
pointthe index task point to get the future for
Returns
a future for the point in the index task launch

◆ get_future_map_domain()

Domain Legion::FutureMap::get_future_map_domain ( void  ) const

This method will return the domain of points that can be used to index into this future map.

Returns
domain of all points in the future map

◆ get_result() [1/2]

template<typename T >
T Legion::FutureMap::get_result ( const DomainPoint point,
bool  silence_warnings = false,
const char *  warning_string = NULL 
) const
inline

Block until we can return the result for the task executing for the given domain point.

Parameters
pointthe point task to wait for
silence_warningssilence any warnings for this blocking call
warning_stringa string to be reported with any warnings
Returns
the return value of the task

◆ get_result() [2/2]

template<typename RT , typename PT , unsigned DIM>
RT Legion::FutureMap::get_result ( const PT  point[DIM]) const
inline

An older method for getting the result of a point in an index space launch that is maintained for backwards compatibility.

Parameters
pointthe index task point to get the return value from
Returns
the return value of the index task point

◆ get_void_result() [1/2]

void Legion::FutureMap::get_void_result ( const DomainPoint point,
bool  silence_warnings = false,
const char *  warning_string = NULL 
) const

Blocking call that will return one the point in the index space task has executed.

Parameters
pointthe point task to wait for
silience_warningssilence any warnings for this blocking call
warning_stringa string to be reported with any warnings

◆ get_void_result() [2/2]

template<typename PT , unsigned DIM>
void Legion::FutureMap::get_void_result ( const PT  point[DIM]) const
inline

An older method for performing a blocking wait for a point in an index task launch.

Parameters
pointthe point in the index task launch to wait for

◆ wait_all_results()

void Legion::FutureMap::wait_all_results ( bool  silence_warnings = false,
const char *  warning_string = NULL 
) const

Wait for all the tasks in the index space launch of tasks to complete before returning.

Parameters
silence_warningssilience warnings for this blocking call
warning_stringa string to be reported with any warnings

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