Skip to content

Commit df89e61

Browse files
vchuravymaleadt
andauthored
Add PoCL upstream to CI (#298)
Co-authored-by: Tim Besard <[email protected]>
1 parent 66f408c commit df89e61

File tree

1 file changed

+96
-6
lines changed

1 file changed

+96
-6
lines changed

.github/workflows/Test.yml

+96-6
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,109 @@ concurrency:
1313

1414
jobs:
1515
test:
16-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
16+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - PoCL ${{ matrix.pocl }}
1717
runs-on: ${{ matrix.os }}
1818
strategy:
1919
fail-fast: false
2020
matrix:
2121
version: ['1.10', '1.11']
2222
os: ['ubuntu-latest', 'macOS-latest']
2323
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
2434
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
2740
with:
2841
version: ${{ matrix.version }}
2942
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: |
32119
julia --project -e '
33120
using Pkg
34121
@@ -37,9 +124,12 @@ jobs:
37124
catch
38125
Pkg.develop(path="lib/intrinsics")
39126
end'
40-
- uses: julia-actions/julia-runtest@v1
127+
128+
- name: Test OpenCL.jl
129+
uses: julia-actions/julia-runtest@v1
41130
with:
42131
test_args: '--platform=pocl'
132+
43133
- uses: julia-actions/julia-processcoverage@v1
44134
- uses: codecov/codecov-action@v5
45135
with:

0 commit comments

Comments
 (0)