-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy patharrayfire.cpp
54 lines (45 loc) · 1.08 KB
/
arrayfire.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "export.h"
#include "funcs.h"
#include "graphics.h"
#include "methods.h"
void Register (lua_State * L, lua_CFunction func)
{
int top = lua_gettop(L);
lua_pushcfunction(L, func); // ..., af, func
lua_pushvalue(L, -2); // ..., af, func, af
if (lua_pcall(L, 1, 0, 0)) // ...[, err]
{
printf("%s\n", lua_tostring(L, -1));
lua_settop(L, top); // ...
}
}
__EXPORT__ int luaopen_arrayfire_lib (lua_State * L)
{
lua_createtable(L, 0, 0); // af
// Library functions
Register(L, &AddEnums);
Register(L, &Backends);
Register(L, &ComputerVision);
Register(L, &ImageProcessing);
Register(L, &Interface);
Register(L, &IO);
Register(L, &LinearAlgebra);
Register(L, &Mathematics);
Register(L, &SignalProcessing);
Register(L, &Statistics);
Register(L, &Util);
Register(L, &Vector);
// Array methods
Register(L, &AssignIndex);
Register(L, &Create);
Register(L, &Constructor);
Register(L, &Device);
Register(L, &Features);
Register(L, &Helper);
Register(L, &Methods);
Register(L, &MoveReorder);
// Graphics functions
Register(L, &Draw);
Register(L, &Window);
return 1;
}