Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/ndarray/ndarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -763,3 +763,18 @@ end
function Base.isapprox(arr::NDArray{T}, arr2::NDArray{T}; atol=0, rtol=0) where {T}
return compare(arr, arr2, atol, rtol)
end

function h5write(path::String, dataset::String, arr::NDArray{T,N}) where {T,N}
st_handle = get_store(arr)
la = Legate.LogicalArray{T,N}(st_handle[], size(arr))
Legate.write_hdf5(la, path, dataset)
Comment thread
Nader-Rahhal marked this conversation as resolved.
end

function h5read(path::String, dataset::String)
la = Legate.read_hdf5(path, dataset)
Comment thread
Nader-Rahhal marked this conversation as resolved.
T = eltype(la)
N = Int(Legate.dim(la))
st = Legate.data(la.handle) # call data on the raw impl
ptr = nda_store_to_ndarray(st) # pass directly
return NDArray(ptr, T, Val(N), nothing)
end
Loading