Add tests for PoCL with and without using icd

This commit is contained in:
2025-12-05 12:02:33 +01:00
parent 663e905444
commit 3a23299835
6 changed files with 249 additions and 22 deletions

View File

@@ -13,6 +13,7 @@
libxml2, # required for statically linked llvm
python3,
writableTmpDirAsHomeHook,
writeText,
fetchFromGitHub,
@@ -194,22 +195,20 @@ stdenv.mkDerivation (finalAttrs: {
runHook postInstallCheck
'';
setupHook = ./setup-hook.sh;
setupHook = lib.optionalDrvAttr enableICD (
writeText "setup-hook" ''
addToSearchPath OCL_ICD_VENDORS @out@/etc/OpenCL/vendors
''
);
passthru = {
updateScript = nix-update-script { };
git = finalAttrs.finalPackage.override { useGit = true; };
test = finalAttrs.finalPackage.overrideAttrs { doCheck = true; };
withICD = enableICD;
};
requiredSystemFeatures = lib.optionals (finalAttrs.finalPackage.doCheck && enableHWLOC) [
"sys-devices"
];
preCheck = ''
export POCL_DEBUG=error,warn
export NIX_DEBUG=1
'';
env.HWLOC_SYNTHETIC = lib.optionalDrvAttr enableHWLOC "node:1 core:1 pu:1";
propagatedBuildInputs = [ stdenv.cc.cc ];

View File

@@ -1,6 +0,0 @@
preCheckHooks+=('setupPoclCheck')
preInstallCheckHooks+=('setupPoclCheck')
setupPoclCheck () {
export OCL_ICD_VENDORS="@out@/etc/OpenCL/vendors"
}