Add OpenCL and CLBlast support
This commit is contained in:
parent
f4cef87edf
commit
a48eebe621
1 changed files with 29 additions and 1 deletions
30
.github/workflows/build.yml
vendored
30
.github/workflows/build.yml
vendored
|
@ -158,12 +158,34 @@ jobs:
|
||||||
defines: '-DLLAMA_AVX2=OFF'
|
defines: '-DLLAMA_AVX2=OFF'
|
||||||
- build: 'avx512'
|
- build: 'avx512'
|
||||||
defines: '-DLLAMA_AVX512=ON -DBUILD_SHARED_LIBS=ON'
|
defines: '-DLLAMA_AVX512=ON -DBUILD_SHARED_LIBS=ON'
|
||||||
|
- build: 'opencl'
|
||||||
|
defines: '-DLLAMA_CLBLAST=ON -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/clblast"'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
id: checkout
|
id: checkout
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: Download OpenCL SDK
|
||||||
|
id: get_opencl
|
||||||
|
if: ${{ matrix.build == 'opencl' }}
|
||||||
|
run: |
|
||||||
|
curl.exe -o $env:RUNNER_TEMP/opencl.zip -L https://github.com/KhronosGroup/OpenCL-SDK/releases/download/v2023.04.17/OpenCL-SDK-v2023.04.17-Win-x64.zip
|
||||||
|
mkdir $env:RUNNER_TEMP/opencl
|
||||||
|
tar.exe -xvf $env:RUNNER_TEMP/opencl.zip --strip-components=1 -C $env:RUNNER_TEMP/opencl
|
||||||
|
|
||||||
|
- name: Download CLBlast
|
||||||
|
id: get_clblast
|
||||||
|
if: ${{ matrix.build == 'opencl' }}
|
||||||
|
run: |
|
||||||
|
curl.exe -o $env:RUNNER_TEMP/clblast.zip -L https://github.com/CNugteren/CLBlast/releases/download/1.5.3/CLBlast-1.5.3-Windows-x64.zip
|
||||||
|
mkdir $env:RUNNER_TEMP/clblast
|
||||||
|
tar.exe -xvf $env:RUNNER_TEMP/clblast.zip -C $env:RUNNER_TEMP/clblast
|
||||||
|
foreach ($f in (gci -Recurse -Path "$env:RUNNER_TEMP/clblast" -Filter '*.cmake')) {
|
||||||
|
$txt = Get-Content -Path $f -Raw
|
||||||
|
$txt.Replace('C:/dependencies/opencl/', "$($env:RUNNER_TEMP.Replace('\','/'))/opencl/") | Set-Content -Path $f -Encoding UTF8
|
||||||
|
}
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
id: cmake_build
|
id: cmake_build
|
||||||
run: |
|
run: |
|
||||||
|
@ -172,6 +194,12 @@ jobs:
|
||||||
cmake .. ${{ matrix.defines }}
|
cmake .. ${{ matrix.defines }}
|
||||||
cmake --build . --config Release
|
cmake --build . --config Release
|
||||||
|
|
||||||
|
- name: Add clblast.dll
|
||||||
|
id: add_clblast_dll
|
||||||
|
if: ${{ matrix.build == 'opencl' }}
|
||||||
|
run: |
|
||||||
|
cp $env:RUNNER_TEMP/clblast/lib/clblast.dll ./build/bin/Release
|
||||||
|
|
||||||
- name: Check AVX512F support
|
- name: Check AVX512F support
|
||||||
id: check_avx512f
|
id: check_avx512f
|
||||||
if: ${{ matrix.build == 'avx512' }}
|
if: ${{ matrix.build == 'avx512' }}
|
||||||
|
@ -187,7 +215,7 @@ jobs:
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
id: cmake_test
|
id: cmake_test
|
||||||
if: ${{ matrix.build != 'avx512' || env.HAS_AVX512F == '1' }} # Test AVX-512 only when possible
|
if: ${{ ( matrix.build != 'avx512' || env.HAS_AVX512F == '1' ) && matrix.build != 'opencl' }} # Test AVX-512 only when possible
|
||||||
run: |
|
run: |
|
||||||
cd build
|
cd build
|
||||||
ctest -C Release --verbose
|
ctest -C Release --verbose
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue