legate::ListLogicalArray#
-
class ListLogicalArray : public legate::LogicalArray#
Represents a logical array of variable-length lists.
Each element of the array is itself a list, potentially of different length. For example, a ListLogicalArray may represent:
[[a, b], [c], [d, e, f]]
This is stored using two arrays:
A descriptor array that defines the start and end indices of each sublist within the value data array. The descriptor array is stored as a series of
Rect<1>
s, wherelo
andhi
members indicate the start and end of each range.A value data array (
vardata
) containing all list elements in a flattened form.
For example:
descriptor: [ (0, 1), (2, 2), (3, 5) ] vardata: [ a, b, c, d, e, f ]
Where the mapping of
descriptor
tovardata
follows:descriptor vardata ---------- -------------------- (0, 1) ---> [ a, b ] (2, 2) ---> [ c ] (3, 5) ---> [ d, e, f ]
Note
The user can achieve the same effects of a
ListLogicalArray
themselves by applying an image constraint (image(Variable, Variable, ImageComputationHint)
) to twoLogicalArray
s when passing them to a task. In that casedescriptor
would bevar_function
whilevardata
would bevar_range
.Public Functions
-
LogicalArray descriptor() const#
Returns the sub-array for descriptors. Each element is a
Rect<1>
of start and end indices for each subregion invardata
.- Returns:
Sub-array’s for descriptors.
-
LogicalArray vardata() const#
Returns the sub-array for variable size data.
- Returns:
LogicalArray
of variable sized data.