SYCL: Update env. vars to select GPUs
authorAndrey Alekseenko <al42and@gmail.com>
Wed, 2 Jun 2021 09:06:18 +0000 (12:06 +0300)
committerMark Abraham <mark.j.abraham@gmail.com>
Wed, 2 Jun 2021 11:20:34 +0000 (11:20 +0000)
SYCL_DEVICE_FILTER is supported in OneAPI releases, so we can safely
recommend it. Also added the ROCm string when compiled with hipSYCL.

src/gromacs/taskassignment/decidegpuusage.cpp

index c407f61d5d2ff0678965d4ac6b152b1cb5ba095e..25bf5f9bc142c3f63767bd076d9a0df4b38fbe68 100644 (file)
@@ -96,11 +96,14 @@ const char* const g_specifyEverythingFormatString =
         // OpenCL standard, but the only current relevant case for GROMACS
         // is AMD OpenCL, which offers this variable.
         "GPU_DEVICE_ORDINAL"
-#    elif GMX_GPU_SYCL
-        // As with OpenCL, there are no portable way to do it.
-        // Intel reference: https://github.com/intel/llvm/blob/sycl/sycl/doc/EnvironmentVariables.md
-        // While SYCL_DEVICE_FILTER is a better option, as of 2021.1-beta10 it is not yet supported.
-        "SYCL_DEVICE_ALLOWLIST"
+#    elif GMX_GPU_SYCL && GMX_SYCL_DPCPP
+        // https://github.com/intel/llvm/blob/sycl/sycl/doc/EnvironmentVariables.md
+        "SYCL_DEVICE_FILTER"
+#    elif GMX_GPU_SYCL && GMX_SYCL_HIPSYCL
+        // Not true if we use hipSYCL over CUDA or IntelLLVM, but in that case the user probably
+        // knows what they are doing.
+        // https://rocmdocs.amd.com/en/latest/Other_Solutions/Other-Solutions.html#hip-environment-variables
+        "HIP_VISIBLE_DEVICES"
 #    else
 #        error "Unreachable branch"
 #    endif