2022-11-04 12:27:35 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2022-11-27 09:42:12 +00:00
|
|
|
, writeScript
|
2022-11-04 12:27:35 +00:00
|
|
|
, cmake
|
|
|
|
, hip
|
|
|
|
, python3
|
|
|
|
}:
|
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-11-04 12:27:35 +00:00
|
|
|
pname = "rocmlir";
|
2022-11-27 09:42:12 +00:00
|
|
|
rocmVersion = "5.3.3";
|
|
|
|
version = finalAttrs.rocmVersion;
|
2022-11-04 12:27:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ROCmSoftwarePlatform";
|
|
|
|
repo = "rocMLIR";
|
2022-11-27 09:42:12 +00:00
|
|
|
rev = "rocm-${finalAttrs.rocmVersion}";
|
2022-11-04 12:27:35 +00:00
|
|
|
hash = "sha256-s/5gAH5vh2tgATZemPP66juQFDg8BR2sipzX2Q6pOOQ=";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
hip
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
python3
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_FAT_LIBMLIRMIOPEN=ON"
|
|
|
|
];
|
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
passthru.updateScript = writeScript "update.sh" ''
|
|
|
|
#!/usr/bin/env nix-shell
|
|
|
|
#!nix-shell -i bash -p curl jq common-updater-scripts
|
|
|
|
rocmVersion="$(curl -sL "https://api.github.com/repos/ROCmSoftwarePlatform/rocMLIR/tags?per_page=2" | jq '.[1].name | split("-") | .[1]' --raw-output)"
|
|
|
|
update-source-version rocmlir "$rocmVersion" --ignore-same-hash --version-key=rocmVersion
|
|
|
|
'';
|
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "MLIR-based convolution and GEMM kernel generator";
|
|
|
|
homepage = "https://github.com/ROCmSoftwarePlatform/rocMLIR";
|
|
|
|
license = with licenses; [ asl20 ];
|
2022-11-27 09:42:12 +00:00
|
|
|
maintainers = teams.rocm.members;
|
|
|
|
broken = finalAttrs.rocmVersion != hip.version;
|
2022-11-04 12:27:35 +00:00
|
|
|
};
|
2022-11-27 09:42:12 +00:00
|
|
|
})
|