2828#ifndef COMMON_HELPER_CUDA_H_
2929#define COMMON_HELPER_CUDA_H_
3030
31- #include < stdint.h>
32- #include < stdio.h>
33- #include < stdlib.h>
34- #include < string.h>
31+ #include < cstdio>
3532
3633#include < finufft_errors.h>
3734
@@ -46,15 +43,14 @@ static const char *_cudaGetErrorEnum(cudaError_t error) {
4643#define checkCudaErrors (val ) check((val), #val, __FILE__, __LINE__)
4744
4845template <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) {
5148 return pool_supported ? cudaMallocAsync (devPtr, size, stream)
5249 : cudaMalloc (devPtr, size);
5350}
5451
5552template <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) {
5854 return pool_supported ? cudaFreeAsync (devPtr, stream) : cudaFree (devPtr);
5955}
6056
@@ -108,26 +104,29 @@ static const char *cufftGetErrorString(cufftResult error) {
108104 case CUFFT_UNALIGNED_DATA:
109105 return " CUFFT_UNALIGNED_DATA" ;
110106
111- case CUFFT_INCOMPLETE_PARAMETER_LIST:
112- return " CUFFT_INCOMPLETE_PARAMETER_LIST" ;
113-
114107 case CUFFT_INVALID_DEVICE:
115108 return " CUFFT_INVALID_DEVICE" ;
116109
117- case CUFFT_PARSE_ERROR:
118- return " CUFFT_PARSE_ERROR" ;
119-
120110 case CUFFT_NO_WORKSPACE:
121111 return " CUFFT_NO_WORKSPACE" ;
122112
123113 case CUFFT_NOT_IMPLEMENTED:
124114 return " CUFFT_NOT_IMPLEMENTED" ;
125115
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
126121 case CUFFT_LICENSE_ERROR:
127122 return " CUFFT_LICENSE_ERROR" ;
128123
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
131130 }
132131
133132 return " <unknown>" ;
0 commit comments