KappaCUDA 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/KappaCUDA.i +166 -0
- data/KappaCUDA_wrap.cpp +30165 -0
- data/extconf.rb +17 -0
- data/test.rb +10 -0
- metadata +70 -0
data/KappaCUDA.i
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
%module KappaCUDA
|
|
2
|
+
%include "std_string.i"
|
|
3
|
+
#ifndef SWIGPHP
|
|
4
|
+
%include "carrays.i"
|
|
5
|
+
%array_class(int, intArray);
|
|
6
|
+
%array_class(long, longArray);
|
|
7
|
+
%array_class(unsigned, unsignedArray);
|
|
8
|
+
%array_class(float, floatArray);
|
|
9
|
+
%array_class(double, doubleArray);
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
#ifdef SWIGPERL
|
|
13
|
+
%perlcode %{
|
|
14
|
+
$KappaCUDA::VERSION = '1.2.0';
|
|
15
|
+
%}
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
#ifdef SWIGPYTHON
|
|
19
|
+
%ignore None;
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
#ifdef SWIGRUBY
|
|
23
|
+
// These give compile errors
|
|
24
|
+
%ignore kappa::Arguments::Type;
|
|
25
|
+
%ignore kappa::Value::Type;
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
// Ignore non-exported (hidden) methods and variables
|
|
29
|
+
%ignore kappa::Kappa::Cancel;
|
|
30
|
+
%ignore kappa::Kappa::End;
|
|
31
|
+
%ignore kappa::Kappa::Done;
|
|
32
|
+
%ignore kappa::Kappa::CPUProcess;
|
|
33
|
+
%ignore kappa::Kappa::GPUProcess;
|
|
34
|
+
%ignore cuDevice;
|
|
35
|
+
%ignore kappa_version;
|
|
36
|
+
%ignore kappa::Process::Process;
|
|
37
|
+
%ignore kappa::Process::GetIOCallbackFunction;
|
|
38
|
+
%ignore kappa::Resource::Resource;
|
|
39
|
+
%ignore kappa::Resource::CommandDone;
|
|
40
|
+
%ignore kappa::Resource::CheckCommandReady;
|
|
41
|
+
%ignore kappa::Context::Context;
|
|
42
|
+
%ignore kappa::Recipient;
|
|
43
|
+
%ignore kappa::Variable::Variable;
|
|
44
|
+
%ignore kappa::Array::Array;
|
|
45
|
+
%ignore kappa::DeviceMemory;
|
|
46
|
+
%ignore kappa::DeviceTexture;
|
|
47
|
+
%ignore kappa::LocalMemory;
|
|
48
|
+
#pragma SWIG nowarn=319,401,402
|
|
49
|
+
|
|
50
|
+
%{
|
|
51
|
+
// Undefine Perl's NORMAL--it just causes problems
|
|
52
|
+
#undef NORMAL
|
|
53
|
+
#include "Kappa.h"
|
|
54
|
+
#include "KappaConfig.h"
|
|
55
|
+
#include "kappa/ArgumentsDirection.h"
|
|
56
|
+
#include "kappa/ExceptionHandler.h"
|
|
57
|
+
#include "kappa/Process.h"
|
|
58
|
+
#include "kappa/Result.h"
|
|
59
|
+
#include "kappa/Namespace.h"
|
|
60
|
+
#include "kappa/Values.h"
|
|
61
|
+
#include "kappa/Value.h"
|
|
62
|
+
#include "kappa/Resource.h"
|
|
63
|
+
#include "kappa/Instruction.h"
|
|
64
|
+
#include "kappa/Attributes.h"
|
|
65
|
+
#include "kappa/Arguments.h"
|
|
66
|
+
#include "kappa/ProcessControlBlock.h"
|
|
67
|
+
// Undefine Perl's Copy and New macros--they just causes problems
|
|
68
|
+
#undef Copy
|
|
69
|
+
#undef New
|
|
70
|
+
#undef IsSet
|
|
71
|
+
#include "kappa/Context.h"
|
|
72
|
+
#include "kappa/Command.h"
|
|
73
|
+
#include "kappa/Variable.h"
|
|
74
|
+
#include "kappa/Array.h"
|
|
75
|
+
|
|
76
|
+
KAPPA_DLL_EXPORT int *intptr_fromvoidptr(void *voidptr);
|
|
77
|
+
KAPPA_DLL_EXPORT unsigned *unsignedptr_fromvoidptr(void *voidptr);
|
|
78
|
+
KAPPA_DLL_EXPORT long *longptr_fromvoidptr(void *voidptr);
|
|
79
|
+
KAPPA_DLL_EXPORT float *floatptr_fromvoidptr(void *voidptr);
|
|
80
|
+
KAPPA_DLL_EXPORT double *doubleptr_fromvoidptr(void *voidptr);
|
|
81
|
+
|
|
82
|
+
using namespace kappa;
|
|
83
|
+
%}
|
|
84
|
+
|
|
85
|
+
#define __attribute__(A)
|
|
86
|
+
%include "kappa/Common.h"
|
|
87
|
+
%include "Kappa.h"
|
|
88
|
+
%include "KappaConfig.h"
|
|
89
|
+
%include "kappa/ArgumentsDirection.h"
|
|
90
|
+
%include "kappa/ExceptionHandler.h"
|
|
91
|
+
%include "kappa/Process.h"
|
|
92
|
+
%include "kappa/Result.h"
|
|
93
|
+
%include "kappa/Namespace.h"
|
|
94
|
+
%include "kappa/Values.h"
|
|
95
|
+
%include "kappa/Value.h"
|
|
96
|
+
%include "kappa/Resource.h"
|
|
97
|
+
%include "kappa/Instruction.h"
|
|
98
|
+
%include "kappa/Attributes.h"
|
|
99
|
+
%include "kappa/Arguments.h"
|
|
100
|
+
%include "kappa/ProcessControlBlock.h"
|
|
101
|
+
%include "kappa/Context.h"
|
|
102
|
+
%include "kappa/Command.h"
|
|
103
|
+
%include "kappa/Variable.h"
|
|
104
|
+
%include "kappa/Array.h"
|
|
105
|
+
|
|
106
|
+
KAPPA_DLL_EXPORT int *intptr_fromvoidptr(void *voidptr);
|
|
107
|
+
KAPPA_DLL_EXPORT unsigned *unsignedptr_fromvoidptr(void *voidptr);
|
|
108
|
+
KAPPA_DLL_EXPORT long *longptr_fromvoidptr(void *voidptr);
|
|
109
|
+
KAPPA_DLL_EXPORT float *floatptr_fromvoidptr(void *voidptr);
|
|
110
|
+
KAPPA_DLL_EXPORT double *doubleptr_fromvoidptr(void *voidptr);
|
|
111
|
+
|
|
112
|
+
%{
|
|
113
|
+
KAPPA_DLL_EXPORT int *intptr_fromvoidptr(void *voidptr) {
|
|
114
|
+
return (int *)voidptr;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
KAPPA_DLL_EXPORT unsigned *unsignedptr_fromvoidptr(void *voidptr) {
|
|
118
|
+
return (unsigned *)voidptr;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
KAPPA_DLL_EXPORT long *longptr_fromvoidptr(void *voidptr) {
|
|
122
|
+
return (long *)voidptr;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
KAPPA_DLL_EXPORT float *floatptr_fromvoidptr(void *voidptr) {
|
|
126
|
+
return (float *)voidptr;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
KAPPA_DLL_EXPORT double *doubleptr_fromvoidptr(void *voidptr) {
|
|
130
|
+
return (double *)voidptr;
|
|
131
|
+
}
|
|
132
|
+
%}
|
|
133
|
+
|
|
134
|
+
#ifdef SWIGPYTHON
|
|
135
|
+
KAPPA_DLL_EXPORT kappa::Command *kappaCommand_frompycobject(PyObject *voidptr);
|
|
136
|
+
KAPPA_DLL_EXPORT kappa::Kappa *kappaKappa_frompycobject(PyObject *voidptr);
|
|
137
|
+
KAPPA_DLL_EXPORT kappa::Process *kappaProcess_frompycobject(PyObject *voidptr);
|
|
138
|
+
KAPPA_DLL_EXPORT kappa::Attributes *kappaAttributes_frompycobject(PyObject *voidptr);
|
|
139
|
+
KAPPA_DLL_EXPORT kappa::Arguments *kappaArguments_frompycobject(PyObject *voidptr);
|
|
140
|
+
KAPPA_DLL_EXPORT kappa::Resource *kappaResource_frompycobject(PyObject *voidptr);
|
|
141
|
+
KAPPA_DLL_EXPORT kappa::ProcessControlBlock *kappaPCB_frompycobject(PyObject *voidptr);
|
|
142
|
+
|
|
143
|
+
%{
|
|
144
|
+
KAPPA_DLL_EXPORT kappa::Command *kappaCommand_frompycobject(PyObject *pycptr) {
|
|
145
|
+
return (kappa::Command *)PyCObject_AsVoidPtr (pycptr);
|
|
146
|
+
}
|
|
147
|
+
KAPPA_DLL_EXPORT kappa::Kappa *kappaKappa_frompycobject(PyObject *pycptr) {
|
|
148
|
+
return (kappa::Kappa *)PyCObject_AsVoidPtr (pycptr);
|
|
149
|
+
}
|
|
150
|
+
KAPPA_DLL_EXPORT kappa::Process *kappaProcess_frompycobject(PyObject *pycptr) {
|
|
151
|
+
return (kappa::Process *)PyCObject_AsVoidPtr (pycptr);
|
|
152
|
+
}
|
|
153
|
+
KAPPA_DLL_EXPORT kappa::Attributes *kappaAttributes_frompycobject(PyObject *pycptr) {
|
|
154
|
+
return (kappa::Attributes *)PyCObject_AsVoidPtr (pycptr);
|
|
155
|
+
}
|
|
156
|
+
KAPPA_DLL_EXPORT kappa::Arguments *kappaArguments_frompycobject(PyObject *pycptr) {
|
|
157
|
+
return (kappa::Arguments *)PyCObject_AsVoidPtr (pycptr);
|
|
158
|
+
}
|
|
159
|
+
KAPPA_DLL_EXPORT kappa::Resource *kappaResource_frompycobject(PyObject *pycptr) {
|
|
160
|
+
return (kappa::Resource *)PyCObject_AsVoidPtr (pycptr);
|
|
161
|
+
}
|
|
162
|
+
KAPPA_DLL_EXPORT kappa::ProcessControlBlock *kappaPCB_frompycobject(PyObject *pycptr) {
|
|
163
|
+
return (kappa::ProcessControlBlock *)PyCObject_AsVoidPtr (pycptr);
|
|
164
|
+
}
|
|
165
|
+
%}
|
|
166
|
+
#endif
|