-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathncs.cpp
38 lines (31 loc) · 1.13 KB
/
ncs.cpp
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
#include "ncs.h"
#include <stdio.h>
int ncs_GetDeviceName(int idx, char* name) {
mvncStatus r = mvncGetDeviceName(idx, name, NAME_SIZE);
return int(r);
}
int ncs_OpenDevice(const char* name, void** deviceHandle) {
mvncStatus r = mvncOpenDevice(name, deviceHandle);
return int(r);
}
int ncs_CloseDevice(void* deviceHandle) {
mvncStatus r = mvncCloseDevice(deviceHandle);
return int(r);
}
int ncs_AllocateGraph(void* deviceHandle, void** graphHandle, void* graphData, unsigned int graphDataLen) {
mvncStatus r = mvncAllocateGraph(deviceHandle, graphHandle, graphData, graphDataLen);
return int(r);
}
int ncs_DeallocateGraph(void* graphHandle) {
mvncStatus r = mvncDeallocateGraph(graphHandle);
return int(r);
}
int ncs_LoadTensor(void* graphHandle, void* tensorData, unsigned int tensorDataLen) {
mvncStatus r = mvncLoadTensor(graphHandle, tensorData, tensorDataLen, NULL);
return int(r);
}
int ncs_GetResult(void* graphHandle, ResultData* resultData) {
void* userParam;
mvncStatus r = mvncGetResult(graphHandle, &(resultData->data), &(resultData->length), &userParam);
return int(r);
}