Skip to content

Public API

Authorkrasow krasowAuthorejmeitz ejmeitz

User facing functions supported by Legate.jl. The cpp wrapper API is located here.

Runtime Control and Performance Timing

Legate.create_library Method
julia
create_library(name::String) -> Library

Creates a library in the runtime and registers the UFI interface with the C++ runtime.

source
Legate.get_runtime Function
julia
get_runtime() -> Runtime

Return the current Legate runtime instance.

This returns a handle to the singleton Runtime object managed by Legate.

source
Legate.has_finished Function
julia
has_finished() -> Bool

Check whether the Legate runtime has finished.

source
Legate.has_started Function
julia
has_started() -> Bool

Check whether the Legate runtime has started.

source
Legate.legate_finish Function
julia
legate_finish() -> Int32

Finalize the Legate runtime.

Returns an integer status code from the runtime shutdown procedure.

source
Legate.start_legate Function
julia
start_legate()

Start the Legate runtime.

This function initializes the Legate runtime and must be called before creating tasks or data objects.

source
Legate.time_microseconds Function
julia
time_microseconds() -> UInt64

Measure time in microseconds.

source
Legate.time_nanoseconds Function
julia
time_nanoseconds() -> UInt64

Measure time in nanoseconds.

source

Data Structures and Storage Management

Legate.code Function
julia
code(ty::LegateType) -> Int

Return the internal code representing the LegateType.

source
Legate.create_array Method
julia
create_array(shape::Vector{B}, ty::Type{T};
             nullable::Bool=false,
             optimize_scalar::Bool=false) 
where {T<:SUPPORTED_TYPES, B<:Integer} -> LogicalArray

Create 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.

source
Legate.create_array Method
julia
create_array(ty::LegateType; dim::Integer=1; 
             nullable::Bool=false) -> LogicalArray

Create an unbound array.

Arguments

  • ty: Element type of the array.

  • dim: Number of dimensions.

  • nullable: Whether the array can contain null values.

source
Legate.create_store Method
julia
create_store(shape::Vector{B}, ty::Type{T};
             optimize_scalar::Bool=false) 
where {T<:SUPPORTED_TYPES, B<:Integer} -> LogicalStore

Create a store with a specified shape.

Arguments

  • shape: Shape of the store.

  • ty: Element type.

  • optimize_scalar: Whether to optimize scalar storage.

source
Legate.create_store Method
julia
create_store(scalar::T; shape::Vector{B}=[1]) 
where {T<:SUPPORTED_TYPES, B<:Integer} -> LogicalStore

Create a store from a scalar value.

Arguments

  • scalar: Scalar value to store.

  • shape: Shape of the resulting store.

source
Legate.create_store Method
julia
create_store(ty::Type{T}; dim::Integer=1) -> LogicalStore

Create an unbound store.

Arguments

  • ty: Element type of the store.

  • dim: Dimensionality of the store.

source
Legate.data Method
julia
data(PhysicalArray) -> PhysicalStore
data(LogicalArray) -> LogicalStore

Return the underlying store of the array (physical or logical).

source
Legate.dim Method
julia
dim(PhysicalStore) -> Int
dim(LogicalStore) -> Int
dim(LogicalArray) -> Int
dim(PhysicalArray) -> Int

Return the number of dimensions of the array/store.

source
Legate.equal_storage Method
julia
equal_storage(store1::LogicalStore, store2::LogicalStore) -> Bool

Check if two logical stores refer to the same underlying physical store.

source
Legate.get_physical_store Method
julia
get_physical_store(LogicalStore) -> PhysicalStore
get_physical_store(LogicalArray) -> PhysicalStore

Return the underlying physical store of this logical store or array.

source
Legate.get_ptr Method
julia
get_ptr(LogicalStore) -> Ptr
get_ptr(LogicalArray) -> Ptr
get_ptr(PhysicalArray) -> Ptr
get_ptr(PhysicalStore) -> Ptr

Return the pointer to the underlying data of the array/store.

source
Legate.is_readable Function
julia
is_readable(PhysicalStore) -> Bool

Check if the physical store can be read.

source
Legate.is_reducible Function
julia
is_reducible(PhysicalStore) -> Bool

Check if the physical store supports reduction operations.

source
Legate.is_writable Function
julia
is_writable(PhysicalStore) -> Bool

Check if the physical store can be written to.

source
Legate.nullable Method
julia
nullable(LogicalArray) -> Bool
nullable(PhysicalArray) -> Bool

Check if the array supports null values.

source
Legate.promote Method
julia
promote(LogicalStore, T) -> LogicalStore

Return a new logical store with elements promoted to type T.

source
Legate.reinterpret_as Method
julia
reinterpret_as(LogicalStore, T) -> LogicalStore

Return a view of the logical store reinterpreted as type T.

source
Legate.slice Function
julia
slice(LogicalStore, indices...) -> LogicalStore

Return a sliced view of the logical store according to the given indices.

source
Legate.string_to_scalar Function
julia
string_to_scalar(str::AbstractString) -> Scalar

Convert a string to a Scalar.

source
Legate.supported_types Method
julia
supported_types()

See Legate.jl supported data types

source
Legate.type Method
julia
type(PhysicalStore) -> LegateType
type(LogicalStore) -> LegateType
type(LogicalArray) -> LegateType
type(PhysicalArray) -> LegateType

Return the data type of elements stored in the array/store.

source
Legate.unbound Method
julia
unbound(LogicalArray) -> Bool

Check if the logical array is unbound (not tied to a physical store).

source
Legate.valid Function
julia
valid(PhysicalStore) -> Bool

Check if the physical store is in a valid state.

source

Task Creation and Execution

Legate.add_constraint Function
julia
add_constraint(AutoTask, c::Constraint)

Add a constraint to the task.

source
Legate.add_input Method
julia
add_input(AutoTask, LogicalArray) -> Variable
add_input(ManualTask, LogicalStore) -> Variable

Add a logical array/store as an input to the task.

source
Legate.add_output Method
julia
add_output(AutoTask, LogicalArray) -> Variable
add_output(ManualTask, LogicalStore) -> Variable

Add a logical array/store as an output of the task.

source
Legate.add_scalar Function
julia
add_scalar(AutoTask, scalar::Scalar)
add_scalar(ManualTask, scalar::Scalar)

Add a scalar argument to the task.

source
Legate.align Function
julia
align(a::Variable, b::Variable) -> Constraint

Align two variables.

Returns a new constraint representing the alignment of a and b.

source
Legate.create_task Method
julia
create_task(rt::Runtime, lib::Library, id::LocalTaskID) -> AutoTask

Create 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.

source
Legate.default_alignment Method
julia
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.

source
Legate.submit_task Method
julia
submit_task(rt::Runtime, AutoTask)
submit_task(rt::Runtime, ManualTask)

Submit an manual/auto task to the runtime.

source

Core Types and Interfaces

Legate.AutoTask Type
julia
AutoTask

Represents an automatically scheduled task. Supports adding inputs, outputs, scalars, and constraints.

source
Legate.Constraint Type
julia
Constraint

Represents a dependency or restriction for a task, such as ordering or memory constraints.

source
Legate.GlobalTaskID Type
julia
GlobalTaskID

A globally unique identifier for a task across processes or nodes.

source
Legate.LegateType Type
julia
LegateType

Datatype of object within Legate. See Legate.supported_types() to see supported types.

source
Legate.Library Type
julia
Library

Represents a computational or data library. Serves as a container for tasks, arrays, and stores.

source
Legate.LocalTaskID Type
julia
LocalTaskID

A unique identifier for a task within a single process or node.

source
Legate.LogicalArray Type
julia
LogicalArray{T,N}

A logical view over a physical array. Supports unbound views and nullability checks. Wraps the underlying C++ LogicalArrayImpl.

source
Legate.LogicalStore Type
julia
LogicalStore{T,N}

Represents a logical view over a physical store. Supports reinterpretation, promotion, slicing, and storage queries. Wraps the underlying C++ LogicalStoreImpl.

source
Legate.ManualTask Type
julia
ManualTask

Represents a manually scheduled task. Supports adding inputs, outputs, and scalars.

source
Legate.PhysicalArray Type
julia
PhysicalArray

A physical array container. Provides access to dimensions, type, and raw data pointer.

source
Legate.PhysicalStore Type
julia
PhysicalStore

Represents a physical storage container. Provides methods to query its dimensions, type, and accessibility.

source
Legate.Scalar Type
julia
Scalar

Represents a scalar value used in tasks. Can be constructed from Float32, Float64, or Int.

source
Legate.Shape Type
julia
Shape

Represents the dimensions of an array or store. Can be constructed from a vector of UInt64.

source
Legate.Slice Type
julia
Slice

Represents a slice of an array or store. Can be constructed from optional start and stop indices.

source
Legate.StoreTarget Type
julia
StoreTarget

Represents the target storage type or location for a store in the mapping layer.

source
Legate.Variable Type
julia
Variable

Represents a variable in the task system, typically produced or consumed by tasks.

source