Skip to content

Commit 6f54c25

Browse files
Various test improvements (#382)
1 parent 9278295 commit 6f54c25

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

test/array.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import Adapt
4949
end
5050
# TODO: Look into how to port the @sync
5151

52-
if cl.usm_supported(cl.device())
52+
if cl.memory_backend() isa cl.USMBackend
5353
@testset "shared buffers & unsafe_wrap" begin
5454
a = CLVector{Int, cl.UnifiedSharedMemory}(undef, 2)
5555

@@ -82,8 +82,6 @@ import Adapt
8282
e = c .+ d
8383
@test OpenCL.memtype(e) == cl.UnifiedSharedMemory
8484
end
85-
else
86-
@warn "Skipping USM-specific tests as not supported on device $(cl.device())"
8785
end
8886

8987
@testset "resizing" begin

test/buffer.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
end
7575
end
7676

77-
77+
if cl.memory_backend() isa cl.SVMBackend
7878
@testset "SVM Buffer" begin
7979
# simple buffer
8080
let buf = cl.svm_alloc(sizeof(Int))
@@ -124,3 +124,4 @@ end
124124
@test dst == [42,42,42]
125125
end
126126
end
127+
end

test/event.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if contains(cl.platform().vendor, "Intel") || contains(cl.platform().vendor, "pocl")
1+
if contains(cl.platform().vendor, "Intel") || contains(cl.platform().vendor, "pocl") || contains(cl.platform().name, "rusticl")
22
# unsupported by POCL
33
# hangs on Intel
44
@warn "Skipping event tests on $(cl.platform().name)"

test/intrinsics.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_work_item)
1818
@on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_work_group)
1919
@on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_device)
20-
@on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_all_svm_devices)
20+
cl.memory_backend() isa cl.SVMBackend && @on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_all_svm_devices)
2121
@on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_sub_group)
2222

2323
end
@@ -43,11 +43,10 @@ end
4343
@on_device atomic_work_item_fence(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_order_relaxed, OpenCL.memory_scope_work_item)
4444
@on_device atomic_work_item_fence(OpenCL.GLOBAL_MEM_FENCE, OpenCL.memory_order_acquire, OpenCL.memory_scope_work_group)
4545
@on_device atomic_work_item_fence(OpenCL.IMAGE_MEM_FENCE, OpenCL.memory_order_release, OpenCL.memory_scope_device)
46-
@on_device atomic_work_item_fence(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_order_acq_rel, OpenCL.memory_scope_all_svm_devices)
46+
cl.memory_backend() isa cl.SVMBackend && @on_device atomic_work_item_fence(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_order_acq_rel, OpenCL.memory_scope_all_svm_devices)
4747
@on_device atomic_work_item_fence(OpenCL.GLOBAL_MEM_FENCE, OpenCL.memory_order_seq_cst, OpenCL.memory_scope_sub_group)
4848
@on_device atomic_work_item_fence(OpenCL.IMAGE_MEM_FENCE | OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_order_acquire, OpenCL.memory_scope_sub_group)
4949

5050
end
5151

5252
end
53-

0 commit comments

Comments
 (0)