Internal API
cuNumeric.NDArray Type
The NDArray type represents a multi-dimensional array in cuNumeric. It is a wrapper around a Legate array and provides various methods for array manipulation and operations. Finalizer calls nda_destroy_array to clean up the underlying Legate array when the NDArray is garbage collected.
cuNumeric.LegateType Method
LegateType(T::Type)Internal API
Converts a Julia type T to the corresponding Legate type.
cuNumeric.compare Method
compare(x, y, max_diff)Internal API
Compare two arrays x and y for approximate equality within a maximum difference max_diff.
Supports comparisons between:
an
NDArrayand a JuliaAbstractArraytwo
NDArraysa Julia
AbstractArrayand anNDArray
Returns true if the arrays have the same shape and element type (for mixed types), and all corresponding elements differ by no more than max_diff.
Emits warnings when array sizes or element types differ.
Warning
This function uses scalar indexing and should not be used in production code. This is meant for testing.
Notes
This is an internal API used by higher-level approximate equality functions.
Does not support relative tolerance (
rtol).
Behavior
Checks size compatibility.
Checks element type compatibility for
NDArrayvs Julia array.Iterates over elements using
CartesianIndicesto compare element-wise difference.
cuNumeric.destroy! Method
destroy!(arr::NDArray)Eagerly drop the underlying cuPyNumeric/Legate handle and update allocation counters. Safe to call more than once.
sourcecuNumeric.shape Method
shape(arr::NDArray)Internal API
Return the size of the given NDArray.
cuNumeric.slice_array Method
slice_array(slices::Vararg{Tuple{Union{Int,Nothing},Union{Int,Nothing}},N}) where {N}Internal API
Constructs a vector of cuNumeric.Slice objects from a variable number of (start, stop) tuples.
Each tuple corresponds to a dimension slice, using slice internally.
cuNumeric.to_cpp_index Method
to_cpp_index(d::Int64, ::Type{T}=UInt64)Internal API
Converts a single Julia 1-based index d to a zero-based C++ style index wrapped in StdVector.
cuNumeric.to_cpp_index Method
to_cpp_index(idx::Dims{N}, ::Type{T}=UInt64) where {N}Internal API
Converts a Julia 1-based index tuple idx to a zero-based C++ style index wrapped in StdVector of the specified integer type.
Each element of idx is decremented by 1 to adjust from Julia’s 1-based indexing to C++ 0-based indexing.