about summary refs log tree commit diff
path: root/pkgs/applications/science/chemistry/cp2k/default.nix
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2023-11-14 18:01:11 +0000
committerGitHub <noreply@github.com>2023-11-14 18:01:11 +0000
commit6cc772a6fa213f2624f490735f4cf49426bcc0e0 (patch)
tree398d8785581708be3eb823fcffdc18b0f8726e65 /pkgs/applications/science/chemistry/cp2k/default.nix
parent0523b2e6c2ea7730352fa32e8a921ec331569571 (diff)
parentcd014bdb858891bc7a3f0c1267ef8ad4fd11f19c (diff)
downloadnixlib-6cc772a6fa213f2624f490735f4cf49426bcc0e0.tar
nixlib-6cc772a6fa213f2624f490735f4cf49426bcc0e0.tar.gz
nixlib-6cc772a6fa213f2624f490735f4cf49426bcc0e0.tar.bz2
nixlib-6cc772a6fa213f2624f490735f4cf49426bcc0e0.tar.lz
nixlib-6cc772a6fa213f2624f490735f4cf49426bcc0e0.tar.xz
nixlib-6cc772a6fa213f2624f490735f4cf49426bcc0e0.tar.zst
nixlib-6cc772a6fa213f2624f490735f4cf49426bcc0e0.zip
Merge master into staging-next
Diffstat (limited to 'pkgs/applications/science/chemistry/cp2k/default.nix')
-rw-r--r--pkgs/applications/science/chemistry/cp2k/default.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/pkgs/applications/science/chemistry/cp2k/default.nix b/pkgs/applications/science/chemistry/cp2k/default.nix
index 5bc0dddd79b6..16eabbcbcaa1 100644
--- a/pkgs/applications/science/chemistry/cp2k/default.nix
+++ b/pkgs/applications/science/chemistry/cp2k/default.nix
@@ -28,8 +28,16 @@
 , spfft
 , enableElpa ? false
 , elpa
-, gpuBackend ? "none"
 , cudaPackages
+, rocmPackages
+, config
+, gpuBackend ? (
+  if config.cudaSupport
+  then "cuda"
+  else if config.rocmSupport
+  then "rocm"
+  else "none"
+)
 # gpuVersion needs to be set for both CUDA as well as ROCM hardware.
 # gpuArch is only required for the ROCM stack.
 # Change to a value suitable for your target GPU.
@@ -37,7 +45,6 @@
 # and for Nvidia see https://github.com/cp2k/cp2k/blob/master/INSTALL.md#2i-cuda-optional-improved-performance-on-gpu-systems
 , gpuVersion ? "Mi100"
 , gpuArch ? "gfx908"
-, rocmPackages
 }:
 
 assert builtins.elem gpuBackend [ "none" "cuda" "rocm" ];