This commit is contained in:
2025-09-21 20:19:24 +08:00
parent a558d0bf41
commit 8834983715

View File

@@ -0,0 +1,18 @@
#pragma once
#include <stdio.h>
#define CHECK_CALL(call) \
do \
{ \
const cudaError_t error_code = call; \
if (error_code != cudaSuccess) \
{ \
printf("CUDA Error:\n"); \
printf(" File: %s\n", __FILE__); \
printf(" Line: %d\n", __LINE__); \
printf(" Error code: %d\n", error_code); \
printf(" Error text: %s\n", \
cudaGetErrorString(error_code)); \
exit(1); \
} \
} while (0)