Skip to content

Commit c417dbd

Browse files
authored
Merge pull request #275 from JuliaGPU/tb/ci
Fix CI.
2 parents e8169ee + b2cac9b commit c417dbd

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

.github/workflows/Test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
end'
4040
- uses: julia-actions/julia-runtest@v1
4141
with:
42-
test_args: '--platform pocl'
42+
test_args: '--platform=pocl'
4343
- uses: julia-actions/julia-processcoverage@v1
4444
- uses: codecov/codecov-action@v5
4545
with:

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "OpenCL"
22
uuid = "08131aa3-fb12-5dee-8b74-c09406e224a2"
3-
version = "0.10.0"
3+
version = "0.10.1"
44

55
[deps]
66
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
@@ -19,7 +19,7 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1919

2020
[compat]
2121
Adapt = "4"
22-
GPUArrays = "11.1"
22+
GPUArrays = "11.2.1"
2323
GPUCompiler = "0.27, 1"
2424
KernelAbstractions = "0.9.1"
2525
LLVM = "9.1"

src/array.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,19 @@ mutable struct CLArray{T, N} <: AbstractGPUArray{T, N}
1212

1313
# allocating constructor
1414
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)
15+
bufsize = prod(dims) * sizeof(T)
16+
data = GPUArrays.cached_alloc((CLArray, cl.context(), bufsize, access)) do
17+
buf = cl.SVMBuffer{UInt8}(bufsize, access)
18+
DataRef(identity, buf)
19+
end
20+
obj = new{T,N}(cl.context(), data, 0, dims)
21+
return obj
1822
end
1923

2024
# low-level constructor for wrapping existing data
2125
function CLArray{T,N}(ref::DataRef{cl.SVMBuffer{UInt8}}, dims::Dims;
2226
offset::Int=0) where {T,N}
23-
new(cl.context(), ref, offset, dims)
27+
new{T,N}(cl.context(), ref, offset, dims)
2428
end
2529
end
2630

0 commit comments

Comments
 (0)