Skip to content

Commit 3b9d26d

Browse files
authored
Update global.h
1 parent 1635f3e commit 3b9d26d

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

source/source_pw/module_pwdft/global.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "source_hamilt/module_xc/xc_functional.h"
1616
#ifdef __CUDA
1717
#include "cublas_v2.h"
18+
#include <cuda.h> // for CUDA_VERSION
1819
#include "cufft.h"
1920

2021
static const char* _cublasGetErrorString(cublasStatus_t error)
@@ -65,22 +66,27 @@ static const char* _cufftGetErrorString(cufftResult_t error)
6566
return "CUFFT_INVALID_SIZE";
6667
case CUFFT_UNALIGNED_DATA:
6768
return "CUFFT_UNALIGNED_DATA";
68-
case CUFFT_INCOMPLETE_PARAMETER_LIST:
69-
return "CUFFT_INCOMPLETE_PARAMETER_LIST";
7069
case CUFFT_INVALID_DEVICE:
7170
return "CUFFT_INVALID_DEVICE";
72-
case CUFFT_PARSE_ERROR:
73-
return "CUFFT_PARSE_ERROR";
7471
case CUFFT_NO_WORKSPACE:
7572
return "CUFFT_NO_WORKSPACE";
7673
case CUFFT_NOT_IMPLEMENTED:
7774
return "CUFFT_NOT_IMPLEMENTED";
78-
case CUFFT_LICENSE_ERROR:
79-
return "CUFFT_LICENSE_ERROR";
8075
case CUFFT_NOT_SUPPORTED:
8176
return "CUFFT_NOT_SUPPORTED";
77+
78+
#if defined(CUDA_VERSION) && CUDA_VERSION < 13000
79+
case CUFFT_INCOMPLETE_PARAMETER_LIST:
80+
return "CUFFT_INCOMPLETE_PARAMETER_LIST";
81+
case CUFFT_PARSE_ERROR:
82+
return "CUFFT_PARSE_ERROR";
83+
case CUFFT_LICENSE_ERROR:
84+
return "CUFFT_LICENSE_ERROR";
85+
#endif
86+
87+
default:
88+
return "<unknown>";
8289
}
83-
return "<unknown>";
8490
}
8591

8692
#define CHECK_CUDA(func) \

0 commit comments

Comments
 (0)