chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 12:36:30 +08:00
commit 55ab4e4a73
473 changed files with 72932 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
#pragma once
#include "err.h"
#define EG_DOUBLE_INF 1e100
#define EXIT_IF_CUDA_FAILED(condition) \
cuda_ret = condition; \
if (cuda_ret != cudaSuccess) { \
goto exit; \
} \
#ifndef _IN_
#define _IN_
#endif
#ifndef _OUT_
#define _OUT_
#endif
#ifndef _BUFFER_
#define _BUFFER_
#endif
+31
View File
@@ -0,0 +1,31 @@
#include <string>
#include "err.h"
namespace gpu_easygraph {
using std::string;
std::string err_code_detail(
int status
) {
switch (status) {
case EG_GPU_SUCC:
return "EasyGraph GPU: success";
case EG_GPU_FAILED_TO_ALLOCATE_HOST_MEM:
return "EasyGraph GPU: failed to allocate host mem";
case EG_GPU_FAILED_TO_ALLOCATE_DEVICE_MEM:
return "EasyGraph GPU: failed to allocate gpu mem";
case EG_GPU_DEVICE_ERR:
return "EasyGraph GPU: gpu error occurred";
case EG_GPU_UNKNOW_ERROR:
return "EasyGraph GPU: gpu unkonw error";
case EG_UNSUPPORTED_GRAPH:
return "EasyGraph GPU: unsupported graph type";
default:
break;
}
return "EasyGraph GPU: not a valid err_code";
}
} // namespace gpu_easygraph
+20
View File
@@ -0,0 +1,20 @@
#pragma once
#include <string>
namespace gpu_easygraph {
typedef enum {
EG_GPU_SUCC = 0,
EG_GPU_FAILED_TO_ALLOCATE_HOST_MEM,
EG_GPU_FAILED_TO_ALLOCATE_DEVICE_MEM,
EG_GPU_DEVICE_ERR,
EG_GPU_UNKNOW_ERROR,
EG_UNSUPPORTED_GRAPH
} EG_GPU_STATUS_CODE;
std::string err_code_detail(
int status
);
} // namespace gpu_easygraph