@@ -13,22 +13,109 @@ concurrency:
13
13
14
14
jobs :
15
15
test :
16
- name : Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
16
+ name : Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - PoCL ${{ matrix.pocl }}
17
17
runs-on : ${{ matrix.os }}
18
18
strategy :
19
19
fail-fast : false
20
20
matrix :
21
21
version : ['1.10', '1.11']
22
22
os : ['ubuntu-latest', 'macOS-latest']
23
23
arch : [x64]
24
+ pocl : [jll]
25
+ include :
26
+ - version : ' 1.10'
27
+ os : ubuntu-latest
28
+ arch : x64
29
+ pocl : local
30
+ - version : ' 1.11'
31
+ os : ubuntu-latest
32
+ arch : x64
33
+ pocl : local
24
34
steps :
25
- - uses : actions/checkout@v4
26
- - uses : julia-actions/setup-julia@v2
35
+ - name : Checkout OpenCL.jl
36
+ uses : actions/checkout@v4
37
+
38
+ - name : Setup Julia
39
+ uses : julia-actions/setup-julia@v2
27
40
with :
28
41
version : ${{ matrix.version }}
29
42
arch : ${{ matrix.arch }}
30
- - uses : julia-actions/cache@v2
31
- - run : |
43
+
44
+ - name : Setup Julia cache
45
+ uses : julia-actions/cache@v2
46
+
47
+ - name : Checkout PoCL
48
+ if : ${{ matrix.pocl == 'local' }}
49
+ uses : actions/checkout@v4
50
+ with :
51
+ repository : pocl/pocl
52
+ path : pocl
53
+
54
+ - name : Install system dependencies
55
+ if : ${{ matrix.pocl == 'local' }}
56
+ run : |
57
+ sudo apt-get update
58
+ sudo apt-get install -y build-essential cmake ninja-build pkg-config
59
+
60
+ - name : Install Julia dependencies
61
+ if : ${{ matrix.pocl == 'local' }}
62
+ run : |
63
+ touch pocl/Project.toml
64
+ julia --project=pocl --color=yes -e '
65
+ using Pkg
66
+
67
+ # unversioned
68
+ Pkg.add([
69
+ "SPIRV_Tools_jll",
70
+ "OpenCL_jll",
71
+ "OpenCL_Headers_jll",
72
+ "Hwloc_jll",
73
+ "CMake_jll",
74
+ ])
75
+
76
+ # versioned
77
+ Pkg.add(name="LLVM_full_jll", version="19")
78
+ Pkg.add(name="SPIRV_LLVM_Translator_jll", version="19")'
79
+
80
+ - name : Build PoCL
81
+ if : ${{ matrix.pocl == 'local' }}
82
+ run : |
83
+ julia --project=pocl --color=yes -e '
84
+ using LLVM_full_jll,
85
+ SPIRV_Tools_jll, SPIRV_LLVM_Translator_jll,
86
+ OpenCL_jll, OpenCL_Headers_jll,
87
+ Hwloc_jll, CMake_jll
88
+
89
+ sourcedir = joinpath(@__DIR__, "pocl")
90
+ builddir = joinpath(@__DIR__, "build")
91
+ destdir = joinpath(@__DIR__, "target")
92
+
93
+ prefix = []
94
+ for jll in [SPIRV_Tools_jll, SPIRV_LLVM_Translator_jll, OpenCL_jll,
95
+ OpenCL_Headers_jll, Hwloc_jll]
96
+ push!(prefix, jll.artifact_dir)
97
+ end
98
+
99
+ withenv("LD_LIBRARY_PATH" => joinpath(Sys.BINDIR, Base.PRIVATE_LIBDIR)) do
100
+ mkpath(builddir)
101
+ run(```cmake -B $builddir -S $sourcedir
102
+ -GNinja
103
+ -DCMAKE_BUILD_TYPE=Debug
104
+ -DENABLE_TESTS:Bool=OFF
105
+ -DSTATIC_LLVM:Bool=On
106
+ -DCMAKE_INSTALL_PREFIX=$destdir
107
+ -DWITH_LLVM_CONFIG=$(LLVM_full_jll.artifact_dir)/tools/llvm-config
108
+ -DCMAKE_PREFIX_PATH="$(join(prefix, ";"))"
109
+ -DKERNELLIB_HOST_CPU_VARIANTS=distro```)
110
+
111
+ run(```$(cmake()) --build $builddir --parallel $(Sys.CPU_THREADS) --target install```)
112
+ end'
113
+
114
+ echo '[pocl_jll]' > test/LocalPreferences.toml
115
+ echo 'libpocl_path="${{ github.workspace }}/target/lib/libpocl.so"' >> test/LocalPreferences.toml
116
+
117
+ - name : Setup OpenCL.jl
118
+ run : |
32
119
julia --project -e '
33
120
using Pkg
34
121
@@ -37,9 +124,12 @@ jobs:
37
124
catch
38
125
Pkg.develop(path="lib/intrinsics")
39
126
end'
40
- - uses : julia-actions/julia-runtest@v1
127
+
128
+ - name : Test OpenCL.jl
129
+ uses : julia-actions/julia-runtest@v1
41
130
with :
42
131
test_args : ' --platform=pocl'
132
+
43
133
- uses : julia-actions/julia-processcoverage@v1
44
134
- uses : codecov/codecov-action@v5
45
135
with :
0 commit comments