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

JLArrays is missing resize! function #541

Closed
kmp5VT opened this issue Jun 21, 2024 · 2 comments
Closed

JLArrays is missing resize! function #541

kmp5VT opened this issue Jun 21, 2024 · 2 comments

Comments

@kmp5VT
Copy link

kmp5VT commented Jun 21, 2024

Hello,

I am trying to use JLArrays for testing GPUArrays on CPU but am running into an issue when using the append! function. It looks like there is no defined resize! function for this struct

julia> a = JLArray{Float32}(undef, 0)
0-element JLArray{Float32, 1}

julia> append!(a, Vector{Float32}(undef, 4))
ERROR: MethodError: no method matching resize!(::JLArray{Float32, 1}, ::Int64)

Closest candidates are:
  resize!(::BitVector, ::Integer)
   @ Base bitarray.jl:814
  resize!(::Vector, ::Integer)
   @ Base array.jl:1312
  resize!(::NDTensors.SmallVectors.MSmallVector, ::Integer)
   @ NDTensors ~/.julia/dev/ITensors/NDTensors/src/lib/SmallVectors/src/msmallvector/msmallvector.jl:69
  ...

Stacktrace:
 [1] append!(a::JLArray{Float32, 1}, items::Vector{Float32})
   @ GPUArrays ~/.julia/packages/GPUArrays/HjWFN/src/host/abstractarray.jl:326
 [2] top-level scope
   @ REPL[12]:1
@maleadt
Copy link
Member

maleadt commented Jun 26, 2024

The function exists, we just forgot to tag JLArrays.

@maleadt
Copy link
Member

maleadt commented Jun 26, 2024

@maleadt maleadt closed this as completed Jun 26, 2024
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