blob: 9a80128c388134ba1b27b166fc9b1eddbbd5cd59 (
plain) (
tree)
|
|
#ifndef NERV_FASTNN_EXAMPLE_H
#define NERV_FASTNN_EXAMPLE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "matrix/matrix.h"
#include "stdbool.h"
#include "../../nerv/lib/matrix/cuda_helper.h"
#include "../../nerv/lib/common.h"
#include "../../nerv/lib/matrix/cumatrix.h"
#define STRLEN 1024
typedef struct GPUInfo GPUInfo;
typedef struct MPIGPUInfo MPIGPUInfo;
typedef struct Device Device;
CuContext* CuContext_new();
CuContext* CuContext_newWithId(long id);
long CuContext_id(CuContext *context);
void CuContext_destroy(CuContext *context);
Device* Device_new();
Device* Device_newWithId(long);
long Device_id(Device *device);
void Device_detroy(Device *device);
void Initialize(Device *device, Status *status);
void GetFreeMemory(size_t* free, size_t* total, Status *status);
void DeviceGetName(char* name, int len, int dev, Status *status);
void GetBandwidth(int gpu_idx, float *d2h, float *h2d, Status *status);
int AutoSelectGPU(Device *device, Status *status);
void SelectGPU(Device *device, int gpu_id, Status *status);
#ifdef __cplusplus
} // closing brace for extern "C"
#endif // end Device
#endif
|