Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,40 @@ steps:
env:
OCL_ICD_FILENAMES: "libnvidia-opencl.so.1"
timeout_in_minutes: 60

- group: "macos"
key: "julia"
steps:
- label: "{{matrix.julia}} macos {{matrix.arch}}"
plugins:
- JuliaCI/julia#v1:
version: "{{matrix.julia}}"
- JuliaCI/julia-coverage#v1:
codecov: true
commands: |
julia --project -e '
using Pkg

println("--- :julia: Instantiating project")
Pkg.add("pocl_jll")
Pkg.add("InteractiveUtils")
Pkg.develop(path="lib/intrinsics")

println("+++ :julia: Running tests")
using InteractiveUtils
InteractiveUtils.versioninfo()
Pkg.test(; coverage=true, test_args=`--platform=pocl --verbose --jobs=2`)'
agents:
queue: "juliaecosystem"
os: "macos"
arch: "{{matrix.arch}}"
if: build.message !~ /\[skip tests\]/
timeout_in_minutes: 120
matrix:
setup:
julia:
- "1.10"
- "1.12"
arch:
- "x86_64"
- "aarch64"
12 changes: 7 additions & 5 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ jobs:
fail-fast: false
matrix:
version: ['1.10', '1.12']
os: [ubuntu-24.04, ubuntu-24.04-arm, macOS-15, macOS-15-intel, windows-2025]
os: [ubuntu-24.04-arm, macOS-15, macOS-15-intel, windows-2022]
arch: [x64, arm64]
pocl: [jll, local]
pocl: [jll]
memory_backend: [usm, svm, buffer]
exclude:
# unsupported combinations
- os: ubuntu-24.04
arch: arm64
- os: windows-2025
- os: windows-2022
arch: arm64
- os: ubuntu-24.04-arm
arch: x64
Expand All @@ -45,7 +45,7 @@ jobs:
pocl: local
- os: macOS-15
pocl: local
- os: windows-2025
- os: windows-2022
pocl: local
# Remove these exclusions once macOS CI hangs are fixed
- os: macOS-15-intel
Expand Down Expand Up @@ -150,7 +150,9 @@ jobs:
uses: julia-actions/julia-runtest@v1
if: runner.os != 'Windows'
with:
test_args: '--quickfail --platform=pocl'
test_args: '--quickfail --platform=pocl --verbose --jobs=2'
env:
POCL_WORK_GROUP_METHOD: cbs

- name: Setup BusyBox
if: runner.os == 'Windows'
Expand Down
40 changes: 25 additions & 15 deletions test/intrinsics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,28 @@ const ispocl = cl.platform().name == "Portable Computing Language"
@testset "intrinsics" begin

@testset "barrier" begin
@time "Barrier Local Mem fence" @on_device barrier(OpenCL.LOCAL_MEM_FENCE)
@time "Barrier global Mem fence" @on_device barrier(OpenCL.GLOBAL_MEM_FENCE)
@time "Barrier both Mem fence" @on_device barrier(OpenCL.LOCAL_MEM_FENCE | OpenCL.GLOBAL_MEM_FENCE)

@on_device barrier(OpenCL.LOCAL_MEM_FENCE)
@on_device barrier(OpenCL.GLOBAL_MEM_FENCE)
@on_device barrier(OpenCL.LOCAL_MEM_FENCE | OpenCL.GLOBAL_MEM_FENCE)
@time "WorkGroup Barrier Local Mem fence" @on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE)
@time "WorkGroup Barrier global Mem fence" @on_device work_group_barrier(OpenCL.GLOBAL_MEM_FENCE)
@time "WorkGroup Barrier image Mem fence" @on_device work_group_barrier(OpenCL.IMAGE_MEM_FENCE)

@on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE)
@on_device work_group_barrier(OpenCL.GLOBAL_MEM_FENCE)
@on_device work_group_barrier(OpenCL.IMAGE_MEM_FENCE)
@time "WorkGroup Barrier L/G Mem fence" @on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE | OpenCL.GLOBAL_MEM_FENCE)
@time "WorkGroup Barrier L/I Mem fence" @on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE | OpenCL.IMAGE_MEM_FENCE)
@time "WorkGroup Barrier L/G/I Mem fence" @on_device work_group_barrier(OpenCL.GLOBAL_MEM_FENCE | OpenCL.LOCAL_MEM_FENCE | OpenCL.IMAGE_MEM_FENCE)

@on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE | OpenCL.GLOBAL_MEM_FENCE)
@on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE | OpenCL.IMAGE_MEM_FENCE)
@on_device work_group_barrier(OpenCL.GLOBAL_MEM_FENCE | OpenCL.LOCAL_MEM_FENCE | OpenCL.IMAGE_MEM_FENCE)

@on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_work_item)
@on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_work_group)
@on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_device)
cl.memory_backend() isa cl.SVMBackend && @on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_all_svm_devices)
@on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_sub_group)
@time "WorkGroup Barrier Local Mem fence, work item scope" @on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_work_item)
@time "WorkGroup Barrier Local Mem fence, workgroup scope" @on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_work_group)
@time "WorkGroup Barrier Local Mem fence, device scope" @on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_device)
@time "Skipped" cl.memory_backend() isa cl.SVMBackend && @on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_all_svm_devices)
@time "WorkGroup Barrier Local Mem fence, subgroup scope" @on_device work_group_barrier(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_scope_sub_group)

end

@testset "mem_fence" begin
@warn "mem_fence"

@on_device mem_fence(OpenCL.LOCAL_MEM_FENCE)
@on_device mem_fence(OpenCL.GLOBAL_MEM_FENCE)
Expand All @@ -53,6 +53,7 @@ end
end

@testset "atomic_work_item_fence" begin
@warn "atomic_work_item_fence"

@on_device atomic_work_item_fence(OpenCL.LOCAL_MEM_FENCE, OpenCL.memory_order_relaxed, OpenCL.memory_scope_work_item)
@on_device atomic_work_item_fence(OpenCL.GLOBAL_MEM_FENCE, OpenCL.memory_order_acquire, OpenCL.memory_scope_work_group)
Expand All @@ -64,6 +65,7 @@ cl.memory_backend() isa cl.SVMBackend && @on_device atomic_work_item_fence(OpenC
end

@testset "math" begin
@warn "math"

@testset "unary - $T" for T in float_types
@testset "$f" for f in [
Expand Down Expand Up @@ -101,6 +103,7 @@ end
hypot,
(^),
]
@warn "binary - $T, $f"
x = rand(T)
y = rand(T)
broken = ispocl && T == Float16 && f == atan
Expand All @@ -112,6 +115,7 @@ end
@testset "$f" for f in [
fma,
]
@warn "ternary - $T, $f"
x = rand(T)
y = rand(T)
z = rand(T)
Expand All @@ -128,6 +132,8 @@ end
OpenCL.rint,
OpenCL.rsqrt,
]
@warn "OpenCL-specific unary - $T, $f"

x = rand(T)
broken = ispocl && T == Float16 && !(f in [OpenCL.rint, OpenCL.rsqrt])
@test call_on_device(f, x) isa Real broken = broken # Just check it doesn't error
Expand All @@ -146,6 +152,8 @@ end
OpenCL.nextafter,
OpenCL.powr,
]
@warn "OpenCL-specific binary - $T, $f"

x = rand(T)
y = rand(T)
broken = ispocl && T == Float16 && !(f in [OpenCL.maxmag, OpenCL.minmag])
Expand All @@ -159,6 +167,8 @@ end
x = rand(T)
y = rand(T)
z = rand(T)
@warn "OpenCL-specific ternary - $T"

@test call_on_device(OpenCL.mad, x, y, z) ≈ x * y + z
end

Expand Down
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ do_verbose, _ = extract_flag!(ARGS, "--verbose")
do_quickfail, _ = extract_flag!(ARGS, "--quickfail")

include("setup.jl") # make sure everything is precompiled

@info "System information:\n" * sprint(io->OpenCL.versioninfo(io))
Sys.isapple() && @info read(`launchctl limit maxfiles`, String)
Sys.isapple() && @info read(`ulimit -a`, String)
Sys.isapple() && @info read(`df -YIh`, String)
Sys.isapple() && @info read(`vm_stat`, String)

@info "Running $jobs tests in parallel. If this is too many, specify the `--jobs` argument to the tests, or set the JULIA_CPU_THREADS environment variable."

Expand Down
Loading