From de94d315e55b2994faa583d45ee312dfe6ede88e Mon Sep 17 00:00:00 2001 From: ejmeitz Date: Sat, 19 Sep 2026 12:50:17 -0500 Subject: [PATCH 1/7] Triggering CI build From 662102e7f716c496f35e61be5fad91baa87b6fd2 Mon Sep 17 00:00:00 2001 From: ejmeitz Date: Sat, 19 Sep 2026 12:50:17 -0500 Subject: [PATCH 2/7] Triggering CI build From 4986d85bf9c1f6a57b44e754373be5f876c81095 Mon Sep 17 00:00:00 2001 From: David Krasowska Date: Sat, 19 Sep 2026 15:05:11 -0500 Subject: [PATCH 3/7] CI: patch JLL CI when merging into main. Always run JLL CI (#102) --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b748a814..978737c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,8 @@ jobs: test: name: Julia ${{ matrix.julia }} - ${{ matrix.os }} needs: check_changes - if: ${{ github.base_ref == 'main' || needs.check_changes.outputs.wrapper_changed != 'true' }} + # Always run JLL CI on main (push/merge) and on PRs targeting main; otherwise skip when only wrappers changed + if: ${{ github.ref == 'refs/heads/main' || github.base_ref == 'main' || needs.check_changes.outputs.wrapper_changed != 'true' }} runs-on: ${{ matrix.os }} strategy: fail-fast: false From e68828a041a44ec680a7f2218ff9e616ccb144a5 Mon Sep 17 00:00:00 2001 From: krasow Date: Sat, 19 Sep 2026 16:30:51 -0500 Subject: [PATCH 4/7] Gate developer CI on wrapper changes; make developer.yml reusable --- .github/workflows/ci.yml | 19 +++++++++++++++++ .github/workflows/developer.yml | 38 ++------------------------------- 2 files changed, 21 insertions(+), 36 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 978737c3..8143fc29 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,8 +18,11 @@ on: - 'deps/build.jl' - 'deps/buildtools/**' - 'Project.toml' + - 'lib/legate_jl_wrapper/src/**' + - 'lib/legate_jl_wrapper/include/**' - 'lib/LegatePreferences/src/**' - '.github/workflows/ci.yml' + - '.github/workflows/developer.yml' - 'Dockerfile' # container.yml depends on this tags: - 'v*' @@ -32,8 +35,11 @@ on: - 'deps/build.jl' - 'deps/buildtools/**' - 'Project.toml' + - 'lib/legate_jl_wrapper/src/**' + - 'lib/legate_jl_wrapper/include/**' - 'lib/LegatePreferences/src/**' - '.github/workflows/ci.yml' + - '.github/workflows/developer.yml' - 'Dockerfile' # container.yml depends on this jobs: check_changes: @@ -50,6 +56,19 @@ jobs: wrapper: - 'lib/legate_jl_wrapper/**' + developer_tests: + name: Developer wrapper tests + needs: check_changes + # Build-from-source (developer) CI only when the wrapper changed, or on/into main + if: ${{ github.ref == 'refs/heads/main' || github.base_ref == 'main' || needs.check_changes.outputs.wrapper_changed == 'true' }} + permissions: + contents: read + packages: write + attestations: write + id-token: write + actions: write + uses: ./.github/workflows/developer.yml + test: name: Julia ${{ matrix.julia }} - ${{ matrix.os }} needs: check_changes diff --git a/.github/workflows/developer.yml b/.github/workflows/developer.yml index a4f1f597..b734fc07 100644 --- a/.github/workflows/developer.yml +++ b/.github/workflows/developer.yml @@ -1,44 +1,10 @@ # Develeper CI test. This will build the workflow using Jlls and building wrappers from SRC name: Develeper CI test +# Called by ci.yml (gated on wrapper changes / main); also runnable manually. on: + workflow_call: workflow_dispatch: - inputs: - tag: - description: 'Tag to build instead' - required: false - default: '' - mark_as_latest: - description: 'Mark as latest' - type: boolean - required: false - default: false - push: - paths: - - 'src/**' - - 'scripts/**' - - 'deps/build.jl' - - 'deps/buildtools/**' - - 'Project.toml' - - 'lib/legate_jl_wrapper/src/**' - - 'lib/legate_jl_wrapper/include/**' - - 'lib/LegatePreferences/src/**' - - '.github/workflows/developer.yml' - tags: - - 'v*' - branches: - - main - pull_request: - paths: - - 'src/**' - - 'scripts/**' - - 'deps/build.jl' - - 'deps/buildtools/**' - - 'Project.toml' - - 'lib/legate_jl_wrapper/src/**' - - 'lib/legate_jl_wrapper/include/**' - - 'lib/LegatePreferences/src/**' - - '.github/workflows/developer.yml' jobs: pkg_resolve: uses: ./.github/workflows/pkg_resolve.yml From 6016977ca94b828659d33afe98de4e08b927afe4 Mon Sep 17 00:00:00 2001 From: David Krasowska Date: Sat, 19 Sep 2026 16:46:09 -0500 Subject: [PATCH 5/7] Move C++ bindings into LegateInternal submodule (#104) * Move C++ bindings into LegateInternal submodule * Point Enums test at LegateInternal for wrapped types --- src/Legate.jl | 25 +++++++++--- src/api/data.jl | 81 +++++++++++++++++++++------------------ src/api/runtime.jl | 22 +++++------ src/api/tasks.jl | 36 +++++++++-------- src/utilities/attach.jl | 14 ++++--- src/utilities/type_map.jl | 61 +++++++++++++++-------------- test/tests/basic.jl | 11 ++---- 7 files changed, 137 insertions(+), 113 deletions(-) diff --git a/src/Legate.jl b/src/Legate.jl index 30261c5d..af0cccb7 100644 --- a/src/Legate.jl +++ b/src/Legate.jl @@ -98,8 +98,21 @@ if !isfile(WRAPPER_LIB_PATH) ) end -#! DO I NEED TO DLOPEN ANYTHING HERE FIRST? -@wrapmodule(() -> WRAPPER_LIB_PATH) +module LegateInternal + using CxxWrap + import ..WRAPPER_LIB_PATH + @wrapmodule(() -> WRAPPER_LIB_PATH) + function init() + @initcxx + end +end + +# Expose C++ types to the main Legate namespace for use in other files +using .LegateInternal: Library, Variable, Constraint, LocalTaskID, GlobalTaskID, + AutoTask, ManualTask, StoreTarget, Shape, Scalar, Slice, + StoreTargetOptional, PhysicalStore, PhysicalArray, + LogicalStoreImpl, LogicalArrayImpl, LogicalStorePartitionImpl, + LegateType, Domain, Runtime, Scope include("utilities/type_map.jl") #include("ufi.jl") @@ -133,10 +146,10 @@ function _finish_runtime() #Legate.shutdown_ufi() # shutdown UFI #end - Legate.has_finished() && return nothing + LegateInternal.has_finished() && return nothing # finish legate runtime - return Legate.legate_finish() + return LegateInternal.legate_finish() end function _configure_realm_backtrace!() @@ -153,7 +166,7 @@ function _start_runtime() Libdl.dlopen(LEGATE_LIB_PATH, Libdl.RTLD_GLOBAL | Libdl.RTLD_NOW) Libdl.dlopen(WRAPPER_LIB_PATH, Libdl.RTLD_GLOBAL | Libdl.RTLD_NOW) - Legate.start_legate() + LegateInternal.start_legate() LegatePreferences.maybe_warn_prerelease() #Legate.init_ufi() @@ -187,7 +200,7 @@ function __init__() LegatePreferences.check_unchanged() - @initcxx + LegateInternal.init() _is_precompiling() && return nothing diff --git a/src/api/data.jl b/src/api/data.jl index 28c1dd17..2dece8a1 100644 --- a/src/api/data.jl +++ b/src/api/data.jl @@ -21,7 +21,9 @@ supported_types() = SUPPORTED_TYPES Convert a string to a `Scalar`. """ -string_to_scalar +function string_to_scalar(str::AbstractString) + return LegateInternal.string_to_scalar(str) +end """ create_array(ty::LegateType; dim::Integer=1; @@ -35,7 +37,7 @@ Create an unbound array. - `nullable`: Whether the array can contain null values. """ function create_array(ty::Type{T}; dim::Integer=1, nullable::Bool=false) where {T<:SUPPORTED_TYPES} - impl = create_unbound_array(to_legate_type(ty), dim, nullable) # cxxwrap call + impl = LegateInternal.create_unbound_array(to_legate_type(ty), dim, nullable) # cxxwrap call return LogicalArray{T,dim}(impl, nothing) end @@ -57,7 +59,7 @@ function create_array(shape::Vector{B}, ty::Type{T}; nullable::Bool=false, optimize_scalar::Bool=false) where {T<:SUPPORTED_TYPES,B<:Integer} lshape = Legate.Shape(to_cxx_vector(shape)) # convert to CxxWrap type - impl = create_array(lshape, to_legate_type(ty), nullable, optimize_scalar) # cxxwrap call + impl = LegateInternal.create_array(lshape, to_legate_type(ty), nullable, optimize_scalar) # cxxwrap call return LogicalArray{T,length(shape)}(impl, Tuple(shape)) end @@ -71,7 +73,7 @@ Create an unbound store. - `dim`: Dimensionality of the store. """ function create_store(ty::Type{T}; dim::Integer=1) where {T<:SUPPORTED_TYPES} - impl = create_unbound_store(to_legate_type(ty), dim) # cxxwrap call + impl = LegateInternal.create_unbound_store(to_legate_type(ty), dim) # cxxwrap call return LogicalStore{T,dim}(impl, nothing) end @@ -90,7 +92,7 @@ Create a store with a specified shape. function create_store(shape::Vector{B}, ty::Type{T}; optimize_scalar::Bool=false) where {T<:SUPPORTED_TYPES,B<:Integer} lshape = Legate.Shape(to_cxx_vector(shape)) # convert to CxxWrap type - impl = create_store(lshape, to_legate_type(ty), optimize_scalar) # cxxwrap call + impl = LegateInternal.create_store(lshape, to_legate_type(ty), optimize_scalar) # cxxwrap call return LogicalStore{T,length(shape)}(impl, Tuple(shape)) end @@ -106,7 +108,7 @@ Create a store from a scalar value. """ function create_store(scalar::T; shape::Vector{B}=[1]) where {T<:SUPPORTED_TYPES,B<:Integer} lshape = Legate.Shape(to_cxx_vector(shape)) # convert to CxxWrap type - impl = store_from_scalar(Legate.Scalar(scalar), lshape) # cxxwrap call + impl = LegateInternal.store_from_scalar(Legate.Scalar(scalar), lshape) # cxxwrap call return LogicalStore{T,length(shape)}(impl, Tuple(shape)) end @@ -118,7 +120,7 @@ end Return the number of dimensions of the array/store. """ -dim(x::Union{LogicalArray,LogicalStore}) = dim(x.handle) # cxxwrap call +dim(x::Union{LogicalArray,LogicalStore}) = LegateInternal.dim(x.handle) # cxxwrap call """ type(PhysicalStore) -> LegateType @@ -128,42 +130,42 @@ dim(x::Union{LogicalArray,LogicalStore}) = dim(x.handle) # cxxwrap call Return the data type of elements stored in the array/store. """ -type(x::Union{LogicalArray,LogicalStore}) = type(x.handle) # cxxwrap call +type(x::Union{LogicalArray,LogicalStore}) = LegateInternal.type(x.handle) # cxxwrap call """ code(ty::LegateType) -> Int Return the internal code representing the `LegateType`. """ -code +code(ty::LegateType) = LegateInternal.code(ty) """ is_readable(PhysicalStore) -> Bool Check if the physical store can be read. """ -is_readable +is_readable(s::PhysicalStore) = LegateInternal.is_readable(s) """ is_writable(PhysicalStore) -> Bool Check if the physical store can be written to. """ -is_writable +is_writable(s::PhysicalStore) = LegateInternal.is_writable(s) """ is_reducible(PhysicalStore) -> Bool Check if the physical store supports reduction operations. """ -is_reducible +is_reducible(s::PhysicalStore) = LegateInternal.is_reducible(s) """ valid(PhysicalStore) -> Bool Check if the physical store is in a valid state. """ -valid +valid(s::PhysicalStore) = LegateInternal.valid(s) """ reinterpret_as(LogicalStore, T) -> LogicalStore @@ -173,8 +175,8 @@ Return a view of the logical store reinterpreted as type `T`. function reinterpret_as( store::LogicalStore, ::Type{T} ) where {T<:SUPPORTED_TYPES} - impl = reinterpret_as(store.handle, to_legate_type(T)) # cxxwrap call - return LogicalStore{T,dim(impl)}(impl, store.dims) + impl = LegateInternal.reinterpret_as(store.handle, to_legate_type(T)) # cxxwrap call + return LogicalStore{T,LegateInternal.dim(impl)}(impl, store.dims) end """ @@ -185,8 +187,8 @@ Return a new logical store with elements promoted to type `T`. function promote( store::LogicalStore, ::Type{T} ) where {T<:SUPPORTED_TYPES} - impl = promote(store.handle, to_legate_type(T)) # cxxwrap call - return LogicalStore{T,dim(impl)}(impl, store.dims) + impl = LegateInternal.promote(store.handle, to_legate_type(T)) # cxxwrap call + return LogicalStore{T,LegateInternal.dim(impl)}(impl, store.dims) end """ @@ -194,7 +196,10 @@ end Return a sliced view of the logical store according to the given indices. """ -slice +function slice(store::LogicalStore, indices...) + impl = LegateInternal.slice(store.handle, indices...) + return LogicalStore{eltype(store),Int(LegateInternal.dim(impl))}(impl, nothing) +end """ get_physical_store(LogicalStore) -> PhysicalStore @@ -203,17 +208,17 @@ slice Return the underlying physical store of this logical store or array. """ function get_physical_store(x::LogicalStore) - return get_physical_store(x.handle, StoreTargetOptional{StoreTarget}()) + return LegateInternal.get_physical_store(x.handle, StoreTargetOptional{StoreTarget}()) end function get_physical_store(x::LogicalStore, target::StoreTarget) - return get_physical_store(x.handle, StoreTargetOptional{StoreTarget}(target)) + return LegateInternal.get_physical_store(x.handle, StoreTargetOptional{StoreTarget}(target)) end function get_physical_array(x::LogicalArray) - return get_physical_array(x.handle, StoreTargetOptional{StoreTarget}()) + return LegateInternal.get_physical_array(x.handle, StoreTargetOptional{StoreTarget}()) end function get_physical_array(x::LogicalArray, target::StoreTarget) - return get_physical_array(x.handle, StoreTargetOptional{StoreTarget}(target)) + return LegateInternal.get_physical_array(x.handle, StoreTargetOptional{StoreTarget}(target)) end """ @@ -221,7 +226,7 @@ end Check if two logical stores refer to the same underlying physical store. """ -equal_storage(x::LogicalStore, y::LogicalStore) = equal_storage(x.handle, y.handle) # cxxwrap call +equal_storage(x::LogicalStore, y::LogicalStore) = LegateInternal.equal_storage(x.handle, y.handle) # cxxwrap call """ nullable(LogicalArray) -> Bool @@ -229,7 +234,7 @@ equal_storage(x::LogicalStore, y::LogicalStore) = equal_storage(x.handle, y.hand Check if the array supports null values. """ -nullable(x::LogicalArray) = nullable(x.handle) # cxxwrap call +nullable(x::LogicalArray) = LegateInternal.nullable(x.handle) # cxxwrap call """ data(PhysicalArray) -> PhysicalStore @@ -237,14 +242,14 @@ nullable(x::LogicalArray) = nullable(x.handle) # cxxwrap call Return the underlying store of the array (physical or logical). """ -data(x::LogicalArray) = data(x.handle) # cxxwrap call +data(x::LogicalArray) = LegateInternal.data(x.handle) # cxxwrap call """ unbound(LogicalArray) -> Bool Check if the logical array is unbound (not tied to a physical store). """ -unbound(x::LogicalArray) = unbound(x.handle) # cxxwrap call +unbound(x::LogicalArray) = LegateInternal.unbound(x.handle) # cxxwrap call # Delegation for wrappers Base.eltype(x::Union{LogicalArray{T},LogicalStore{T}}) where {T} = T @@ -268,21 +273,21 @@ end function get_ptr(arr::LogicalArray) # LogicalArray -> PhysicalArray -> PhysicalStore -> Ptr - return get_ptr(data(get_physical_array(arr))) # cxxwrap call + return get_ptr(LegateInternal.data(get_physical_array(arr))) # cxxwrap call end function get_ptr(arr::LogicalArray, target::StoreTarget) - return get_ptr(data(get_physical_array(arr, target))) + return get_ptr(LegateInternal.data(get_physical_array(arr, target))) end function get_ptr(arr::PhysicalArray) # PhysicalArray -> PhysicalStore -> Ptr - return get_ptr(data(arr)) # cxxwrap call + return get_ptr(LegateInternal.data(arr)) # cxxwrap call end function get_ptr(arr::PhysicalStore) # PhysicalStore -> Ptr - return _get_ptr(CxxWrap.CxxPtr(arr)) # cxxwrap call + return LegateInternal._get_ptr(CxxWrap.CxxPtr(arr)) # cxxwrap call end """ @@ -303,10 +308,10 @@ Read a dataset from an HDF5 file into a LogicalArray. function h5read(path::String, name::String; layout::Symbol=:row) layout in (:row, :col) || throw(ArgumentError("layout must be :row or :col, got :$(layout)")) - impl = _read_h5(path, name) # cxxwrap call - ndim = Int(dim(impl)) - shp = Tuple(Int.(shape(impl))) - T = code_type_map[Int(code(type(impl)))] + impl = LegateInternal._read_h5(path, name) # cxxwrap call + ndim = Int(LegateInternal.dim(impl)) + shp = Tuple(Int.(LegateInternal.shape(impl))) + T = code_type_map[Int(code(LegateInternal.type(impl)))] return LogicalArray{T,ndim}(impl, shp, layout) end @@ -327,15 +332,17 @@ function h5write(path::String, name::String, array::LogicalArray{T,N}) where {T, @warn "Writing a column-major array; read it back with " * "`Legate.h5read($(repr(path)), $(repr(name)); layout=:col)`." end - return _write_h5(array.handle, path, name) + return LegateInternal._write_h5(array.handle, path, name) end function partition_by_tiling(store::LogicalStore{T,N}, tile_shape) where {T,N} - impl = partition_by_tiling(store.handle, to_cxx_vector(tile_shape)) # cxxwrap call + impl = LegateInternal.partition_by_tiling(store.handle, to_cxx_vector(tile_shape)) # cxxwrap call return LogicalStorePartition{T,N}(impl) end function partition_by_tiling(store::LogicalStore{T,N}, tile_shape, color_shape) where {T,N} - impl = partition_by_tiling(store.handle, to_cxx_vector(tile_shape), to_cxx_vector(color_shape)) # cxxwrap call + impl = LegateInternal.partition_by_tiling( + store.handle, to_cxx_vector(tile_shape), to_cxx_vector(color_shape) + ) # cxxwrap call return LogicalStorePartition{T,N}(impl) end diff --git a/src/api/runtime.jl b/src/api/runtime.jl index 48bc43cd..c6ccfce9 100644 --- a/src/api/runtime.jl +++ b/src/api/runtime.jl @@ -6,7 +6,7 @@ Start the Legate runtime. This function initializes the Legate runtime and must be called before creating tasks or data objects. """ -start_legate +start_legate() = LegateInternal.start_legate() """ legate_finish() -> Int32 @@ -15,7 +15,7 @@ Finalize the Legate runtime. Returns an integer status code from the runtime shutdown procedure. """ -legate_finish +legate_finish() = LegateInternal.legate_finish() """ get_runtime() -> Runtime @@ -24,21 +24,21 @@ Return the current Legate runtime instance. This returns a handle to the singleton `Runtime` object managed by Legate. """ -get_runtime +get_runtime() = LegateInternal.get_runtime() """ has_started() -> Bool Check whether the Legate runtime has started. """ -has_started +has_started() = LegateInternal.has_started() """ has_finished() -> Bool Check whether the Legate runtime has finished. """ -has_finished +has_finished() = LegateInternal.has_finished() """ runtime_sync() @@ -47,7 +47,7 @@ Block until all pending Legate tasks have completed. Useful before reading files written by `h5write` or other async operations. """ -runtime_sync +runtime_sync() = LegateInternal.runtime_sync() """ create_library(name::String) -> Library @@ -57,12 +57,12 @@ with the C++ runtime. """ function create_library(name::String) rt = get_runtime() - lib = _create_library(rt, name) # cxxwrap call + lib = LegateInternal._create_library(rt, name) # cxxwrap call # registers JuliaCustomTask::cpu_variant to legate runtime - _ufi_interface_register(lib) # cxxwrap call + LegateInternal._ufi_interface_register(lib) # cxxwrap call request_ptr = _get_request_ptr() # initialize async system to handle Julia task requests - _initialize_async_system(request_ptr) # cxxwrap call + LegateInternal._initialize_async_system(request_ptr) # cxxwrap call @debug "Registered library with C++ runtime" return lib end @@ -72,11 +72,11 @@ end Measure time in microseconds. """ -time_microseconds +time_microseconds() = LegateInternal.time_microseconds() """ time_nanoseconds() -> UInt64 Measure time in nanoseconds. """ -time_nanoseconds +time_nanoseconds() = LegateInternal.time_nanoseconds() diff --git a/src/api/tasks.jl b/src/api/tasks.jl index f723f293..9f43d5e6 100644 --- a/src/api/tasks.jl +++ b/src/api/tasks.jl @@ -8,9 +8,11 @@ Create an auto task in the runtime. - `lib`: The library to associate with the task. - `id`: The local task identifier. """ -create_task(rt::CxxPtr{Runtime}, lib::Library, id::LocalTaskID) = create_auto_task(rt, lib, id) +function create_task(rt::CxxPtr{Runtime}, lib::Library, id::LocalTaskID) + return LegateInternal.create_auto_task(rt, lib, id) +end function create_task(rt::CxxPtr{Runtime}, lib::Library, id::LocalTaskID, domain::Domain) - return create_manual_task(rt, lib, id, domain) + return LegateInternal.create_manual_task(rt, lib, id, domain) end """ @@ -20,8 +22,8 @@ end Submit an manual/auto task to the runtime. """ function submit_task(rt::CxxPtr{Runtime}, task::AutoTask) - rt_ptr = Legate.get_obj_ptr(rt[]) - task_ptr = Legate.get_obj_ptr(task) + rt_ptr = LegateInternal.get_obj_ptr(rt[]) + task_ptr = LegateInternal.get_obj_ptr(task) GC.@preserve rt task begin Base.@threadcall( :submit_auto_task, Cvoid, (Ptr{Cvoid}, Ptr{Cvoid}), rt_ptr, task_ptr @@ -30,8 +32,8 @@ function submit_task(rt::CxxPtr{Runtime}, task::AutoTask) end function submit_task(rt::CxxPtr{Runtime}, task::ManualTask) - rt_ptr = Legate.get_obj_ptr(rt[]) - task_ptr = Legate.get_obj_ptr(task) + rt_ptr = LegateInternal.get_obj_ptr(rt[]) + task_ptr = LegateInternal.get_obj_ptr(task) GC.@preserve rt task begin Base.@threadcall( :submit_manual_task, Cvoid, (Ptr{Cvoid}, Ptr{Cvoid}), rt_ptr, task_ptr @@ -46,7 +48,7 @@ Align two variables. Returns a new constraint representing the alignment of `a` and `b`. """ -align +align(a::Variable, b::Variable) = LegateInternal.align(a, b) """ default_alignment(task::AutoTask, inputs::Vector{Variable}, outputs::Vector{Variable}) @@ -75,7 +77,7 @@ end Add a constraint to the task. """ -add_constraint +add_constraint(task::AutoTask, c::Constraint) = LegateInternal.add_constraint(task, c) """ add_input(AutoTask, LogicalArray) -> Variable @@ -87,7 +89,7 @@ function add_input( task::Union{AutoTask,ManualTask}, item::Union{LogicalArray,LogicalStore,LogicalStorePartition}, ) - return add_input(task, item.handle) + return LegateInternal.add_input(task, item.handle) end """ @@ -100,7 +102,7 @@ function add_output( task::Union{AutoTask,ManualTask}, item::Union{LogicalArray,LogicalStore,LogicalStorePartition}, ) - return add_output(task, item.handle) + return LegateInternal.add_output(task, item.handle) end """ @@ -109,16 +111,18 @@ end Add a scalar argument to the task. """ -add_scalar +function add_scalar(task::Union{AutoTask,ManualTask}, scalar::Scalar) + return LegateInternal.add_scalar(task, scalar) +end function add_broadcast(task::AutoTask, item::Union{LogicalArray,LogicalStore}) - part = find_or_declare_partition(task, item.handle) - return add_constraint(task, broadcast(part)) + part = LegateInternal.find_or_declare_partition(task, item.handle) + return add_constraint(task, LegateInternal.broadcast(part)) end function add_broadcast(task::AutoTask, item::Union{LogicalArray,LogicalStore}, axes) - part = find_or_declare_partition(task, item.handle) - return add_constraint(task, broadcast(part, axes)) + part = LegateInternal.find_or_declare_partition(task, item.handle) + return add_constraint(task, LegateInternal.broadcast(part, axes)) end # with_scope("my_debug_label") do @@ -129,6 +133,6 @@ function with_scope(f, provenance::String) try return f() finally - Legate.destroy_scope(scope) + LegateInternal.destroy_scope(scope) end end diff --git a/src/utilities/attach.jl b/src/utilities/attach.jl index 89c9328f..a2073d34 100644 --- a/src/utilities/attach.jl +++ b/src/utilities/attach.jl @@ -41,7 +41,9 @@ layout. `shape` may differ from `size(arr)` when `prod(shape) == length(arr)`, e.g. when attaching a transposed buffer that holds C-order bytes for `shape`. """ function attach_external_row_major(arr::Array{T,N}; shape::Dims{N}=size(arr)) where {T,N} - return _attach_external_sysmem(arr, shape, attach_external_store_sysmem_row_major) + return _attach_external_sysmem( + arr, shape, LegateInternal.attach_external_store_sysmem_row_major + ) end """ @@ -51,7 +53,9 @@ Attach a Julia `Array` as an external Legate store with **col-major (Fortran-ord layout. Reserved for future use; prefer `attach_external_row_major` for cuNumeric. """ function attach_external_col_major(arr::Array{T,N}; shape::Dims{N}=size(arr)) where {T,N} - return _attach_external_sysmem(arr, shape, attach_external_store_sysmem_col_major) + return _attach_external_sysmem( + arr, shape, LegateInternal.attach_external_store_sysmem_col_major + ) end """ @@ -71,7 +75,7 @@ end function _get_physical_store(x::LogicalArray, target) # LogicalArray -> PhysicalArray -> PhysicalStore phys_arr = Legate.get_physical_array(x, target) - return Legate.data(phys_arr) + return LegateInternal.data(phys_arr) end function Base.copyto!( @@ -81,8 +85,8 @@ function Base.copyto!( # PhysicalStore accessors must run on the Legate/Legion toplevel task thread. # @threadcall uses a libuv worker thread, which 26.06+ rejects with: # "Invalid request to wait until a physical region is valid outside of Toplevel Task". - phys_dest = _get_physical_store(dest, Legate.SYSMEM) - phys_src = _get_physical_store(src, Legate.SYSMEM) + phys_dest = _get_physical_store(dest, LegateInternal.SYSMEM) + phys_src = _get_physical_store(src, LegateInternal.SYSMEM) dest_ptr = Ptr{T}(Legate.get_ptr(phys_dest)) src_ptr = Ptr{T}(Legate.get_ptr(phys_src)) diff --git a/src/utilities/type_map.jl b/src/utilities/type_map.jl index d490ee85..d5a36483 100644 --- a/src/utilities/type_map.jl +++ b/src/utilities/type_map.jl @@ -21,41 +21,41 @@ export LType, to_legate_type # is legion Complex128 same as ComplexF64 in julia? # These are methods that return a Legate::Type global const type_map = Dict{Type,Function}( - Bool => Legate.bool_, - Int8 => Legate.int8, - Int16 => Legate.int16, - Int32 => Legate.int32, - Int64 => Legate.int64, - UInt8 => Legate.uint8, - UInt16 => Legate.uint16, - UInt32 => Legate.uint32, - UInt64 => Legate.uint64, - Float16 => Legate.float16, - Float32 => Legate.float32, - Float64 => Legate.float64, - # ComplexF16 => Legate.complex32, #COMMENTED OUT IN WRAPPER - ComplexF32 => Legate.complex64, - ComplexF64 => Legate.complex128, + Bool => LegateInternal.bool_, + Int8 => LegateInternal.int8, + Int16 => LegateInternal.int16, + Int32 => LegateInternal.int32, + Int64 => LegateInternal.int64, + UInt8 => LegateInternal.uint8, + UInt16 => LegateInternal.uint16, + UInt32 => LegateInternal.uint32, + UInt64 => LegateInternal.uint64, + Float16 => LegateInternal.float16, + Float32 => LegateInternal.float32, + Float64 => LegateInternal.float64, + # ComplexF16 => LegateInternal.complex32, #COMMENTED OUT IN WRAPPER + ComplexF32 => LegateInternal.complex64, + ComplexF64 => LegateInternal.complex128, ) # hate this but casting to Int gets around # a bug where TypeCode can't be used at compile time global const code_type_map = Dict{Int,Type}( - Int(Legate.BOOL) => Bool, - Int(Legate.INT8) => Int8, - Int(Legate.INT16) => Int16, - Int(Legate.INT32) => Int32, - Int(Legate.INT64) => Int64, - Int(Legate.UINT8) => UInt8, - Int(Legate.UINT16) => UInt16, - Int(Legate.UINT32) => UInt32, - Int(Legate.UINT64) => UInt64, - Int(Legate.FLOAT16) => Float16, - Int(Legate.FLOAT32) => Float32, - Int(Legate.FLOAT64) => Float64, - Int(Legate.COMPLEX64) => ComplexF32, - Int(Legate.COMPLEX128) => ComplexF64, - Int(Legate.STRING) => String, # CxxString? + Int(LegateInternal.BOOL) => Bool, + Int(LegateInternal.INT8) => Int8, + Int(LegateInternal.INT16) => Int16, + Int(LegateInternal.INT32) => Int32, + Int(LegateInternal.INT64) => Int64, + Int(LegateInternal.UINT8) => UInt8, + Int(LegateInternal.UINT16) => UInt16, + Int(LegateInternal.UINT32) => UInt32, + Int(LegateInternal.UINT64) => UInt64, + Int(LegateInternal.FLOAT16) => Float16, + Int(LegateInternal.FLOAT32) => Float32, + Int(LegateInternal.FLOAT64) => Float64, + Int(LegateInternal.COMPLEX64) => ComplexF32, + Int(LegateInternal.COMPLEX128) => ComplexF64, + Int(LegateInternal.STRING) => String, # CxxString? ) to_legate_type(T::Type) = Legate.type_map[T]() @@ -64,7 +64,6 @@ to_legate_type(T::Type) = Legate.type_map[T]() # TODO, check if anycode depends on LType calls. LType(T::Type) = to_legate_type(T) - function get_code_type(type_code; throw=true) val = if haskey(code_type_map, type_code) code_type_map[type_code] diff --git a/test/tests/basic.jl b/test/tests/basic.jl index 4b3434fb..5fd997aa 100644 --- a/test/tests/basic.jl +++ b/test/tests/basic.jl @@ -1,10 +1,7 @@ - @testset verbose=true "Enums" begin + @test isdefined(Legate.LegateInternal, :LegionPrivilegeMode) + @test isdefined(Legate.LegateInternal, :TypeCode) - @test isdefined(Legate, :LegionPrivilegeMode) - @test isdefined(Legate, :TypeCode) - - @test Legate.to_legate_type(Int8) isa Legate.LegateTypeAllocated - -end \ No newline at end of file + @test Legate.to_legate_type(Int8) isa Legate.LegateInternal.LegateTypeAllocated +end From b191ccbc27b27f4b7ea7e101919868b834e805ab Mon Sep 17 00:00:00 2001 From: krasow Date: Fri, 16 Oct 2026 12:34:39 -0500 Subject: [PATCH 6/7] up version in Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 8013c8a2..9a91984c 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "Legate" uuid = "1238f2cf-6593-4d60-9aca-2f5364e49909" -version = "0.2.4" +version = "0.2.5" [workspace] projects = ["test", "dev"] From 07843c755b9cc2bbde5ba92f0db3f6f1b919268e Mon Sep 17 00:00:00 2001 From: krasow Date: Fri, 16 Oct 2026 12:44:04 -0500 Subject: [PATCH 7/7] update vitepress requirement --- docs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/package.json b/docs/package.json index 5474266a..c46870bf 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "devDependencies": { - "@nolebase/vitepress-plugin-enhanced-readabilities": "^2.15.0", + "@nolebase/vitepress-plugin-enhanced-readabilities": "~2.18.1", "@types/d3-format": "^3.0.4", "@types/node": "^22.13.9", "markdown-it": "^14.1.0",