Skip to content

Commit

Permalink
config: add benchmark-extra-tag
Browse files Browse the repository at this point in the history
  • Loading branch information
xieby1 committed Dec 13, 2024
1 parent 14341b0 commit 135e4aa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
16 changes: 10 additions & 6 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
, enableVector ? false

# SPEC CPU 2006 Configuration ###################################
, spec2006-extra-tag ? ""
, spec2006-src ? throw "Please specify <spec2006-src> the path of spec2006, for example: /path/of/spec2006.tar.gz"
, spec2006-size ? "ref"
, spec2006-optimize ? "-O3 -flto"
Expand All @@ -31,6 +32,7 @@
, spec2006-testcase-filter ? testcase: true

# OpenBLAS Configuration ########################################
, openblas-extra-tag ? ""
, openblas-target ? if enableVector then "RISCV64_ZVL128B" else "RISCV64_GENERIC"

#######################################################################################
Expand Down Expand Up @@ -91,7 +93,7 @@ let
attrDrvNames = set: builtins.attrNames (filterDrvs (builtins.head (builtins.attrValues set)));
in mapToAttrs (name/*represents the name in builders/default.nix, like img, cpt, ...*/: {
inherit name;
value = pkgs.linkFarm "${prefix}_${name}" (
value = pkgs.linkFarm (escapeName "${prefix}_${name}") (
pkgs.lib.mapAttrsToList (testCase: buildResult: {
name = testCase;
path = buildResult."${name}";
Expand All @@ -100,7 +102,7 @@ let

wrap-l1 = prefix: buildResult: builtins.mapAttrs (name: value:
if pkgs.lib.isDerivation value then
pkgs.symlinkJoin {name="${prefix}_${name}"; paths=[value];}
pkgs.symlinkJoin {name=escapeName "${prefix}_${name}"; paths=[value];}
else value
) buildResult;
in raw.overrideScope (r-self: r-super: {
Expand Down Expand Up @@ -137,15 +139,16 @@ in raw.overrideScope (r-self: r-super: {
})) (pkgs.lib.filterAttrs
(testcase: v: spec2006-testcase-filter testcase)
r-super.spec2006);
in overrided // (wrap-l2 (escapeName (builtins.concatStringsSep "_" [
in overrided // (wrap-l2 (builtins.concatStringsSep "_" [
"spec2006"
spec2006-size
(pkgs.lib.removePrefix "${r-self.riscv64-scope.riscv64-stdenv.targetPlatform.config}-" r-self.riscv64-scope.riscv64-stdenv.cc.cc.name)
spec2006-optimize
spec2006-march
cpt-simulator
"1core"
])) overrided);
spec2006-extra-tag
]) overrided);

openblas = let
unwrapped = r-super.openblas.overrideScope ( self: super: {
Expand All @@ -154,11 +157,12 @@ in raw.overrideScope (r-self: r-super: {
TARGET = openblas-target;
};
});
in wrap-l1 (escapeName (builtins.concatStringsSep "_" [
in wrap-l1 (builtins.concatStringsSep "_" [
"openblas"
(pkgs.lib.removePrefix "${r-self.riscv64-scope.riscv64-stdenv.targetPlatform.config}-" r-self.riscv64-scope.riscv64-stdenv.cc.cc.name)
openblas-target
cpt-simulator
"1core"
])) unwrapped;
openblas-extra-tag
]) unwrapped;
})
4 changes: 3 additions & 1 deletion examples/full.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@

enableVector = true;

spec2006-extra-tag = "exclude_464_465";
spec2006-size = "test";
# "464_h264ref" and "465_tonto" will be excluded
spec2006-optimize = "-O3";
spec2006-march = "rv64gcbv";
# "464_h264ref" and "465_tonto" will be excluded
spec2006-testcase-filter = testcase: !(builtins.elem testcase [
"464_h264ref"
"465_tonto"
]);

openblas-extra-tag = "miao";
openblas-target = "RISCV64_ZVL256B";

cpt-maxK = "10";
Expand Down

0 comments on commit 135e4aa

Please sign in to comment.