aboutsummaryrefslogtreecommitdiff
path: root/fastnn/device/Device.h
blob: 9a80128c388134ba1b27b166fc9b1eddbbd5cd59 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#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