2020-04-23 03:24:43 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, cmake }:
|
2019-12-03 04:49:50 +00:00
|
|
|
|
2020-04-18 16:38:48 +01:00
|
|
|
# This was originally called mkl-dnn, then it was renamed to dnnl, and it has
|
2020-04-23 03:24:43 +01:00
|
|
|
# just recently been renamed again to oneDNN. See here for details:
|
2020-04-18 16:38:48 +01:00
|
|
|
# https://github.com/oneapi-src/oneDNN#oneapi-deep-neural-network-library-onednn
|
2019-12-03 04:49:50 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-23 03:24:43 +01:00
|
|
|
pname = "oneDNN";
|
2020-07-21 10:20:00 +01:00
|
|
|
version = "1.5.1";
|
2019-12-03 04:49:50 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-04-18 16:38:48 +01:00
|
|
|
owner = "oneapi-src";
|
|
|
|
repo = "oneDNN";
|
2019-12-03 04:49:50 +00:00
|
|
|
rev = "v${version}";
|
2020-07-21 10:20:00 +01:00
|
|
|
sha256 = "1l66gkidldjpznp8pb01wdgrmm0rmrbndv8lzidz8fp9hf473zgl";
|
2019-12-03 04:49:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" "doc" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2020-02-03 01:24:23 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2019-12-03 04:49:50 +00:00
|
|
|
# The test driver doesn't add an RPath to the build libdir
|
|
|
|
preCheck = ''
|
2020-07-20 10:20:00 +01:00
|
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/src
|
|
|
|
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD/src
|
2020-07-23 08:04:35 +01:00
|
|
|
'' + lib.optionalString stdenv.isx86_64 ''
|
|
|
|
# Use baseline SIMD in case CPU features get misdetected.
|
|
|
|
export DNNL_MAX_CPU_ISA=SSE41
|
2019-12-03 04:49:50 +00:00
|
|
|
'';
|
|
|
|
|
2020-02-03 01:24:23 +00:00
|
|
|
# The cmake install gets tripped up and installs a nix tree into $out, in
|
|
|
|
# addition to the correct install; clean it up.
|
|
|
|
postInstall = ''
|
|
|
|
rm -r $out/nix
|
|
|
|
'';
|
2019-12-03 04:49:50 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2020-04-18 16:38:48 +01:00
|
|
|
description = "oneAPI Deep Neural Network Library (oneDNN)";
|
2020-07-20 10:20:00 +01:00
|
|
|
homepage = "https://01.org/oneDNN";
|
2020-04-18 16:38:48 +01:00
|
|
|
changelog = "https://github.com/oneapi-src/oneDNN/releases/tag/v${version}";
|
2019-12-03 04:49:50 +00:00
|
|
|
license = licenses.asl20;
|
2020-07-20 10:20:00 +01:00
|
|
|
platforms = platforms.all;
|
2019-12-03 04:49:50 +00:00
|
|
|
maintainers = with maintainers; [ alexarice bhipple ];
|
|
|
|
};
|
|
|
|
}
|