forked from HiPerCoRe/cuFFTAdvisor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcudaAsserts.h
More file actions
76 lines (53 loc) · 1.72 KB
/
cudaAsserts.h
File metadata and controls
76 lines (53 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef CUFFTADVISOR_CUFFTASSERTS_H_
#define CUFFTADVISOR_CUFFTASSERTS_H_
#include <cuda_runtime.h>
#include <cufft.h>
#include <cstdio>
#include <stdexcept>
namespace cuFFTAdvisor {
void (gpuErrchk)(cudaError_t code, const char *file=__FILE__, int line=__LINE__, bool abort = true);
static inline const char *_cudaGetErrorEnum(cufftResult error) {
switch (error) {
case CUFFT_SUCCESS:
return "CUFFT_SUCCESS";
case CUFFT_INVALID_PLAN:
return "CUFFT_INVALID_PLAN";
case CUFFT_ALLOC_FAILED:
return "CUFFT_ALLOC_FAILED";
case CUFFT_INVALID_TYPE:
return "CUFFT_INVALID_TYPE";
case CUFFT_INVALID_VALUE:
return "CUFFT_INVALID_VALUE";
case CUFFT_INTERNAL_ERROR:
return "CUFFT_INTERNAL_ERROR";
case CUFFT_EXEC_FAILED:
return "CUFFT_EXEC_FAILED";
case CUFFT_SETUP_FAILED:
return "CUFFT_SETUP_FAILED";
case CUFFT_INVALID_SIZE:
return "CUFFT_INVALID_SIZE";
case CUFFT_UNALIGNED_DATA:
return "CUFFT_UNALIGNED_DATA";
case CUFFT_INVALID_DEVICE:
return "CUFFT_INVALID_DEVICE";
case CUFFT_NO_WORKSPACE:
return "CUFFT_NO_WORKSPACE";
case CUFFT_NOT_IMPLEMENTED:
return "CUFFT_NOT_IMPLEMENTED";
case CUFFT_NOT_SUPPORTED:
return "CUFFT_NOT_SUPPORTED";
#if CUDART_VERSION < 13000
case CUFFT_INCOMPLETE_PARAMETER_LIST:
return "CUFFT_INCOMPLETE_PARAMETER_LIST";
case CUFFT_PARSE_ERROR:
return "CUFFT_PARSE_ERROR";
case CUFFT_LICENSE_ERROR:
return "CUFFT_LICENSE_ERROR";
#endif
}
return "<unknown>";
}
void (gpuErrchkFFT)(cufftResult_t code, const char *file = __FILE__, int line = __LINE__,
bool abort = true);
} // namespace cuFFTAdvisor
#endif // CUFFTADVISOR_CUFFTASSERTS_H_