From 2e63c4a31f946a8bafa92c49c1a0a116c0eb6dae Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 9 Nov 2026 22:32:31 +0100 Subject: Fixing rocm up --- default.nix | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'default.nix') diff --git a/default.nix b/default.nix index cc36692..e577796 100644 --- a/default.nix +++ b/default.nix @@ -36,14 +36,22 @@ let ''; }; - adaptive-cpp = pkgs.callPackage .nix/adaptive-cpp.nix { + # One builder, two instances, so the ROCm and non-ROCm toolchains differ in + # exactly one input and nothing else. + mkAdaptiveCpp = enableRocm: pkgs.callPackage .nix/adaptive-cpp.nix { inherit stdenv llvmPackages lld; config = { - inherit rocm; + rocm = enableRocm; }; }; + adaptive-cpp-base = mkAdaptiveCpp false; + adaptive-cpp-rocm = mkAdaptiveCpp true; + + # What the examples and the default build use. Flip with --arg rocm true. + adaptive-cpp = if rocm then adaptive-cpp-rocm else adaptive-cpp-base; + forstio = let forstioSrc = stdenv.mkDerivation { name = "forstio-src"; @@ -77,8 +85,16 @@ in rec { core = pkgs.callPackage ./modules/core/.nix/derivation.nix { inherit forstio stdenv clang-tools pname version; }; + # Both toolchains, same sources, same everything else -- so a failure + # in one and not the other points at the backend rather than the code. sycl = pkgs.callPackage ./modules/sycl/.nix/derivation.nix { - inherit forstio stdenv clang-tools pname version kel adaptive-cpp; + inherit forstio stdenv clang-tools pname version kel; + adaptive-cpp = adaptive-cpp-base; + }; + sycl-rocm = pkgs.callPackage ./modules/sycl/.nix/derivation.nix { + inherit forstio stdenv clang-tools pname version kel; + adaptive-cpp = adaptive-cpp-rocm; + variant = "-rocm"; }; }; }; -- cgit v1.3.1