Skip to content

Commit

Permalink
Adapt to GPUArrays.jl changes. (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt authored Jan 16, 2025
1 parent 74fb416 commit 517c254
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ oneAPI_Support_jll = "b049733a-a71d-5ed3-8eba-7d323ac00b36"
Adapt = "4"
CEnum = "0.4, 0.5"
ExprTools = "0.1"
GPUArrays = "11.1"
GPUArrays = "11.2.1"
GPUCompiler = "0.23, 0.24, 0.25, 0.26, 0.27, 1"
KernelAbstractions = "0.9.1"
LLVM = "6, 7, 8, 9"
Expand Down
12 changes: 8 additions & 4 deletions src/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,16 @@ mutable struct oneArray{T,N,B} <: AbstractGPUArray{T,N}

ctx = context()
dev = device()
buf = allocate(B, ctx, dev, bufsize, Base.datatype_alignment(T))
data = DataRef(buf) do buf
release(buf)
alignment = Base.datatype_alignment(T)
data = GPUArrays.cached_alloc((oneArray, B, ctx, dev, bufsize, alignment)) do
buf = allocate(B, ctx, dev, bufsize, alignment)
data = DataRef(buf) do buf
release(buf)
end
end
obj = new{T,N,B}(data, maxsize, 0, dims)
finalizer(unsafe_free!, obj)
return finalizer(unsafe_free!, obj)
return arr
end

function oneArray{T,N}(data::DataRef{B}, dims::Dims{N};
Expand Down

0 comments on commit 517c254

Please sign in to comment.