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.
This commit is contained in:
Rui Peng Li 2023-11-15 11:43:16 -08:00 committed by GitHub
parent cf43b16530
commit c215800934
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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];