Unverified Commit c018d62c authored by Luna Nova's avatar Luna Nova Committed by GitHub
Browse files

rocmPackages.clr: add impureTest that runs openctl-cts test_basic (#498984)

parents bb9b4c7b 4f3546d6
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -48,6 +48,11 @@ stdenv.mkDerivation (finalAttrs: {
    (lib.cmakeFeature "OPENCL_LIBRARIES" "OpenCL")
  ];

  # Upstream installs to bin/$<CONFIG> (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";
+5 −1
Original line number Diff line number Diff line
@@ -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";
+28 −0
Original line number Diff line number Diff line
{
  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 ];
  };
}