diff --git a/pkgs/by-name/op/opencl-cts/package.nix b/pkgs/by-name/op/opencl-cts/package.nix index e49e10599024..f60f6f2f683e 100644 --- a/pkgs/by-name/op/opencl-cts/package.nix +++ b/pkgs/by-name/op/opencl-cts/package.nix @@ -48,6 +48,11 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeFeature "OPENCL_LIBRARIES" "OpenCL") ]; + # Upstream installs to bin/$ (e.g. bin/Release/); flatten it. + postInstall = '' + mv "$out/bin/''${cmakeBuildType:-Release}"/* "$out"/bin/ + ''; + meta = { description = "OpenCL Conformance Test Suite"; homepage = "https://github.com/KhronosGroup/OpenCL-CTS"; diff --git a/pkgs/development/rocm-modules/clr/default.nix b/pkgs/development/rocm-modules/clr/default.nix index 8b76a12d9351..8592f361199b 100644 --- a/pkgs/development/rocm-modules/clr/default.nix +++ b/pkgs/development/rocm-modules/clr/default.nix @@ -263,11 +263,15 @@ stdenv.mkDerivation (finalAttrs: { }; impureTests = { + # bash $(nix-build -A rocmPackages.clr.impureTests.rocm-smi) rocm-smi = callPackage ./test-rocm-smi.nix { inherit rocm-smi; clr = finalAttrs.finalPackage; }; - # TODO(@LunNova): add OpenCL test with opencl-cts + # Simple subset of opencl-cts test_basic + opencl-cts = callPackage ./test-opencl-cts.nix { + clr = finalAttrs.finalPackage; + }; generic-arch = callPackage ./test-isa-compat.nix { clr = finalAttrs.finalPackage; name = "generic-arch"; diff --git a/pkgs/development/rocm-modules/clr/test-opencl-cts.nix b/pkgs/development/rocm-modules/clr/test-opencl-cts.nix new file mode 100644 index 000000000000..77929531f900 --- /dev/null +++ b/pkgs/development/rocm-modules/clr/test-opencl-cts.nix @@ -0,0 +1,28 @@ +{ + lib, + makeImpureTest, + opencl-cts, + clr, +}: + +makeImpureTest { + name = "opencl-cts"; + testedPackage = "rocmPackages.clr"; + + sandboxPaths = [ + "/sys" + "/dev/dri" + "/dev/kfd" + ]; + + nativeBuildInputs = [ opencl-cts ]; + OCL_ICD_VENDORS = "${clr.icd}/etc/OpenCL/vendors"; + + testScript = '' + test_basic arraycopy arrayreadwrite astype barrier vector_swizzle work_item_functions + ''; + + meta = { + teams = [ lib.teams.rocm ]; + }; +}