Public API
AuthorAuthorUser facing functions supported by Legate.jl. The cpp wrapper API is located here.
Runtime Control and Performance Timing
Legate.create_library Method
create_library(name::String) -> LibraryCreates a library in the runtime and registers the UFI interface with the C++ runtime.
sourceLegate.get_runtime Function
get_runtime() -> RuntimeReturn the current Legate runtime instance.
This returns a handle to the singleton Runtime object managed by Legate.
Legate.has_finished Function
has_finished() -> BoolCheck whether the Legate runtime has finished.
sourceLegate.has_started Function
has_started() -> BoolCheck whether the Legate runtime has started.
sourceLegate.legate_finish Function
legate_finish() -> Int32Finalize the Legate runtime.
Returns an integer status code from the runtime shutdown procedure.
sourceLegate.start_legate Function
start_legate()Start the Legate runtime.
This function initializes the Legate runtime and must be called before creating tasks or data objects.
sourceLegate.time_microseconds Function
time_microseconds() -> UInt64Measure time in microseconds.
sourceData Structures and Storage Management
Legate.code Function
code(ty::LegateType) -> IntReturn the internal code representing the LegateType.
Legate.create_array Method
create_array(shape::Vector{B}, ty::Type{T};
nullable::Bool=false,
optimize_scalar::Bool=false)
where {T<:SUPPORTED_TYPES, B<:Integer} -> LogicalArrayCreate an array with a specified shape.
Arguments
shape: Shape of the array.ty: Element type.nullable: Whether the array can contain null values.optimize_scalar: Whether to optimize scalar storage.
Legate.create_array Method
create_array(ty::LegateType; dim::Integer=1;
nullable::Bool=false) -> LogicalArrayCreate an unbound array.
Arguments
ty: Element type of the array.dim: Number of dimensions.nullable: Whether the array can contain null values.
Legate.create_store Method
create_store(shape::Vector{B}, ty::Type{T};
optimize_scalar::Bool=false)
where {T<:SUPPORTED_TYPES, B<:Integer} -> LogicalStoreCreate a store with a specified shape.
Arguments
shape: Shape of the store.ty: Element type.optimize_scalar: Whether to optimize scalar storage.
Legate.create_store Method
create_store(scalar::T; shape::Vector{B}=[1])
where {T<:SUPPORTED_TYPES, B<:Integer} -> LogicalStoreCreate a store from a scalar value.
Arguments
scalar: Scalar value to store.shape: Shape of the resulting store.
Legate.create_store Method
create_store(ty::Type{T}; dim::Integer=1) -> LogicalStoreCreate an unbound store.
Arguments
ty: Element type of the store.dim: Dimensionality of the store.
Legate.data Method
data(PhysicalArray) -> PhysicalStore
data(LogicalArray) -> LogicalStoreReturn the underlying store of the array (physical or logical).
sourceLegate.dim Method
dim(PhysicalStore) -> Int
dim(LogicalStore) -> Int
dim(LogicalArray) -> Int
dim(PhysicalArray) -> IntReturn the number of dimensions of the array/store.
sourceLegate.equal_storage Method
equal_storage(store1::LogicalStore, store2::LogicalStore) -> BoolCheck if two logical stores refer to the same underlying physical store.
sourceLegate.get_physical_store Method
get_physical_store(LogicalStore) -> PhysicalStore
get_physical_store(LogicalArray) -> PhysicalStoreReturn the underlying physical store of this logical store or array.
sourceLegate.get_ptr Method
get_ptr(LogicalStore) -> Ptr
get_ptr(LogicalArray) -> Ptr
get_ptr(PhysicalArray) -> Ptr
get_ptr(PhysicalStore) -> PtrReturn the pointer to the underlying data of the array/store.
sourceLegate.is_readable Function
is_readable(PhysicalStore) -> BoolCheck if the physical store can be read.
sourceLegate.is_reducible Function
is_reducible(PhysicalStore) -> BoolCheck if the physical store supports reduction operations.
sourceLegate.is_writable Function
is_writable(PhysicalStore) -> BoolCheck if the physical store can be written to.
sourceLegate.nullable Method
nullable(LogicalArray) -> Bool
nullable(PhysicalArray) -> BoolCheck if the array supports null values.
sourceLegate.promote Method
promote(LogicalStore, T) -> LogicalStoreReturn a new logical store with elements promoted to type T.
Legate.reinterpret_as Method
reinterpret_as(LogicalStore, T) -> LogicalStoreReturn a view of the logical store reinterpreted as type T.
Legate.slice Function
slice(LogicalStore, indices...) -> LogicalStoreReturn a sliced view of the logical store according to the given indices.
sourceLegate.string_to_scalar Function
string_to_scalar(str::AbstractString) -> ScalarConvert a string to a Scalar.
Legate.type Method
type(PhysicalStore) -> LegateType
type(LogicalStore) -> LegateType
type(LogicalArray) -> LegateType
type(PhysicalArray) -> LegateTypeReturn the data type of elements stored in the array/store.
sourceLegate.unbound Method
unbound(LogicalArray) -> BoolCheck if the logical array is unbound (not tied to a physical store).
sourceLegate.valid Function
valid(PhysicalStore) -> BoolCheck if the physical store is in a valid state.
sourceTask Creation and Execution
Legate.add_constraint Function
add_constraint(AutoTask, c::Constraint)Add a constraint to the task.
sourceLegate.add_input Method
add_input(AutoTask, LogicalArray) -> Variable
add_input(ManualTask, LogicalStore) -> VariableAdd a logical array/store as an input to the task.
sourceLegate.add_output Method
add_output(AutoTask, LogicalArray) -> Variable
add_output(ManualTask, LogicalStore) -> VariableAdd a logical array/store as an output of the task.
sourceLegate.add_scalar Function
add_scalar(AutoTask, scalar::Scalar)
add_scalar(ManualTask, scalar::Scalar)Add a scalar argument to the task.
sourceLegate.align Function
align(a::Variable, b::Variable) -> ConstraintAlign two variables.
Returns a new constraint representing the alignment of a and b.
Legate.create_task Method
create_task(rt::Runtime, lib::Library, id::LocalTaskID) -> AutoTaskCreate an auto task in the runtime.
Arguments
rt: The current runtime instance.lib: The library to associate with the task.id: The local task identifier.
Legate.default_alignment Method
default_alignment(task::AutoTask, inputs::Vector{Variable}, outputs::Vector{Variable})Add default alignment constraints to the task. All inputs and outputs are aligned to the first input.
sourceLegate.submit_task Method
submit_task(rt::Runtime, AutoTask)
submit_task(rt::Runtime, ManualTask)Submit an manual/auto task to the runtime.
sourceCore Types and Interfaces
Legate.AutoTask Type
AutoTaskRepresents an automatically scheduled task. Supports adding inputs, outputs, scalars, and constraints.
sourceLegate.Constraint Type
ConstraintRepresents a dependency or restriction for a task, such as ordering or memory constraints.
sourceLegate.GlobalTaskID Type
GlobalTaskIDA globally unique identifier for a task across processes or nodes.
sourceLegate.LegateType Type
LegateTypeDatatype of object within Legate. See Legate.supported_types() to see supported types.
Legate.Library Type
LibraryRepresents a computational or data library. Serves as a container for tasks, arrays, and stores.
sourceLegate.LocalTaskID Type
LocalTaskIDA unique identifier for a task within a single process or node.
sourceLegate.LogicalArray Type
LogicalArray{T,N}A logical view over a physical array. Supports unbound views and nullability checks. Wraps the underlying C++ LogicalArrayImpl.
Legate.LogicalStore Type
LogicalStore{T,N}Represents a logical view over a physical store. Supports reinterpretation, promotion, slicing, and storage queries. Wraps the underlying C++ LogicalStoreImpl.
Legate.ManualTask Type
ManualTaskRepresents a manually scheduled task. Supports adding inputs, outputs, and scalars.
sourceLegate.PhysicalArray Type
PhysicalArrayA physical array container. Provides access to dimensions, type, and raw data pointer.
sourceLegate.PhysicalStore Type
PhysicalStoreRepresents a physical storage container. Provides methods to query its dimensions, type, and accessibility.
sourceLegate.Scalar Type
ScalarRepresents a scalar value used in tasks. Can be constructed from Float32, Float64, or Int.
Legate.Shape Type
ShapeRepresents the dimensions of an array or store. Can be constructed from a vector of UInt64.
Legate.Slice Type
SliceRepresents a slice of an array or store. Can be constructed from optional start and stop indices.
sourceLegate.StoreTarget Type
StoreTargetRepresents the target storage type or location for a store in the mapping layer.
sourceLegate.Variable Type
VariableRepresents a variable in the task system, typically produced or consumed by tasks.
source