28
28
#ifndef COMMON_HELPER_CUDA_H_
29
29
#define COMMON_HELPER_CUDA_H_
30
30
31
- #include < stdint.h>
32
- #include < stdio.h>
33
- #include < stdlib.h>
34
- #include < string.h>
31
+ #include < cstdio>
35
32
36
33
#include < finufft_errors.h>
37
34
@@ -46,15 +43,14 @@ static const char *_cudaGetErrorEnum(cudaError_t error) {
46
43
#define checkCudaErrors (val ) check((val), #val, __FILE__, __LINE__)
47
44
48
45
template <typename T>
49
- static inline cudaError_t cudaMallocWrapper (T **devPtr, size_t size, cudaStream_t stream,
50
- int pool_supported) {
46
+ static cudaError_t cudaMallocWrapper (T **devPtr, size_t size, cudaStream_t stream,
47
+ int pool_supported) {
51
48
return pool_supported ? cudaMallocAsync (devPtr, size, stream)
52
49
: cudaMalloc (devPtr, size);
53
50
}
54
51
55
52
template <typename T>
56
- static inline cudaError_t cudaFreeWrapper (T *devPtr, cudaStream_t stream,
57
- int pool_supported) {
53
+ static cudaError_t cudaFreeWrapper (T *devPtr, cudaStream_t stream, int pool_supported) {
58
54
return pool_supported ? cudaFreeAsync (devPtr, stream) : cudaFree (devPtr);
59
55
}
60
56
@@ -108,26 +104,29 @@ static const char *cufftGetErrorString(cufftResult error) {
108
104
case CUFFT_UNALIGNED_DATA:
109
105
return " CUFFT_UNALIGNED_DATA" ;
110
106
111
- case CUFFT_INCOMPLETE_PARAMETER_LIST:
112
- return " CUFFT_INCOMPLETE_PARAMETER_LIST" ;
113
-
114
107
case CUFFT_INVALID_DEVICE:
115
108
return " CUFFT_INVALID_DEVICE" ;
116
109
117
- case CUFFT_PARSE_ERROR:
118
- return " CUFFT_PARSE_ERROR" ;
119
-
120
110
case CUFFT_NO_WORKSPACE:
121
111
return " CUFFT_NO_WORKSPACE" ;
122
112
123
113
case CUFFT_NOT_IMPLEMENTED:
124
114
return " CUFFT_NOT_IMPLEMENTED" ;
125
115
116
+ case CUFFT_NOT_SUPPORTED:
117
+ return " CUFFT_NOT_SUPPORTED" ;
118
+
119
+ // they are deprecated in 12.9 removed in 13
120
+ #if __CUDACC_VER_MAJOR__ < 13
126
121
case CUFFT_LICENSE_ERROR:
127
122
return " CUFFT_LICENSE_ERROR" ;
128
123
129
- case CUFFT_NOT_SUPPORTED:
130
- return " CUFFT_NOT_SUPPORTED" ;
124
+ case CUFFT_PARSE_ERROR:
125
+ return " CUFFT_PARSE_ERROR" ;
126
+
127
+ case CUFFT_INCOMPLETE_PARAMETER_LIST:
128
+ return " CUFFT_INCOMPLETE_PARAMETER_LIST" ;
129
+ #endif
131
130
}
132
131
133
132
return " <unknown>" ;
0 commit comments