mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 07:23:20 +00:00
Merge pull request #322945 from SomeoneSerge/feat/sycl-cuda
opensycl: add cudaSupport
This commit is contained in:
commit
a5b003f179
@ -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 = ''
|
||||
|
Loading…
Reference in New Issue
Block a user