2022-11-03 11:20:02 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2022-11-22 14:13:49 +00:00
|
|
|
, writeScript
|
2022-11-03 11:20:02 +00:00
|
|
|
, cmake
|
2022-12-04 00:26:46 +00:00
|
|
|
, clang
|
|
|
|
, git
|
|
|
|
, libxml2
|
|
|
|
, libedit
|
2022-11-03 11:20:02 +00:00
|
|
|
, python3
|
|
|
|
}:
|
|
|
|
|
2022-11-24 02:17:04 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-11-03 11:20:02 +00:00
|
|
|
pname = "rocmlir";
|
2022-12-04 00:26:46 +00:00
|
|
|
version = "5.4.0";
|
2022-11-03 11:20:02 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ROCmSoftwarePlatform";
|
|
|
|
repo = "rocMLIR";
|
2022-11-28 11:53:23 +00:00
|
|
|
rev = "rocm-${finalAttrs.version}";
|
2022-12-04 00:26:46 +00:00
|
|
|
hash = "sha256-MokE7Ej8mLHTQeLYvKr7PPlsNG6ul91fqfXDlGu5JpI=";
|
2022-11-03 11:20:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2022-12-04 00:26:46 +00:00
|
|
|
clang
|
2022-11-03 11:20:02 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2022-12-04 00:26:46 +00:00
|
|
|
git
|
|
|
|
libxml2
|
|
|
|
libedit
|
2022-11-03 11:20:02 +00:00
|
|
|
python3
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2022-12-04 00:26:46 +00:00
|
|
|
"-DCMAKE_C_COMPILER=clang"
|
|
|
|
"-DCMAKE_CXX_COMPILER=clang++"
|
|
|
|
"-DBUILD_FAT_LIBROCKCOMPILER=ON"
|
2022-11-03 11:20:02 +00:00
|
|
|
];
|
|
|
|
|
2022-11-22 14:13:49 +00:00
|
|
|
passthru.updateScript = writeScript "update.sh" ''
|
|
|
|
#!/usr/bin/env nix-shell
|
|
|
|
#!nix-shell -i bash -p curl jq common-updater-scripts
|
2022-11-28 11:53:23 +00:00
|
|
|
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
|
|
|
|
-sL "https://api.github.com/repos/ROCmSoftwarePlatform/rocMLIR/tags?per_page=2" | jq '.[1].name | split("-") | .[1]' --raw-output)"
|
|
|
|
update-source-version rocmlir "$version" --ignore-same-hash
|
2022-11-22 14:13:49 +00:00
|
|
|
'';
|
|
|
|
|
2022-11-03 11:20:02 +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-24 01:24:39 +00:00
|
|
|
maintainers = teams.rocm.members;
|
2022-12-04 00:26:46 +00:00
|
|
|
broken = finalAttrs.version != clang.version;
|
2022-11-03 11:20:02 +00:00
|
|
|
};
|
2022-11-24 02:17:04 +00:00
|
|
|
})
|