We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e8169ee + b2cac9b commit c417dbdCopy full SHA for c417dbd
3 files changed
.github/workflows/Test.yml
@@ -39,7 +39,7 @@ jobs:
39
end'
40
- uses: julia-actions/julia-runtest@v1
41
with:
42
- test_args: '--platform pocl'
+ test_args: '--platform=pocl'
43
- uses: julia-actions/julia-processcoverage@v1
44
- uses: codecov/codecov-action@v5
45
Project.toml
@@ -1,6 +1,6 @@
1
name = "OpenCL"
2
uuid = "08131aa3-fb12-5dee-8b74-c09406e224a2"
3
-version = "0.10.0"
+version = "0.10.1"
4
5
[deps]
6
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
@@ -19,7 +19,7 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
19
20
[compat]
21
Adapt = "4"
22
-GPUArrays = "11.1"
+GPUArrays = "11.2.1"
23
GPUCompiler = "0.27, 1"
24
KernelAbstractions = "0.9.1"
25
LLVM = "9.1"
src/array.jl
@@ -12,15 +12,19 @@ mutable struct CLArray{T, N} <: AbstractGPUArray{T, N}
12
13
# allocating constructor
14
function CLArray{T,N}(::UndefInitializer, dims::Dims{N}; access=:rw) where {T,N}
15
- buf = cl.SVMBuffer{UInt8}(prod(dims) * sizeof(T), access)
16
- ref = DataRef(identity, buf)
17
- new(cl.context(), ref, 0, dims)
+ bufsize = prod(dims) * sizeof(T)
+ data = GPUArrays.cached_alloc((CLArray, cl.context(), bufsize, access)) do
+ buf = cl.SVMBuffer{UInt8}(bufsize, access)
18
+ DataRef(identity, buf)
+ end
+ obj = new{T,N}(cl.context(), data, 0, dims)
+ return obj
end
# low-level constructor for wrapping existing data
function CLArray{T,N}(ref::DataRef{cl.SVMBuffer{UInt8}}, dims::Dims;
26
offset::Int=0) where {T,N}
- new(cl.context(), ref, offset, dims)
27
+ new{T,N}(cl.context(), ref, offset, dims)
28
29
30
0 commit comments