Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-dimensional arrays #16

Open
SamuelMarks opened this issue Jun 8, 2024 · 1 comment
Open

Multi-dimensional arrays #16

SamuelMarks opened this issue Jun 8, 2024 · 1 comment

Comments

@SamuelMarks
Copy link

SamuelMarks commented Jun 8, 2024

Multi-dimensional arrays (waiting on the Memory type PR)

Ref: https://tshort.github.io/WebAssemblyCompiler.jl/stable/

FYI: That PR has now been merged. Not sure what the current state of these arrays are now that that has been merged.

@dgleich
Copy link

dgleich commented Jun 11, 2024

Well, I tried WebAssemblyCompiler with Julia 1.11 to see if this magically worked. But it throws an error on this line as Base._unsafe_copyto!(...) isn't defined for Julia 1.11. Will see if I can debug when I get back.

# @overlay MT Base._unsafe_copyto!(dest::Array{U, 1}, doffs::Integer, src::Array{T, 1}, soffs::Integer, n::Integer) where {T,U} =
#     @ccall _jl_array_copyto(dest::Array{U,1}, (doffs-1)::Int32, src::Array{T,1}, (soffs-1)::Int32, n::Int32)::Array{T,1}
@overlay MT function Base._unsafe_copyto!(dest::Array, doffs::Integer, src::Array, soffs::Integer, n::Integer) 
    @inbounds for i in 1:n
        dest[i+doffs-1] = src[i+soffs-1]
    end
    return dest
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants