From c2158009348e30412b98eecc7b166c3aa3b3b965 Mon Sep 17 00:00:00 2001 From: Rui Peng Li Date: Wed, 15 Nov 2023 11:43:16 -0800 Subject: [PATCH] CUDA compile flag check (#1003) This PR relaxes the check of CUDA compile flags, which checks the equality of the major CUDA version of the compiled code, and also the minor version should not be larger than the GPU running on. --- src/utilities/device_utils.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/utilities/device_utils.c b/src/utilities/device_utils.c index e6293327f..00d6e4fb0 100644 --- a/src/utilities/device_utils.c +++ b/src/utilities/device_utils.c @@ -2688,7 +2688,12 @@ hypre_CudaCompileFlagCheck() /* HYPRE_CUDA_CALL(cudaDeviceSynchronize()); */ - if (cuda_arch_actual != cuda_arch_compile) + const hypre_int cuda_arch_actual_major = cuda_arch_actual / 100; + const hypre_int cuda_arch_compile_major = cuda_arch_compile / 100; + const hypre_int cuda_arch_actual_minor = cuda_arch_actual % 100; + const hypre_int cuda_arch_compile_minor = cuda_arch_compile % 100; + + if (cuda_arch_actual_major != cuda_arch_compile_major || cuda_arch_actual_minor < cuda_arch_compile_minor) { char msg[256];