chore: import upstream snapshot with attribution
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user