From b0cfde9dcaadb4e1de6822cb128cf191aa3ddaf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Bon=C3=A9?= Date: Mon, 15 Dec 2025 11:57:09 +0100 Subject: [PATCH] Add test for sycl-ls with PoCL and Intel OCL --- overlay.nix | 2 ++ test/compilers/sycl-ls.nix | 40 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 test/compilers/sycl-ls.nix diff --git a/overlay.nix b/overlay.nix index 86515083..ab3d8364 100644 --- a/overlay.nix +++ b/overlay.nix @@ -125,6 +125,8 @@ let pocl = callPackage ./test/compilers/pocl.nix { }; ocl-run-pocl = ocl-build.test-icd; ocl-run-pocl-noicd = ocl-build-noicd.test-noicd; + + sycl-ls = callPackage ./test/compilers/sycl-ls.nix { }; }; # For now, only build toplevel packages in CI/Hydra diff --git a/test/compilers/sycl-ls.nix b/test/compilers/sycl-ls.nix new file mode 100644 index 00000000..3e8d0e05 --- /dev/null +++ b/test/compilers/sycl-ls.nix @@ -0,0 +1,40 @@ +{ + intelPackages, + pocl, + runCommandWith, + symlinkJoin, + clinfo, +}: + +runCommandWith + { + name = "sycl-ls"; + inherit (intelPackages) stdenv; + runLocal = true; + derivationArgs = { + nativeBuildInputs = [ clinfo ]; + env = { + OCL_ICD_VENDORS = symlinkJoin { + name = "vendors"; + paths = builtins.map (p: p + "/etc/OpenCL/vendors") [ + intelPackages.compiler + pocl + ]; + }; + + POCL_DRIVER_VERSION_OVERRIDE = "2025.20.6.0.04_224945"; + POCL_CPU_VENDOR_ID_OVERRIDE = 32902; + POCL_DEBUG = "error,warn"; + POCL_CACHE_DIR = "/build/pocl_cache"; + + HWLOC_SYNTHETIC = "node:1 core:1 pu:1"; + }; + }; + } + # bash + '' + clinfo -l | tee -a $out + sycl-ls | tee -a $out + + test x6 = x"$(cat $out | wc -l)" # 2 lines per clinfo entry and 1 per sycl-ls + ''