We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fe0419a commit 8460cf8Copy full SHA for 8460cf8
Project.toml
@@ -59,7 +59,7 @@ Crayons = "4"
59
DataFrames = "1"
60
EnzymeCore = "0.8.2"
61
ExprTools = "0.1"
62
-GPUArrays = "11.2"
+GPUArrays = "11.2.1"
63
GPUCompiler = "0.24, 0.25, 0.26, 0.27, 1"
64
KernelAbstractions = "0.9.2"
65
LLVM = "9.1"
src/array.jl
@@ -72,19 +72,20 @@ mutable struct CuArray{T,N,M} <: AbstractGPUArray{T,N}
72
maxsize
73
end
74
75
- GPUArrays.cached_alloc((CuArray, CUDA.device(), T, bufsize, M)) do
76
- data = DataRef(pool_free, pool_alloc(M, bufsize))
77
- obj = new{T,N,M}(data, maxsize, 0, dims)
78
- finalizer(unsafe_free!, obj)
79
- return obj
80
- end::CuArray{T, N, M}
+ data = GPUArrays.cached_alloc((CuArray, device(), M, bufsize)) do
+ DataRef(pool_free, pool_alloc(M, bufsize))
+ end
+ obj = new{T,N,M}(data, maxsize, 0, dims)
+ finalizer(unsafe_free!, obj)
+ return obj
81
82
83
function CuArray{T,N}(data::DataRef{Managed{M}}, dims::Dims{N};
84
maxsize::Int=prod(dims) * sizeof(T), offset::Int=0) where {T,N,M}
85
check_eltype(T)
86
obj = new{T,N,M}(data, maxsize, offset, dims)
87
finalizer(unsafe_free!, obj)
88
89
90
91
src/memory.jl
@@ -516,6 +516,8 @@ mutable struct Managed{M}
516
517
518
519
+Base.sizeof(managed::Managed) = sizeof(managed.mem)
520
+
521
# wait for the current owner of memory to finish processing
522
function synchronize(managed::Managed)
523
synchronize(managed.stream)
0 commit comments