hipblas: init at 5.4.1
This commit is contained in:
parent
af0f9dc066
commit
ea30b3f7c8
99
pkgs/development/libraries/hipblas/default.nix
Normal file
99
pkgs/development/libraries/hipblas/default.nix
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
{ lib
|
||||||
|
, stdenv
|
||||||
|
, fetchFromGitHub
|
||||||
|
, rocmUpdateScript
|
||||||
|
, cmake
|
||||||
|
, rocm-cmake
|
||||||
|
, hip
|
||||||
|
, gfortran
|
||||||
|
, rocblas
|
||||||
|
, rocsolver
|
||||||
|
, gtest
|
||||||
|
, lapack-reference
|
||||||
|
, buildTests ? false
|
||||||
|
, buildBenchmarks ? false
|
||||||
|
, buildSamples ? false
|
||||||
|
}:
|
||||||
|
|
||||||
|
# Can also use cuBLAS
|
||||||
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
|
pname = "hipblas";
|
||||||
|
version = "5.4.1";
|
||||||
|
|
||||||
|
outputs = [
|
||||||
|
"out"
|
||||||
|
] ++ lib.optionals buildTests [
|
||||||
|
"test"
|
||||||
|
] ++ lib.optionals buildBenchmarks [
|
||||||
|
"benchmark"
|
||||||
|
] ++ lib.optionals buildSamples [
|
||||||
|
"sample"
|
||||||
|
];
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "ROCmSoftwarePlatform";
|
||||||
|
repo = "hipBLAS";
|
||||||
|
rev = "rocm-${finalAttrs.version}";
|
||||||
|
hash = "sha256-mSZCq8UaiffMzWVflW1nAX6CQZ1DqwWJaSIzKslZSEk=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
cmake
|
||||||
|
rocm-cmake
|
||||||
|
hip
|
||||||
|
gfortran
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
rocblas
|
||||||
|
rocsolver
|
||||||
|
] ++ lib.optionals buildTests [
|
||||||
|
gtest
|
||||||
|
] ++ lib.optionals (buildTests || buildBenchmarks) [
|
||||||
|
lapack-reference
|
||||||
|
];
|
||||||
|
|
||||||
|
cmakeFlags = [
|
||||||
|
"-DCMAKE_C_COMPILER=hipcc"
|
||||||
|
"-DCMAKE_CXX_COMPILER=hipcc"
|
||||||
|
# Manually define CMAKE_INSTALL_<DIR>
|
||||||
|
# See: https://github.com/NixOS/nixpkgs/pull/197838
|
||||||
|
"-DCMAKE_INSTALL_BINDIR=bin"
|
||||||
|
"-DCMAKE_INSTALL_LIBDIR=lib"
|
||||||
|
"-DCMAKE_INSTALL_INCLUDEDIR=include"
|
||||||
|
] ++ lib.optionals buildTests [
|
||||||
|
"-DBUILD_CLIENTS_TESTS=ON"
|
||||||
|
] ++ lib.optionals buildBenchmarks [
|
||||||
|
"-DBUILD_CLIENTS_BENCHMARKS=ON"
|
||||||
|
] ++ lib.optionals buildSamples [
|
||||||
|
"-DBUILD_CLIENTS_SAMPLES=ON"
|
||||||
|
];
|
||||||
|
|
||||||
|
postInstall = lib.optionalString buildTests ''
|
||||||
|
mkdir -p $test/bin
|
||||||
|
mv $out/bin/hipblas-test $test/bin
|
||||||
|
'' + lib.optionalString buildBenchmarks ''
|
||||||
|
mkdir -p $benchmark/bin
|
||||||
|
mv $out/bin/hipblas-bench $benchmark/bin
|
||||||
|
'' + lib.optionalString buildSamples ''
|
||||||
|
mkdir -p $sample/bin
|
||||||
|
mv $out/bin/example-* $sample/bin
|
||||||
|
'' + lib.optionalString (buildTests || buildBenchmarks || buildSamples) ''
|
||||||
|
rmdir $out/bin
|
||||||
|
'';
|
||||||
|
|
||||||
|
passthru.updateScript = rocmUpdateScript {
|
||||||
|
name = finalAttrs.pname;
|
||||||
|
owner = finalAttrs.src.owner;
|
||||||
|
repo = finalAttrs.src.repo;
|
||||||
|
};
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "ROCm BLAS marshalling library";
|
||||||
|
homepage = "https://github.com/ROCmSoftwarePlatform/hipBLAS";
|
||||||
|
license = with licenses; [ mit ];
|
||||||
|
maintainers = teams.rocm.members;
|
||||||
|
# Fixed in develop branch by using C++17 and related refactor
|
||||||
|
broken = finalAttrs.version != hip.version || buildTests || buildBenchmarks || buildSamples;
|
||||||
|
};
|
||||||
|
})
|
|
@ -15336,6 +15336,10 @@ with pkgs;
|
||||||
stdenv = rocmClangStdenv;
|
stdenv = rocmClangStdenv;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
hipblas = callPackage ../development/libraries/hipblas {
|
||||||
|
stdenv = rocmClangStdenv;
|
||||||
|
};
|
||||||
|
|
||||||
rccl = callPackage ../development/libraries/rccl {
|
rccl = callPackage ../development/libraries/rccl {
|
||||||
stdenv = rocmClangStdenv;
|
stdenv = rocmClangStdenv;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue