Merge pull request #142688 from rowanG077/update-intel-compute-runtime

This commit is contained in:
Sandro 2021-10-29 20:29:27 +02:00 committed by GitHub
commit b956d146ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 25 deletions

View file

@ -5,7 +5,8 @@
, runCommandLocal
, bison
, flex
, llvmPackages_8
, llvmPackages_11
, lld_11
, opencl-clang
, python3
, spirv-llvm-translator
@ -14,7 +15,13 @@
}:
let
llvmPkgs = llvmPackages_8 // {
vc_intrinsics_src = fetchFromGitHub {
owner = "intel";
repo = "vc-intrinsics";
rev = "e5ad7e02aa4aa21a3cd7b3e5d1f3ec9b95f58872";
sha256 = "Vg1mngwpIQ3Tik0GgRXPG22lE4sLEAEFch492G2aIXs=";
};
llvmPkgs = llvmPackages_11 // {
inherit spirv-llvm-translator;
};
inherit (llvmPkgs) llvm;
@ -24,18 +31,18 @@ in
stdenv.mkDerivation rec {
pname = "intel-graphics-compiler";
version = "1.0.4241";
version = "1.0.8744";
src = fetchFromGitHub {
owner = "intel";
repo = "intel-graphics-compiler";
rev = "igc-${version}";
sha256 = "1jp3c67ppl1x4pazr5nzy52615cpx0kyckaridhc0fsmrkgilyxq";
sha256 = "G5+dYD8uZDPkRyn1sgXsRngdq4NJndiCJCYTRXyUgTA=";
};
nativeBuildInputs = [ clang cmake bison flex python3 ];
buildInputs = [ clang opencl-clang spirv-llvm-translator llvm ];
buildInputs = [ clang opencl-clang spirv-llvm-translator llvm lld_11 ];
strictDeps = true;
@ -53,9 +60,12 @@ stdenv.mkDerivation rec {
ln -s clang $out/clang-${versions.major (getVersion clang)}
ln -s ${opencl-clang}/lib/* $out/
ln -s ${lib.getLib libclang}/lib/clang/${getVersion clang}/include/opencl-c.h $out/
ln -s ${lib.getLib libclang}/lib/clang/${getVersion clang}/include/opencl-c-base.h $out/
'';
cmakeFlags = [
"-DVC_INTRINSICS_SRC=${vc_intrinsics_src}"
"-DINSTALL_SPIRVDLL=0"
"-DCCLANG_BUILD_PREBUILDS=ON"
"-DCCLANG_BUILD_PREBUILDS_DIR=${prebuilds}"
"-DIGC_PREFERRED_LLVM_VERSION=${getVersion llvm}"

View file

@ -2,29 +2,30 @@
, fetchFromGitHub
, cmake
, pkg-config
, lit
, llvm_8
, llvm_11
}:
stdenv.mkDerivation rec {
pname = "SPIRV-LLVM-Translator";
version = "8.0.1-2";
version = "unstable-2021-06-13";
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "SPIRV-LLVM-Translator";
rev = "v${version}";
sha256 = "0hxalc3fkliqs61hpr97phbm3qsx4b8vgnlg30aimzr6aas403r5";
rev = "c67e6f26a7285aa753598ef792593ac4a545adf9";
sha256 = "sha256-1s3lVNTQDl+pUvbzSMsp3cOUSm6I4DzqJxnLMeeE3F4=";
};
nativeBuildInputs = [ pkg-config cmake llvm_8.dev ];
nativeBuildInputs = [ pkg-config cmake llvm_11.dev ];
buildInputs = [ llvm_8 ];
buildInputs = [ llvm_11 ];
checkInputs = [ lit ];
cmakeFlags = [ "-DLLVM_INCLUDE_TESTS=ON" ];
cmakeFlags = [
"-DLLVM_INCLUDE_TESTS=ON"
];
# FIXME: CMake tries to run "/llvm-lit" which of course doesn't exist
doCheck = false;

View file

@ -5,14 +5,14 @@
, cmake
, git
, llvmPackages_8
, llvmPackages_11
, spirv-llvm-translator
, buildWithPatches ? true
}:
let
llvmPkgs = llvmPackages_8 // {
llvmPkgs = llvmPackages_11 // {
inherit spirv-llvm-translator;
};
@ -31,7 +31,8 @@ let
});
passthru = rec {
spirv-llvm-translator = llvmPkgs.spirv-llvm-translator;
llvm = addPatches "llvm" llvmPkgs.llvm;
libclang = addPatches "clang" llvmPkgs.libclang;
clang-unwrapped = libclang.out;
@ -43,14 +44,21 @@ let
patchesOut = stdenv.mkDerivation rec {
pname = "opencl-clang-patches";
inherit (library) version src patches;
# Clang patches assume the root is the llvm root dir
# but clang root in nixpkgs is the clang sub-directory
postPatch = ''
for filename in patches/clang/*.patch; do
substituteInPlace "$filename" \
--replace "a/clang/" "a/" \
--replace "b/clang/" "b/"
done
'';
installPhase = ''
[ -d patches ] && cp -r patches/ $out || mkdir $out
mkdir -p $out/clang $out/spirv
mkdir -p $out/clang $out/llvm
'';
};
spirv-llvm-translator = addPatches "spirv" llvmPkgs.spirv-llvm-translator;
};
library = let
@ -59,15 +67,15 @@ let
in
stdenv.mkDerivation rec {
pname = "opencl-clang";
version = "unstable-2019-08-16";
version = "unstable-2021-06-22";
inherit passthru;
src = fetchFromGitHub {
owner = "intel";
repo = "opencl-clang";
rev = "94af090661d7c953c516c97a25ed053c744a0737";
sha256 = "05cg89m62nqjqm705h7gpdz4jd4hiczg8944dcjsvaybrqv3hcm5";
rev = "fd68f64b33e67d58f6c36b9e25c31c1178a1962a";
sha256 = "sha256-q1YPBb/LY67iEuQx1fMUQD/I7OsNfobW3yNfJxLXx3E=";
};
patches = [

View file

@ -11,13 +11,13 @@
stdenv.mkDerivation rec {
pname = "intel-compute-runtime";
version = "20.34.17727";
version = "21.42.21270";
src = fetchFromGitHub {
owner = "intel";
repo = "compute-runtime";
rev = version;
sha256 = "19scbbr6jf3yp2v7z8xyzzm01g44jym7xfkf1dz64d5nhvjw6ig5";
sha256 = "N9MsDcsL8kBWxfZjhukcxZiSJnXxqMgWF0etOhf2/AE=";
};
nativeBuildInputs = [ cmake pkg-config ];