JuliaGPU/GPUArrays.jl

JLArrays is missing `resize!` function

kmp5VT opened this issue · 2 comments

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

The function exists, we just forgot to tag JLArrays.