opencl_ruby_ffi 1.2.0 → 1.2.1
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.
- checksums.yaml +4 -4
- data/lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb +330 -0
- data/opencl_ruby_ffi.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e9f5d4d2c0eb18228f08d90d5644f58c2cb75b9
|
4
|
+
data.tar.gz: dd5f999839dabe70165170e2cfce0b71f15ce7cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f8cc6b686b1341e0678ac8833ac0950af4c0114aa7ad5d9b71dfeba4ae6e9d67d6f86e766c0bb97a1a12e3cf8ef4f5598992129b69532732ee0d3d12d2cb402
|
7
|
+
data.tar.gz: 6d4fbdaa9088487292072f6273d3cbcb4eff037a90081ba8e34d8d96b1cf0350726112666c34a68869cb0cbb0b796531c0c8dbd9f3ee8a38c5daa4e5267523de
|
@@ -1,14 +1,344 @@
|
|
1
1
|
module OpenCL
|
2
|
+
# Maps the cl_char type of OpenCL
|
3
|
+
class Char1 < Struct
|
4
|
+
@size = OpenCL.find_type(:cl_char).size * 1
|
5
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", OpenCL.find_type(:cl_char).size * 0, OpenCL.find_type(:cl_char) ) ], OpenCL.find_type(:cl_char).size * 1, OpenCL.find_type(:cl_char).size * 1 )
|
6
|
+
# Creates a new Char1 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Char1 maps the memory pointed.
|
7
|
+
def initialize( s0 = 0 )
|
8
|
+
if s0.is_a?(FFI::Pointer) then
|
9
|
+
super(s0)
|
10
|
+
else
|
11
|
+
super()
|
12
|
+
self[:s0] = s0
|
13
|
+
end
|
14
|
+
end
|
15
|
+
# Reads the s0 member
|
16
|
+
def s0
|
17
|
+
return self[:s0]
|
18
|
+
end
|
19
|
+
# Sets the s0 member to value
|
20
|
+
def s0=(value)
|
21
|
+
self[:s0] = value
|
22
|
+
end
|
23
|
+
|
24
|
+
def inspect
|
25
|
+
return "#<#{self.class.name}: #{self[:s0]}>"
|
26
|
+
end
|
27
|
+
|
28
|
+
def to_s
|
29
|
+
return "Char1{ #{self[:s0]} }"
|
30
|
+
end
|
31
|
+
end
|
2
32
|
Char = OpenCL.find_type(:cl_char)
|
33
|
+
# Maps the cl_uchar type of OpenCL
|
34
|
+
class UChar1 < Struct
|
35
|
+
@size = OpenCL.find_type(:cl_uchar).size * 1
|
36
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", OpenCL.find_type(:cl_uchar).size * 0, OpenCL.find_type(:cl_uchar) ) ], OpenCL.find_type(:cl_uchar).size * 1, OpenCL.find_type(:cl_uchar).size * 1 )
|
37
|
+
# Creates a new UChar1 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, UChar1 maps the memory pointed.
|
38
|
+
def initialize( s0 = 0 )
|
39
|
+
if s0.is_a?(FFI::Pointer) then
|
40
|
+
super(s0)
|
41
|
+
else
|
42
|
+
super()
|
43
|
+
self[:s0] = s0
|
44
|
+
end
|
45
|
+
end
|
46
|
+
# Reads the s0 member
|
47
|
+
def s0
|
48
|
+
return self[:s0]
|
49
|
+
end
|
50
|
+
# Sets the s0 member to value
|
51
|
+
def s0=(value)
|
52
|
+
self[:s0] = value
|
53
|
+
end
|
54
|
+
|
55
|
+
def inspect
|
56
|
+
return "#<#{self.class.name}: #{self[:s0]}>"
|
57
|
+
end
|
58
|
+
|
59
|
+
def to_s
|
60
|
+
return "UChar1{ #{self[:s0]} }"
|
61
|
+
end
|
62
|
+
end
|
3
63
|
UChar = OpenCL.find_type(:cl_uchar)
|
64
|
+
# Maps the cl_short type of OpenCL
|
65
|
+
class Short1 < Struct
|
66
|
+
@size = OpenCL.find_type(:cl_short).size * 1
|
67
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", OpenCL.find_type(:cl_short).size * 0, OpenCL.find_type(:cl_short) ) ], OpenCL.find_type(:cl_short).size * 1, OpenCL.find_type(:cl_short).size * 1 )
|
68
|
+
# Creates a new Short1 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Short1 maps the memory pointed.
|
69
|
+
def initialize( s0 = 0 )
|
70
|
+
if s0.is_a?(FFI::Pointer) then
|
71
|
+
super(s0)
|
72
|
+
else
|
73
|
+
super()
|
74
|
+
self[:s0] = s0
|
75
|
+
end
|
76
|
+
end
|
77
|
+
# Reads the s0 member
|
78
|
+
def s0
|
79
|
+
return self[:s0]
|
80
|
+
end
|
81
|
+
# Sets the s0 member to value
|
82
|
+
def s0=(value)
|
83
|
+
self[:s0] = value
|
84
|
+
end
|
85
|
+
|
86
|
+
def inspect
|
87
|
+
return "#<#{self.class.name}: #{self[:s0]}>"
|
88
|
+
end
|
89
|
+
|
90
|
+
def to_s
|
91
|
+
return "Short1{ #{self[:s0]} }"
|
92
|
+
end
|
93
|
+
end
|
4
94
|
Short = OpenCL.find_type(:cl_short)
|
95
|
+
# Maps the cl_ushort type of OpenCL
|
96
|
+
class UShort1 < Struct
|
97
|
+
@size = OpenCL.find_type(:cl_ushort).size * 1
|
98
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", OpenCL.find_type(:cl_ushort).size * 0, OpenCL.find_type(:cl_ushort) ) ], OpenCL.find_type(:cl_ushort).size * 1, OpenCL.find_type(:cl_ushort).size * 1 )
|
99
|
+
# Creates a new UShort1 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, UShort1 maps the memory pointed.
|
100
|
+
def initialize( s0 = 0 )
|
101
|
+
if s0.is_a?(FFI::Pointer) then
|
102
|
+
super(s0)
|
103
|
+
else
|
104
|
+
super()
|
105
|
+
self[:s0] = s0
|
106
|
+
end
|
107
|
+
end
|
108
|
+
# Reads the s0 member
|
109
|
+
def s0
|
110
|
+
return self[:s0]
|
111
|
+
end
|
112
|
+
# Sets the s0 member to value
|
113
|
+
def s0=(value)
|
114
|
+
self[:s0] = value
|
115
|
+
end
|
116
|
+
|
117
|
+
def inspect
|
118
|
+
return "#<#{self.class.name}: #{self[:s0]}>"
|
119
|
+
end
|
120
|
+
|
121
|
+
def to_s
|
122
|
+
return "UShort1{ #{self[:s0]} }"
|
123
|
+
end
|
124
|
+
end
|
5
125
|
UShort = OpenCL.find_type(:cl_ushort)
|
126
|
+
# Maps the cl_int type of OpenCL
|
127
|
+
class Int1 < Struct
|
128
|
+
@size = OpenCL.find_type(:cl_int).size * 1
|
129
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", OpenCL.find_type(:cl_int).size * 0, OpenCL.find_type(:cl_int) ) ], OpenCL.find_type(:cl_int).size * 1, OpenCL.find_type(:cl_int).size * 1 )
|
130
|
+
# Creates a new Int1 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Int1 maps the memory pointed.
|
131
|
+
def initialize( s0 = 0 )
|
132
|
+
if s0.is_a?(FFI::Pointer) then
|
133
|
+
super(s0)
|
134
|
+
else
|
135
|
+
super()
|
136
|
+
self[:s0] = s0
|
137
|
+
end
|
138
|
+
end
|
139
|
+
# Reads the s0 member
|
140
|
+
def s0
|
141
|
+
return self[:s0]
|
142
|
+
end
|
143
|
+
# Sets the s0 member to value
|
144
|
+
def s0=(value)
|
145
|
+
self[:s0] = value
|
146
|
+
end
|
147
|
+
|
148
|
+
def inspect
|
149
|
+
return "#<#{self.class.name}: #{self[:s0]}>"
|
150
|
+
end
|
151
|
+
|
152
|
+
def to_s
|
153
|
+
return "Int1{ #{self[:s0]} }"
|
154
|
+
end
|
155
|
+
end
|
6
156
|
Int = OpenCL.find_type(:cl_int)
|
157
|
+
# Maps the cl_uint type of OpenCL
|
158
|
+
class UInt1 < Struct
|
159
|
+
@size = OpenCL.find_type(:cl_uint).size * 1
|
160
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", OpenCL.find_type(:cl_uint).size * 0, OpenCL.find_type(:cl_uint) ) ], OpenCL.find_type(:cl_uint).size * 1, OpenCL.find_type(:cl_uint).size * 1 )
|
161
|
+
# Creates a new UInt1 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, UInt1 maps the memory pointed.
|
162
|
+
def initialize( s0 = 0 )
|
163
|
+
if s0.is_a?(FFI::Pointer) then
|
164
|
+
super(s0)
|
165
|
+
else
|
166
|
+
super()
|
167
|
+
self[:s0] = s0
|
168
|
+
end
|
169
|
+
end
|
170
|
+
# Reads the s0 member
|
171
|
+
def s0
|
172
|
+
return self[:s0]
|
173
|
+
end
|
174
|
+
# Sets the s0 member to value
|
175
|
+
def s0=(value)
|
176
|
+
self[:s0] = value
|
177
|
+
end
|
178
|
+
|
179
|
+
def inspect
|
180
|
+
return "#<#{self.class.name}: #{self[:s0]}>"
|
181
|
+
end
|
182
|
+
|
183
|
+
def to_s
|
184
|
+
return "UInt1{ #{self[:s0]} }"
|
185
|
+
end
|
186
|
+
end
|
7
187
|
UInt = OpenCL.find_type(:cl_uint)
|
188
|
+
# Maps the cl_long type of OpenCL
|
189
|
+
class Long1 < Struct
|
190
|
+
@size = OpenCL.find_type(:cl_long).size * 1
|
191
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", OpenCL.find_type(:cl_long).size * 0, OpenCL.find_type(:cl_long) ) ], OpenCL.find_type(:cl_long).size * 1, OpenCL.find_type(:cl_long).size * 1 )
|
192
|
+
# Creates a new Long1 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Long1 maps the memory pointed.
|
193
|
+
def initialize( s0 = 0 )
|
194
|
+
if s0.is_a?(FFI::Pointer) then
|
195
|
+
super(s0)
|
196
|
+
else
|
197
|
+
super()
|
198
|
+
self[:s0] = s0
|
199
|
+
end
|
200
|
+
end
|
201
|
+
# Reads the s0 member
|
202
|
+
def s0
|
203
|
+
return self[:s0]
|
204
|
+
end
|
205
|
+
# Sets the s0 member to value
|
206
|
+
def s0=(value)
|
207
|
+
self[:s0] = value
|
208
|
+
end
|
209
|
+
|
210
|
+
def inspect
|
211
|
+
return "#<#{self.class.name}: #{self[:s0]}>"
|
212
|
+
end
|
213
|
+
|
214
|
+
def to_s
|
215
|
+
return "Long1{ #{self[:s0]} }"
|
216
|
+
end
|
217
|
+
end
|
8
218
|
Long = OpenCL.find_type(:cl_long)
|
219
|
+
# Maps the cl_ulong type of OpenCL
|
220
|
+
class ULong1 < Struct
|
221
|
+
@size = OpenCL.find_type(:cl_ulong).size * 1
|
222
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", OpenCL.find_type(:cl_ulong).size * 0, OpenCL.find_type(:cl_ulong) ) ], OpenCL.find_type(:cl_ulong).size * 1, OpenCL.find_type(:cl_ulong).size * 1 )
|
223
|
+
# Creates a new ULong1 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, ULong1 maps the memory pointed.
|
224
|
+
def initialize( s0 = 0 )
|
225
|
+
if s0.is_a?(FFI::Pointer) then
|
226
|
+
super(s0)
|
227
|
+
else
|
228
|
+
super()
|
229
|
+
self[:s0] = s0
|
230
|
+
end
|
231
|
+
end
|
232
|
+
# Reads the s0 member
|
233
|
+
def s0
|
234
|
+
return self[:s0]
|
235
|
+
end
|
236
|
+
# Sets the s0 member to value
|
237
|
+
def s0=(value)
|
238
|
+
self[:s0] = value
|
239
|
+
end
|
240
|
+
|
241
|
+
def inspect
|
242
|
+
return "#<#{self.class.name}: #{self[:s0]}>"
|
243
|
+
end
|
244
|
+
|
245
|
+
def to_s
|
246
|
+
return "ULong1{ #{self[:s0]} }"
|
247
|
+
end
|
248
|
+
end
|
9
249
|
ULong = OpenCL.find_type(:cl_ulong)
|
250
|
+
# Maps the cl_float type of OpenCL
|
251
|
+
class Float1 < Struct
|
252
|
+
@size = OpenCL.find_type(:cl_float).size * 1
|
253
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", OpenCL.find_type(:cl_float).size * 0, OpenCL.find_type(:cl_float) ) ], OpenCL.find_type(:cl_float).size * 1, OpenCL.find_type(:cl_float).size * 1 )
|
254
|
+
# Creates a new Float1 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Float1 maps the memory pointed.
|
255
|
+
def initialize( s0 = 0.0 )
|
256
|
+
if s0.is_a?(FFI::Pointer) then
|
257
|
+
super(s0)
|
258
|
+
else
|
259
|
+
super()
|
260
|
+
self[:s0] = s0
|
261
|
+
end
|
262
|
+
end
|
263
|
+
# Reads the s0 member
|
264
|
+
def s0
|
265
|
+
return self[:s0]
|
266
|
+
end
|
267
|
+
# Sets the s0 member to value
|
268
|
+
def s0=(value)
|
269
|
+
self[:s0] = value
|
270
|
+
end
|
271
|
+
|
272
|
+
def inspect
|
273
|
+
return "#<#{self.class.name}: #{self[:s0]}>"
|
274
|
+
end
|
275
|
+
|
276
|
+
def to_s
|
277
|
+
return "Float1{ #{self[:s0]} }"
|
278
|
+
end
|
279
|
+
end
|
10
280
|
Float = OpenCL.find_type(:cl_float)
|
281
|
+
# Maps the cl_double type of OpenCL
|
282
|
+
class Double1 < Struct
|
283
|
+
@size = OpenCL.find_type(:cl_double).size * 1
|
284
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", OpenCL.find_type(:cl_double).size * 0, OpenCL.find_type(:cl_double) ) ], OpenCL.find_type(:cl_double).size * 1, OpenCL.find_type(:cl_double).size * 1 )
|
285
|
+
# Creates a new Double1 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Double1 maps the memory pointed.
|
286
|
+
def initialize( s0 = 0.0 )
|
287
|
+
if s0.is_a?(FFI::Pointer) then
|
288
|
+
super(s0)
|
289
|
+
else
|
290
|
+
super()
|
291
|
+
self[:s0] = s0
|
292
|
+
end
|
293
|
+
end
|
294
|
+
# Reads the s0 member
|
295
|
+
def s0
|
296
|
+
return self[:s0]
|
297
|
+
end
|
298
|
+
# Sets the s0 member to value
|
299
|
+
def s0=(value)
|
300
|
+
self[:s0] = value
|
301
|
+
end
|
302
|
+
|
303
|
+
def inspect
|
304
|
+
return "#<#{self.class.name}: #{self[:s0]}>"
|
305
|
+
end
|
306
|
+
|
307
|
+
def to_s
|
308
|
+
return "Double1{ #{self[:s0]} }"
|
309
|
+
end
|
310
|
+
end
|
11
311
|
Double = OpenCL.find_type(:cl_double)
|
312
|
+
# Maps the cl_half type of OpenCL
|
313
|
+
class Half1 < Struct
|
314
|
+
@size = OpenCL.find_type(:cl_half).size * 1
|
315
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", OpenCL.find_type(:cl_half).size * 0, OpenCL.find_type(:cl_half) ) ], OpenCL.find_type(:cl_half).size * 1, OpenCL.find_type(:cl_half).size * 1 )
|
316
|
+
# Creates a new Half1 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Half1 maps the memory pointed.
|
317
|
+
def initialize( s0 = 0.0 )
|
318
|
+
if s0.is_a?(FFI::Pointer) then
|
319
|
+
super(s0)
|
320
|
+
else
|
321
|
+
super()
|
322
|
+
self[:s0] = s0
|
323
|
+
end
|
324
|
+
end
|
325
|
+
# Reads the s0 member
|
326
|
+
def s0
|
327
|
+
return self[:s0]
|
328
|
+
end
|
329
|
+
# Sets the s0 member to value
|
330
|
+
def s0=(value)
|
331
|
+
self[:s0] = value
|
332
|
+
end
|
333
|
+
|
334
|
+
def inspect
|
335
|
+
return "#<#{self.class.name}: #{self[:s0]}>"
|
336
|
+
end
|
337
|
+
|
338
|
+
def to_s
|
339
|
+
return "Half1{ #{self[:s0]} }"
|
340
|
+
end
|
341
|
+
end
|
12
342
|
Half = OpenCL.find_type(:cl_half)
|
13
343
|
# Maps the cl_char2 type of OpenCL
|
14
344
|
class Char2 < Struct
|
data/opencl_ruby_ffi.gemspec
CHANGED