{ lib, stdenv, fetchFromGitHub, cmake, python3, cudatoolkit, libbacktrace, intel-compute-runtime, level-zero, unified-memory-framework, autoAddDriverRunpath, enableL0 ? false, }: stdenv.mkDerivation rec { pname = "unified-runtime"; version = "2025-WW45"; src = fetchFromGitHub { owner = "intel"; repo = "llvm"; tag = version; sha256 = "sha256-yf8pFEeNEWf9LpEhAy4vMdFDlA08x5XaCegnq+5aXRw="; }; sourceRoot = "${src.name}/unified-runtime"; nativeBuildInputs = [ cmake python3 libbacktrace (python3.withPackages ( python-pkgs: with python-pkgs; [ lit filecheck ] )) autoAddDriverRunpath ]; buildInputs = [ unified-memory-framework cudatoolkit ] ++ lib.optionals enableL0 [ intel-compute-runtime level-zero ]; cmakeFlags = [ (lib.cmakeBool "UR_USE_EXTERNAL_UMF" true) (lib.cmakeBool "UR_BUILD_TESTS" false) (lib.cmakeBool "UR_BUILD_ADAPTER_CUDA" true) (lib.cmakeBool "UR_BUILD_ADAPTER_L0" enableL0) (lib.cmakeBool "UR_BUILD_ADAPTER_OPENCL" false) (lib.cmakeBool "UR_BUILD_ADAPTER_HIP" false) (lib.cmakeBool "UR_BUILD_ADAPTER_NATIVE_CPU" false) ]; }