Rename hheader files to .cuh

This commit is contained in:
2024-02-26 19:53:46 +01:00
parent d3520d5b13
commit 6e99525ad0
10 changed files with 8 additions and 7 deletions

View File

@@ -0,0 +1,32 @@
#ifndef CUDA_HELPER_H
#define CUDA_HELPER_H
#include <cuda_runtime.h>
#include <cublas_v2.h>
#define IDX2C(i,j,ld) (((j)*(ld))+(i))
// CUDA error checking macro
#define CUDA_CHECK(call) \
do { \
cudaError_t result = call; \
if (result != cudaSuccess) { \
fprintf(stderr, "CUDA error at %s:%d code=%d(%s) \"%s\" \n", \
__FILE__, __LINE__, static_cast<unsigned int>(result), \
cudaGetErrorString(result), #call); \
exit(EXIT_FAILURE); \
} \
} while (0)
// cuBLAS error checking macro
#define CUBLAS_CHECK(call) \
do { \
cublasStatus_t result = call; \
if (result != CUBLAS_STATUS_SUCCESS) { \
fprintf(stderr, "cuBLAS error at %s:%d code=%d\n", \
__FILE__, __LINE__, static_cast<unsigned int>(result)); \
exit(EXIT_FAILURE); \
} \
} while (0)
#endif // CUDA_HELPER_H