Merge pull request #322945 from SomeoneSerge/feat/sycl-cuda

opensycl: add cudaSupport
This commit is contained in:
Someone 2024-06-27 20:05:03 +00:00 committed by GitHub
commit a5b003f179
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,8 +9,13 @@
, libffi
, makeWrapper
, config
, cudaPackages
, rocmPackages_5
, ompSupport ? true
, openclSupport ? false
, rocmSupport ? config.rocmSupport
, cudaSupport ? config.cudaSupport
, autoAddDriverRunpath
}:
let
inherit (llvmPackages_15) stdenv;
@ -31,6 +36,9 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [
cmake
makeWrapper
] ++ lib.optionals cudaSupport [
autoAddDriverRunpath
cudaPackages.cuda_nvcc
];
buildInputs = [
@ -43,11 +51,19 @@ stdenv.mkDerivation rec {
] ++ lib.optionals rocmSupport [
rocmPackages.clr
rocmPackages.rocm-runtime
] ++ lib.optionals cudaSupport [
cudaPackages.cuda_cudart
(lib.getOutput "stubs" cudaPackages.cuda_cudart)
];
# opensycl makes use of clangs internal headers. Its cmake does not successfully discover them automatically on nixos, so we supply the path manually
cmakeFlags = [
"-DCLANG_INCLUDE_PATH=${llvmPackages_15.libclang.dev}/include"
(lib.cmakeBool "WITH_CPU_BACKEND" ompSupport)
(lib.cmakeBool "WITH_CUDA_BACKEND" cudaSupport)
(lib.cmakeBool "WITH_ROCM_BACKEND" rocmSupport)
] ++ lib.optionals (lib.versionAtLeast version "24") [
(lib.cmakeBool "WITH_OPENCL_BACKEND" openclSupport)
];
postFixup = ''