|
27 | 27 |
|
28 | 28 | #include <cuda/std/__exception/cuda_error.h>
|
29 | 29 |
|
30 |
| -#if _CCCL_HAS_CUDA_COMPILER() |
31 |
| -# define _CCCL_TRY_CUDA_API(_NAME, _MSG, ...) \ |
32 |
| - { \ |
33 |
| - const ::cudaError_t __status = _NAME(__VA_ARGS__); \ |
34 |
| - switch (__status) \ |
35 |
| - { \ |
36 |
| - case ::cudaSuccess: \ |
37 |
| - break; \ |
38 |
| - default: \ |
39 |
| - ::cudaGetLastError(); \ |
40 |
| - ::cuda::__throw_cuda_error(__status, _MSG); \ |
41 |
| - } \ |
42 |
| - } |
43 |
| - |
44 |
| -# define _CCCL_ASSERT_CUDA_API(_NAME, _MSG, ...) \ |
45 |
| - { \ |
46 |
| - [[maybe_unused]] const ::cudaError_t __status = _NAME(__VA_ARGS__); \ |
47 |
| - _CCCL_ASSERT(__status == cudaSuccess, _MSG); \ |
48 |
| - } |
49 |
| -#else // ^^^ _CCCL_HAS_CUDA_COMPILER() ^^^ / vvv !_CCCL_HAS_CUDA_COMPILER() vvv |
50 |
| -# define _CCCL_TRY_CUDA_API(_NAME, _MSG, ...) |
51 |
| -# define _CCCL_ASSERT_CUDA_API(_NAME, _MSG, ...) |
52 |
| -#endif // !_CCCL_HAS_CUDA_COMPILER() |
| 30 | +#define _CCCL_TRY_CUDA_API(_NAME, _MSG, ...) \ |
| 31 | + { \ |
| 32 | + const ::cudaError_t __status = _NAME(__VA_ARGS__); \ |
| 33 | + switch (__status) \ |
| 34 | + { \ |
| 35 | + case ::cudaSuccess: \ |
| 36 | + break; \ |
| 37 | + default: \ |
| 38 | + ::cudaGetLastError(); \ |
| 39 | + ::cuda::__throw_cuda_error(__status, _MSG); \ |
| 40 | + } \ |
| 41 | + } |
| 42 | + |
| 43 | +#define _CCCL_ASSERT_CUDA_API(_NAME, _MSG, ...) \ |
| 44 | + { \ |
| 45 | + [[maybe_unused]] const ::cudaError_t __status = _NAME(__VA_ARGS__); \ |
| 46 | + _CCCL_ASSERT(__status == cudaSuccess, _MSG); \ |
| 47 | + } |
53 | 48 |
|
54 | 49 | #endif //_CUDA__STD__CUDA_API_WRAPPER_H
|
0 commit comments