]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
ci: Initial SYCL setup (#1157)
authorAkarshan Biswas <redacted>
Tue, 25 Mar 2025 09:38:14 +0000 (15:08 +0530)
committerGitHub <redacted>
Tue, 25 Mar 2025 09:38:14 +0000 (11:38 +0200)
ci/run.sh

index 49f95fb8b5a9e79e45e2f3d2b66f2a1bacdacd34..237f803958afa9d85af875a740e0472cfa05ae88 100644 (file)
--- a/ci/run.sh
+++ b/ci/run.sh
@@ -10,6 +10,9 @@
 # # with CUDA support
 # GG_BUILD_CUDA=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
 #
+# # With SYCL support
+# GG_BUILD_SYCL=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
+#
 
 if [ -z "$2" ]; then
     echo "usage: $0 <output-dir> <mnt-dir>"
@@ -43,6 +46,17 @@ if [ ! -z ${GG_BUILD_METAL} ]; then
     CMAKE_EXTRA="${CMAKE_EXTRA} -DGGML_METAL=ON -DGGML_METAL_EMBED_LIBRARY=ON"
 fi
 
+if [ ! -z ${GG_BUILD_SYCL} ]; then
+    if [ -z ${ONEAPI_ROOT} ]; then
+        echo "Not detected ONEAPI_ROOT, please install oneAPI base toolkit and enable it by:"
+        echo "source /opt/intel/oneapi/setvars.sh"
+        exit 1
+    fi
+    export ONEAPI_DEVICE_SELECTOR="level_zero:0"
+    export ZES_ENABLE_SYSMAN=1
+    CMAKE_EXTRA="${CMAKE_EXTRA} -DGGML_SYCL=1 -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DGGML_SYCL_F16=ON"
+fi
+
 ## helpers
 
 # download a file if it does not exist or if it is outdated
@@ -312,8 +326,9 @@ fi
 
 
 ret=0
-
-test $ret -eq 0 && gg_run ctest_debug
+if [ -z ${GG_BUILD_SYCL}]; then
+    test $ret -eq 0 && gg_run ctest_debug
+fi
 test $ret -eq 0 && gg_run ctest_release
 
 if [ ! -z ${GG_BUILD_METAL} ]; then