opencl_ruby_ffi 1.3.3 → 1.3.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5b21d6823d5293898d032505607499b748d65fc45c30b0ba11d618210630a6c0
|
4
|
+
data.tar.gz: a6439a7eb8f5fbb3f4555ac735b271053ceedc3e5b0367bab14952fb857cdd4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32995522c19c6180d34879752bab8613f3f0caf9049fa4a10ecb2ab692a46ac6df3a68b122d39e7bb6df44fe4327410cc229127d515be561dea722f4b85cd3b0
|
7
|
+
data.tar.gz: b2e8933cc719de81412adc6ee3864547f0308b9ae959bf93f8d0806019ffe7c835cea8530dbbc43e84b6a84d4d66b87de6619b3d32089595312870c473efc615
|
data/lib/opencl_ruby_ffi/Mem.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
using OpenCLRefinements if RUBY_VERSION.scan(/\d+/).collect(&:to_i).first >= 2
|
2
2
|
module OpenCL
|
3
3
|
|
4
|
-
# Attaches a callback to memobj
|
4
|
+
# Attaches a callback to memobj that will be called on memobj destruction
|
5
5
|
#
|
6
6
|
# ==== Attributes
|
7
7
|
#
|
8
8
|
# * +memobj+ - the Mem to attach the callback to
|
9
9
|
# * +options+ - a hash containing named options
|
10
|
-
# * +block+ - if provided, a callback invoked when memobj is released. Signature of the callback is { |
|
10
|
+
# * +block+ - if provided, a callback invoked when memobj is released. Signature of the callback is { |Pointer to the deleted Mem, Pointer to user_data| ... }
|
11
11
|
#
|
12
12
|
# ==== Options
|
13
13
|
#
|
@@ -16,7 +16,7 @@ module OpenCL
|
|
16
16
|
@@callbacks.push( block ) if block
|
17
17
|
error = clSetMemObjectDestructorCallback( memobj, block, options[:user_data] )
|
18
18
|
error_check(error)
|
19
|
-
return
|
19
|
+
return memobj
|
20
20
|
end
|
21
21
|
|
22
22
|
# Maps the cl_mem object of OpenCL
|
@@ -203,6 +203,41 @@ module OpenCL
|
|
203
203
|
return Program::new( program_ptr, false )
|
204
204
|
end
|
205
205
|
|
206
|
+
# Attaches a callback to program that will be called on program release
|
207
|
+
#
|
208
|
+
# ==== Attributes
|
209
|
+
#
|
210
|
+
# * +program+ - the Program to attach the callback to
|
211
|
+
# * +options+ - a hash containing named options
|
212
|
+
# * +block+ - if provided, a callback invoked when program is released. Signature of the callback is { |Pointer to the program, Pointer to user_data| ... }
|
213
|
+
#
|
214
|
+
# ==== Options
|
215
|
+
#
|
216
|
+
# * +:user_data+ - a Pointer (or convertible to Pointer using to_ptr) to the memory area to pass to the callback
|
217
|
+
def self.set_program_release_callback( program, options = {}, &block )
|
218
|
+
@@callbacks.push( block ) if block
|
219
|
+
error = clSetProgramReleaseCallback( program, block, options[:user_data] )
|
220
|
+
error_check(error)
|
221
|
+
return program
|
222
|
+
end
|
223
|
+
|
224
|
+
|
225
|
+
# Sets a specialization constant in a program
|
226
|
+
#
|
227
|
+
# ==== Attributes
|
228
|
+
#
|
229
|
+
# * +program+ - the Program to which constant needs to be set
|
230
|
+
# * +spec_id+ - the id of the specialization constant
|
231
|
+
# * +spec_value+ - value the constant must be set to
|
232
|
+
# * +spec_size+ - optional spec_value size
|
233
|
+
def self.set_program_specialization_constant( program, spec_id, spec_value, spec_size = nil)
|
234
|
+
sz = spec_size
|
235
|
+
sz = spec_value.class.size if sz == nil
|
236
|
+
error = clSetProgramSpecializationConstant( program, spec_id, sz, spec_value )
|
237
|
+
error_check(error)
|
238
|
+
return program
|
239
|
+
end
|
240
|
+
|
206
241
|
# Maps the cl_program object of OpenCL
|
207
242
|
class Program
|
208
243
|
include InnerInterface
|
@@ -437,9 +472,46 @@ module OpenCL
|
|
437
472
|
|
438
473
|
end
|
439
474
|
|
475
|
+
module OpenCL22
|
476
|
+
extend InnerGenerator
|
477
|
+
|
478
|
+
get_info("Program", :cl_bool, "scope_global_ctors_present")
|
479
|
+
get_info("Program", :cl_bool, "scope_global_dtors_present")
|
480
|
+
|
481
|
+
# Attaches a callback to the Program that will be called on program release
|
482
|
+
#
|
483
|
+
# ==== Attributes
|
484
|
+
#
|
485
|
+
# * +options+ - a hash containing named options
|
486
|
+
# * +block+ - if provided, a callback invoked when Program is released. Signature of the callback is { |Pointer to the Program, Pointer to user_data| ... }
|
487
|
+
#
|
488
|
+
# ==== Options
|
489
|
+
#
|
490
|
+
# * +:user_data+ - a Pointer (or convertible to Pointer using to_ptr) to the memory area to pass to the callback
|
491
|
+
def set_release_callback( options = {}, &block )
|
492
|
+
OpenCL.set_program_release_callback( self, options, &block )
|
493
|
+
return self
|
494
|
+
end
|
495
|
+
|
496
|
+
# Sets a specialization constant in a program
|
497
|
+
#
|
498
|
+
# ==== Attributes
|
499
|
+
#
|
500
|
+
# * +program+ - the Program to which constant needs to be set
|
501
|
+
# * +spec_id+ - the id of the specialization constant
|
502
|
+
# * +spec_value+ - value the constant must be set to
|
503
|
+
# * +spec_size+ - optional spec_value size
|
504
|
+
def set_specialization_constant( spec_id, spec_value, spec_size = nil)
|
505
|
+
OpenCL.set_program_specialization_constant( self, spec_id, spec_value, spec_size)
|
506
|
+
return self
|
507
|
+
end
|
508
|
+
|
509
|
+
end
|
510
|
+
|
440
511
|
register_extension( :v12, OpenCL12, "context.platform.version_number >= 1.2" )
|
441
512
|
register_extension( :v20, OpenCL20, "context.platform.version_number >= 2.0" )
|
442
513
|
register_extension( :v21, OpenCL21, "context.platform.version_number >= 2.1" )
|
514
|
+
register_extension( :v22, OpenCL22, "context.platform.version_number >= 2.2" )
|
443
515
|
|
444
516
|
end
|
445
517
|
|
@@ -1,8 +1,10 @@
|
|
1
1
|
module OpenCL
|
2
2
|
# Maps the cl_char type of OpenCL
|
3
3
|
class Char1 < Struct
|
4
|
-
|
5
|
-
|
4
|
+
type = OpenCL.find_type(:cl_char)
|
5
|
+
size = type.size
|
6
|
+
@size = size * 1
|
7
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ) ], size * 1, size * 1 )
|
6
8
|
# 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
9
|
def initialize( s0 = 0 )
|
8
10
|
if s0.is_a?(FFI::Pointer) then
|
@@ -32,8 +34,10 @@ module OpenCL
|
|
32
34
|
Char = OpenCL.find_type(:cl_char)
|
33
35
|
# Maps the cl_uchar type of OpenCL
|
34
36
|
class UChar1 < Struct
|
35
|
-
|
36
|
-
|
37
|
+
type = OpenCL.find_type(:cl_uchar)
|
38
|
+
size = type.size
|
39
|
+
@size = size * 1
|
40
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ) ], size * 1, size * 1 )
|
37
41
|
# 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
42
|
def initialize( s0 = 0 )
|
39
43
|
if s0.is_a?(FFI::Pointer) then
|
@@ -63,8 +67,10 @@ module OpenCL
|
|
63
67
|
UChar = OpenCL.find_type(:cl_uchar)
|
64
68
|
# Maps the cl_short type of OpenCL
|
65
69
|
class Short1 < Struct
|
66
|
-
|
67
|
-
|
70
|
+
type = OpenCL.find_type(:cl_short)
|
71
|
+
size = type.size
|
72
|
+
@size = size * 1
|
73
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ) ], size * 1, size * 1 )
|
68
74
|
# 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
75
|
def initialize( s0 = 0 )
|
70
76
|
if s0.is_a?(FFI::Pointer) then
|
@@ -94,8 +100,10 @@ module OpenCL
|
|
94
100
|
Short = OpenCL.find_type(:cl_short)
|
95
101
|
# Maps the cl_ushort type of OpenCL
|
96
102
|
class UShort1 < Struct
|
97
|
-
|
98
|
-
|
103
|
+
type = OpenCL.find_type(:cl_ushort)
|
104
|
+
size = type.size
|
105
|
+
@size = size * 1
|
106
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ) ], size * 1, size * 1 )
|
99
107
|
# 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
108
|
def initialize( s0 = 0 )
|
101
109
|
if s0.is_a?(FFI::Pointer) then
|
@@ -125,8 +133,10 @@ module OpenCL
|
|
125
133
|
UShort = OpenCL.find_type(:cl_ushort)
|
126
134
|
# Maps the cl_int type of OpenCL
|
127
135
|
class Int1 < Struct
|
128
|
-
|
129
|
-
|
136
|
+
type = OpenCL.find_type(:cl_int)
|
137
|
+
size = type.size
|
138
|
+
@size = size * 1
|
139
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ) ], size * 1, size * 1 )
|
130
140
|
# 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
141
|
def initialize( s0 = 0 )
|
132
142
|
if s0.is_a?(FFI::Pointer) then
|
@@ -156,8 +166,10 @@ module OpenCL
|
|
156
166
|
Int = OpenCL.find_type(:cl_int)
|
157
167
|
# Maps the cl_uint type of OpenCL
|
158
168
|
class UInt1 < Struct
|
159
|
-
|
160
|
-
|
169
|
+
type = OpenCL.find_type(:cl_uint)
|
170
|
+
size = type.size
|
171
|
+
@size = size * 1
|
172
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ) ], size * 1, size * 1 )
|
161
173
|
# 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
174
|
def initialize( s0 = 0 )
|
163
175
|
if s0.is_a?(FFI::Pointer) then
|
@@ -187,8 +199,10 @@ module OpenCL
|
|
187
199
|
UInt = OpenCL.find_type(:cl_uint)
|
188
200
|
# Maps the cl_long type of OpenCL
|
189
201
|
class Long1 < Struct
|
190
|
-
|
191
|
-
|
202
|
+
type = OpenCL.find_type(:cl_long)
|
203
|
+
size = type.size
|
204
|
+
@size = size * 1
|
205
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ) ], size * 1, size * 1 )
|
192
206
|
# 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
207
|
def initialize( s0 = 0 )
|
194
208
|
if s0.is_a?(FFI::Pointer) then
|
@@ -218,8 +232,10 @@ module OpenCL
|
|
218
232
|
Long = OpenCL.find_type(:cl_long)
|
219
233
|
# Maps the cl_ulong type of OpenCL
|
220
234
|
class ULong1 < Struct
|
221
|
-
|
222
|
-
|
235
|
+
type = OpenCL.find_type(:cl_ulong)
|
236
|
+
size = type.size
|
237
|
+
@size = size * 1
|
238
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ) ], size * 1, size * 1 )
|
223
239
|
# 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
240
|
def initialize( s0 = 0 )
|
225
241
|
if s0.is_a?(FFI::Pointer) then
|
@@ -249,8 +265,10 @@ module OpenCL
|
|
249
265
|
ULong = OpenCL.find_type(:cl_ulong)
|
250
266
|
# Maps the cl_float type of OpenCL
|
251
267
|
class Float1 < Struct
|
252
|
-
|
253
|
-
|
268
|
+
type = OpenCL.find_type(:cl_float)
|
269
|
+
size = type.size
|
270
|
+
@size = size * 1
|
271
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ) ], size * 1, size * 1 )
|
254
272
|
# 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
273
|
def initialize( s0 = 0.0 )
|
256
274
|
if s0.is_a?(FFI::Pointer) then
|
@@ -280,8 +298,10 @@ module OpenCL
|
|
280
298
|
Float = OpenCL.find_type(:cl_float)
|
281
299
|
# Maps the cl_double type of OpenCL
|
282
300
|
class Double1 < Struct
|
283
|
-
|
284
|
-
|
301
|
+
type = OpenCL.find_type(:cl_double)
|
302
|
+
size = type.size
|
303
|
+
@size = size * 1
|
304
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ) ], size * 1, size * 1 )
|
285
305
|
# 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
306
|
def initialize( s0 = 0.0 )
|
287
307
|
if s0.is_a?(FFI::Pointer) then
|
@@ -311,8 +331,10 @@ module OpenCL
|
|
311
331
|
Double = OpenCL.find_type(:cl_double)
|
312
332
|
# Maps the cl_half type of OpenCL
|
313
333
|
class Half1 < Struct
|
314
|
-
|
315
|
-
|
334
|
+
type = OpenCL.find_type(:cl_half)
|
335
|
+
size = type.size
|
336
|
+
@size = size * 1
|
337
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ) ], size * 1, size * 1 )
|
316
338
|
# 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
339
|
def initialize( s0 = 0.0 )
|
318
340
|
if s0.is_a?(FFI::Pointer) then
|
@@ -342,8 +364,10 @@ module OpenCL
|
|
342
364
|
Half = OpenCL.find_type(:cl_half)
|
343
365
|
# Maps the cl_char2 type of OpenCL
|
344
366
|
class Char2 < Struct
|
345
|
-
|
346
|
-
|
367
|
+
type = OpenCL.find_type(:cl_char)
|
368
|
+
size = type.size
|
369
|
+
@size = size * 2
|
370
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ) ], size * 2, size * 2 )
|
347
371
|
# Creates a new Char2 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Char2 maps the memory pointed.
|
348
372
|
def initialize( s0 = 0, s1 = 0 )
|
349
373
|
if s0.is_a?(FFI::Pointer) then
|
@@ -381,8 +405,10 @@ module OpenCL
|
|
381
405
|
end
|
382
406
|
# Maps the cl_uchar2 type of OpenCL
|
383
407
|
class UChar2 < Struct
|
384
|
-
|
385
|
-
|
408
|
+
type = OpenCL.find_type(:cl_uchar)
|
409
|
+
size = type.size
|
410
|
+
@size = size * 2
|
411
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ) ], size * 2, size * 2 )
|
386
412
|
# Creates a new UChar2 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, UChar2 maps the memory pointed.
|
387
413
|
def initialize( s0 = 0, s1 = 0 )
|
388
414
|
if s0.is_a?(FFI::Pointer) then
|
@@ -420,8 +446,10 @@ module OpenCL
|
|
420
446
|
end
|
421
447
|
# Maps the cl_short2 type of OpenCL
|
422
448
|
class Short2 < Struct
|
423
|
-
|
424
|
-
|
449
|
+
type = OpenCL.find_type(:cl_short)
|
450
|
+
size = type.size
|
451
|
+
@size = size * 2
|
452
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ) ], size * 2, size * 2 )
|
425
453
|
# Creates a new Short2 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Short2 maps the memory pointed.
|
426
454
|
def initialize( s0 = 0, s1 = 0 )
|
427
455
|
if s0.is_a?(FFI::Pointer) then
|
@@ -459,8 +487,10 @@ module OpenCL
|
|
459
487
|
end
|
460
488
|
# Maps the cl_ushort2 type of OpenCL
|
461
489
|
class UShort2 < Struct
|
462
|
-
|
463
|
-
|
490
|
+
type = OpenCL.find_type(:cl_ushort)
|
491
|
+
size = type.size
|
492
|
+
@size = size * 2
|
493
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ) ], size * 2, size * 2 )
|
464
494
|
# Creates a new UShort2 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, UShort2 maps the memory pointed.
|
465
495
|
def initialize( s0 = 0, s1 = 0 )
|
466
496
|
if s0.is_a?(FFI::Pointer) then
|
@@ -498,8 +528,10 @@ module OpenCL
|
|
498
528
|
end
|
499
529
|
# Maps the cl_int2 type of OpenCL
|
500
530
|
class Int2 < Struct
|
501
|
-
|
502
|
-
|
531
|
+
type = OpenCL.find_type(:cl_int)
|
532
|
+
size = type.size
|
533
|
+
@size = size * 2
|
534
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ) ], size * 2, size * 2 )
|
503
535
|
# Creates a new Int2 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Int2 maps the memory pointed.
|
504
536
|
def initialize( s0 = 0, s1 = 0 )
|
505
537
|
if s0.is_a?(FFI::Pointer) then
|
@@ -537,8 +569,10 @@ module OpenCL
|
|
537
569
|
end
|
538
570
|
# Maps the cl_uint2 type of OpenCL
|
539
571
|
class UInt2 < Struct
|
540
|
-
|
541
|
-
|
572
|
+
type = OpenCL.find_type(:cl_uint)
|
573
|
+
size = type.size
|
574
|
+
@size = size * 2
|
575
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ) ], size * 2, size * 2 )
|
542
576
|
# Creates a new UInt2 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, UInt2 maps the memory pointed.
|
543
577
|
def initialize( s0 = 0, s1 = 0 )
|
544
578
|
if s0.is_a?(FFI::Pointer) then
|
@@ -576,8 +610,10 @@ module OpenCL
|
|
576
610
|
end
|
577
611
|
# Maps the cl_long2 type of OpenCL
|
578
612
|
class Long2 < Struct
|
579
|
-
|
580
|
-
|
613
|
+
type = OpenCL.find_type(:cl_long)
|
614
|
+
size = type.size
|
615
|
+
@size = size * 2
|
616
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ) ], size * 2, size * 2 )
|
581
617
|
# Creates a new Long2 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Long2 maps the memory pointed.
|
582
618
|
def initialize( s0 = 0, s1 = 0 )
|
583
619
|
if s0.is_a?(FFI::Pointer) then
|
@@ -615,8 +651,10 @@ module OpenCL
|
|
615
651
|
end
|
616
652
|
# Maps the cl_ulong2 type of OpenCL
|
617
653
|
class ULong2 < Struct
|
618
|
-
|
619
|
-
|
654
|
+
type = OpenCL.find_type(:cl_ulong)
|
655
|
+
size = type.size
|
656
|
+
@size = size * 2
|
657
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ) ], size * 2, size * 2 )
|
620
658
|
# Creates a new ULong2 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, ULong2 maps the memory pointed.
|
621
659
|
def initialize( s0 = 0, s1 = 0 )
|
622
660
|
if s0.is_a?(FFI::Pointer) then
|
@@ -654,8 +692,10 @@ module OpenCL
|
|
654
692
|
end
|
655
693
|
# Maps the cl_float2 type of OpenCL
|
656
694
|
class Float2 < Struct
|
657
|
-
|
658
|
-
|
695
|
+
type = OpenCL.find_type(:cl_float)
|
696
|
+
size = type.size
|
697
|
+
@size = size * 2
|
698
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ) ], size * 2, size * 2 )
|
659
699
|
# Creates a new Float2 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Float2 maps the memory pointed.
|
660
700
|
def initialize( s0 = 0.0, s1 = 0.0 )
|
661
701
|
if s0.is_a?(FFI::Pointer) then
|
@@ -693,8 +733,10 @@ module OpenCL
|
|
693
733
|
end
|
694
734
|
# Maps the cl_double2 type of OpenCL
|
695
735
|
class Double2 < Struct
|
696
|
-
|
697
|
-
|
736
|
+
type = OpenCL.find_type(:cl_double)
|
737
|
+
size = type.size
|
738
|
+
@size = size * 2
|
739
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ) ], size * 2, size * 2 )
|
698
740
|
# Creates a new Double2 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Double2 maps the memory pointed.
|
699
741
|
def initialize( s0 = 0.0, s1 = 0.0 )
|
700
742
|
if s0.is_a?(FFI::Pointer) then
|
@@ -732,8 +774,10 @@ module OpenCL
|
|
732
774
|
end
|
733
775
|
# Maps the cl_half2 type of OpenCL
|
734
776
|
class Half2 < Struct
|
735
|
-
|
736
|
-
|
777
|
+
type = OpenCL.find_type(:cl_half)
|
778
|
+
size = type.size
|
779
|
+
@size = size * 2
|
780
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ) ], size * 2, size * 2 )
|
737
781
|
# Creates a new Half2 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Half2 maps the memory pointed.
|
738
782
|
def initialize( s0 = 0.0, s1 = 0.0 )
|
739
783
|
if s0.is_a?(FFI::Pointer) then
|
@@ -771,8 +815,10 @@ module OpenCL
|
|
771
815
|
end
|
772
816
|
# Maps the cl_char4 type of OpenCL
|
773
817
|
class Char4 < Struct
|
774
|
-
|
775
|
-
|
818
|
+
type = OpenCL.find_type(:cl_char)
|
819
|
+
size = type.size
|
820
|
+
@size = size * 4
|
821
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ) ], size * 4, size * 4 )
|
776
822
|
# Creates a new Char4 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Char4 maps the memory pointed.
|
777
823
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )
|
778
824
|
if s0.is_a?(FFI::Pointer) then
|
@@ -828,8 +874,10 @@ module OpenCL
|
|
828
874
|
end
|
829
875
|
# Maps the cl_uchar4 type of OpenCL
|
830
876
|
class UChar4 < Struct
|
831
|
-
|
832
|
-
|
877
|
+
type = OpenCL.find_type(:cl_uchar)
|
878
|
+
size = type.size
|
879
|
+
@size = size * 4
|
880
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ) ], size * 4, size * 4 )
|
833
881
|
# Creates a new UChar4 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, UChar4 maps the memory pointed.
|
834
882
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )
|
835
883
|
if s0.is_a?(FFI::Pointer) then
|
@@ -885,8 +933,10 @@ module OpenCL
|
|
885
933
|
end
|
886
934
|
# Maps the cl_short4 type of OpenCL
|
887
935
|
class Short4 < Struct
|
888
|
-
|
889
|
-
|
936
|
+
type = OpenCL.find_type(:cl_short)
|
937
|
+
size = type.size
|
938
|
+
@size = size * 4
|
939
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ) ], size * 4, size * 4 )
|
890
940
|
# Creates a new Short4 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Short4 maps the memory pointed.
|
891
941
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )
|
892
942
|
if s0.is_a?(FFI::Pointer) then
|
@@ -942,8 +992,10 @@ module OpenCL
|
|
942
992
|
end
|
943
993
|
# Maps the cl_ushort4 type of OpenCL
|
944
994
|
class UShort4 < Struct
|
945
|
-
|
946
|
-
|
995
|
+
type = OpenCL.find_type(:cl_ushort)
|
996
|
+
size = type.size
|
997
|
+
@size = size * 4
|
998
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ) ], size * 4, size * 4 )
|
947
999
|
# Creates a new UShort4 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, UShort4 maps the memory pointed.
|
948
1000
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )
|
949
1001
|
if s0.is_a?(FFI::Pointer) then
|
@@ -999,8 +1051,10 @@ module OpenCL
|
|
999
1051
|
end
|
1000
1052
|
# Maps the cl_int4 type of OpenCL
|
1001
1053
|
class Int4 < Struct
|
1002
|
-
|
1003
|
-
|
1054
|
+
type = OpenCL.find_type(:cl_int)
|
1055
|
+
size = type.size
|
1056
|
+
@size = size * 4
|
1057
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ) ], size * 4, size * 4 )
|
1004
1058
|
# Creates a new Int4 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Int4 maps the memory pointed.
|
1005
1059
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )
|
1006
1060
|
if s0.is_a?(FFI::Pointer) then
|
@@ -1056,8 +1110,10 @@ module OpenCL
|
|
1056
1110
|
end
|
1057
1111
|
# Maps the cl_uint4 type of OpenCL
|
1058
1112
|
class UInt4 < Struct
|
1059
|
-
|
1060
|
-
|
1113
|
+
type = OpenCL.find_type(:cl_uint)
|
1114
|
+
size = type.size
|
1115
|
+
@size = size * 4
|
1116
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ) ], size * 4, size * 4 )
|
1061
1117
|
# Creates a new UInt4 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, UInt4 maps the memory pointed.
|
1062
1118
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )
|
1063
1119
|
if s0.is_a?(FFI::Pointer) then
|
@@ -1113,8 +1169,10 @@ module OpenCL
|
|
1113
1169
|
end
|
1114
1170
|
# Maps the cl_long4 type of OpenCL
|
1115
1171
|
class Long4 < Struct
|
1116
|
-
|
1117
|
-
|
1172
|
+
type = OpenCL.find_type(:cl_long)
|
1173
|
+
size = type.size
|
1174
|
+
@size = size * 4
|
1175
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ) ], size * 4, size * 4 )
|
1118
1176
|
# Creates a new Long4 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Long4 maps the memory pointed.
|
1119
1177
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )
|
1120
1178
|
if s0.is_a?(FFI::Pointer) then
|
@@ -1170,8 +1228,10 @@ module OpenCL
|
|
1170
1228
|
end
|
1171
1229
|
# Maps the cl_ulong4 type of OpenCL
|
1172
1230
|
class ULong4 < Struct
|
1173
|
-
|
1174
|
-
|
1231
|
+
type = OpenCL.find_type(:cl_ulong)
|
1232
|
+
size = type.size
|
1233
|
+
@size = size * 4
|
1234
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ) ], size * 4, size * 4 )
|
1175
1235
|
# Creates a new ULong4 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, ULong4 maps the memory pointed.
|
1176
1236
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )
|
1177
1237
|
if s0.is_a?(FFI::Pointer) then
|
@@ -1227,8 +1287,10 @@ module OpenCL
|
|
1227
1287
|
end
|
1228
1288
|
# Maps the cl_float4 type of OpenCL
|
1229
1289
|
class Float4 < Struct
|
1230
|
-
|
1231
|
-
|
1290
|
+
type = OpenCL.find_type(:cl_float)
|
1291
|
+
size = type.size
|
1292
|
+
@size = size * 4
|
1293
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ) ], size * 4, size * 4 )
|
1232
1294
|
# Creates a new Float4 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Float4 maps the memory pointed.
|
1233
1295
|
def initialize( s0 = 0.0, s1 = 0.0, s2 = 0.0, s3 = 0.0 )
|
1234
1296
|
if s0.is_a?(FFI::Pointer) then
|
@@ -1284,8 +1346,10 @@ module OpenCL
|
|
1284
1346
|
end
|
1285
1347
|
# Maps the cl_double4 type of OpenCL
|
1286
1348
|
class Double4 < Struct
|
1287
|
-
|
1288
|
-
|
1349
|
+
type = OpenCL.find_type(:cl_double)
|
1350
|
+
size = type.size
|
1351
|
+
@size = size * 4
|
1352
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ) ], size * 4, size * 4 )
|
1289
1353
|
# Creates a new Double4 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Double4 maps the memory pointed.
|
1290
1354
|
def initialize( s0 = 0.0, s1 = 0.0, s2 = 0.0, s3 = 0.0 )
|
1291
1355
|
if s0.is_a?(FFI::Pointer) then
|
@@ -1341,8 +1405,10 @@ module OpenCL
|
|
1341
1405
|
end
|
1342
1406
|
# Maps the cl_half4 type of OpenCL
|
1343
1407
|
class Half4 < Struct
|
1344
|
-
|
1345
|
-
|
1408
|
+
type = OpenCL.find_type(:cl_half)
|
1409
|
+
size = type.size
|
1410
|
+
@size = size * 4
|
1411
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ) ], size * 4, size * 4 )
|
1346
1412
|
# Creates a new Half4 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Half4 maps the memory pointed.
|
1347
1413
|
def initialize( s0 = 0.0, s1 = 0.0, s2 = 0.0, s3 = 0.0 )
|
1348
1414
|
if s0.is_a?(FFI::Pointer) then
|
@@ -1398,8 +1464,10 @@ module OpenCL
|
|
1398
1464
|
end
|
1399
1465
|
# Maps the cl_char8 type of OpenCL
|
1400
1466
|
class Char8 < Struct
|
1401
|
-
|
1402
|
-
|
1467
|
+
type = OpenCL.find_type(:cl_char)
|
1468
|
+
size = type.size
|
1469
|
+
@size = size * 8
|
1470
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ) ], size * 8, size * 8 )
|
1403
1471
|
# Creates a new Char8 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Char8 maps the memory pointed.
|
1404
1472
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0 )
|
1405
1473
|
if s0.is_a?(FFI::Pointer) then
|
@@ -1491,8 +1559,10 @@ module OpenCL
|
|
1491
1559
|
end
|
1492
1560
|
# Maps the cl_uchar8 type of OpenCL
|
1493
1561
|
class UChar8 < Struct
|
1494
|
-
|
1495
|
-
|
1562
|
+
type = OpenCL.find_type(:cl_uchar)
|
1563
|
+
size = type.size
|
1564
|
+
@size = size * 8
|
1565
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ) ], size * 8, size * 8 )
|
1496
1566
|
# Creates a new UChar8 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, UChar8 maps the memory pointed.
|
1497
1567
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0 )
|
1498
1568
|
if s0.is_a?(FFI::Pointer) then
|
@@ -1584,8 +1654,10 @@ module OpenCL
|
|
1584
1654
|
end
|
1585
1655
|
# Maps the cl_short8 type of OpenCL
|
1586
1656
|
class Short8 < Struct
|
1587
|
-
|
1588
|
-
|
1657
|
+
type = OpenCL.find_type(:cl_short)
|
1658
|
+
size = type.size
|
1659
|
+
@size = size * 8
|
1660
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ) ], size * 8, size * 8 )
|
1589
1661
|
# Creates a new Short8 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Short8 maps the memory pointed.
|
1590
1662
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0 )
|
1591
1663
|
if s0.is_a?(FFI::Pointer) then
|
@@ -1677,8 +1749,10 @@ module OpenCL
|
|
1677
1749
|
end
|
1678
1750
|
# Maps the cl_ushort8 type of OpenCL
|
1679
1751
|
class UShort8 < Struct
|
1680
|
-
|
1681
|
-
|
1752
|
+
type = OpenCL.find_type(:cl_ushort)
|
1753
|
+
size = type.size
|
1754
|
+
@size = size * 8
|
1755
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ) ], size * 8, size * 8 )
|
1682
1756
|
# Creates a new UShort8 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, UShort8 maps the memory pointed.
|
1683
1757
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0 )
|
1684
1758
|
if s0.is_a?(FFI::Pointer) then
|
@@ -1770,8 +1844,10 @@ module OpenCL
|
|
1770
1844
|
end
|
1771
1845
|
# Maps the cl_int8 type of OpenCL
|
1772
1846
|
class Int8 < Struct
|
1773
|
-
|
1774
|
-
|
1847
|
+
type = OpenCL.find_type(:cl_int)
|
1848
|
+
size = type.size
|
1849
|
+
@size = size * 8
|
1850
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ) ], size * 8, size * 8 )
|
1775
1851
|
# Creates a new Int8 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Int8 maps the memory pointed.
|
1776
1852
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0 )
|
1777
1853
|
if s0.is_a?(FFI::Pointer) then
|
@@ -1863,8 +1939,10 @@ module OpenCL
|
|
1863
1939
|
end
|
1864
1940
|
# Maps the cl_uint8 type of OpenCL
|
1865
1941
|
class UInt8 < Struct
|
1866
|
-
|
1867
|
-
|
1942
|
+
type = OpenCL.find_type(:cl_uint)
|
1943
|
+
size = type.size
|
1944
|
+
@size = size * 8
|
1945
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ) ], size * 8, size * 8 )
|
1868
1946
|
# Creates a new UInt8 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, UInt8 maps the memory pointed.
|
1869
1947
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0 )
|
1870
1948
|
if s0.is_a?(FFI::Pointer) then
|
@@ -1956,8 +2034,10 @@ module OpenCL
|
|
1956
2034
|
end
|
1957
2035
|
# Maps the cl_long8 type of OpenCL
|
1958
2036
|
class Long8 < Struct
|
1959
|
-
|
1960
|
-
|
2037
|
+
type = OpenCL.find_type(:cl_long)
|
2038
|
+
size = type.size
|
2039
|
+
@size = size * 8
|
2040
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ) ], size * 8, size * 8 )
|
1961
2041
|
# Creates a new Long8 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Long8 maps the memory pointed.
|
1962
2042
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0 )
|
1963
2043
|
if s0.is_a?(FFI::Pointer) then
|
@@ -2049,8 +2129,10 @@ module OpenCL
|
|
2049
2129
|
end
|
2050
2130
|
# Maps the cl_ulong8 type of OpenCL
|
2051
2131
|
class ULong8 < Struct
|
2052
|
-
|
2053
|
-
|
2132
|
+
type = OpenCL.find_type(:cl_ulong)
|
2133
|
+
size = type.size
|
2134
|
+
@size = size * 8
|
2135
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ) ], size * 8, size * 8 )
|
2054
2136
|
# Creates a new ULong8 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, ULong8 maps the memory pointed.
|
2055
2137
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0 )
|
2056
2138
|
if s0.is_a?(FFI::Pointer) then
|
@@ -2142,8 +2224,10 @@ module OpenCL
|
|
2142
2224
|
end
|
2143
2225
|
# Maps the cl_float8 type of OpenCL
|
2144
2226
|
class Float8 < Struct
|
2145
|
-
|
2146
|
-
|
2227
|
+
type = OpenCL.find_type(:cl_float)
|
2228
|
+
size = type.size
|
2229
|
+
@size = size * 8
|
2230
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ) ], size * 8, size * 8 )
|
2147
2231
|
# Creates a new Float8 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Float8 maps the memory pointed.
|
2148
2232
|
def initialize( s0 = 0.0, s1 = 0.0, s2 = 0.0, s3 = 0.0, s4 = 0.0, s5 = 0.0, s6 = 0.0, s7 = 0.0 )
|
2149
2233
|
if s0.is_a?(FFI::Pointer) then
|
@@ -2235,8 +2319,10 @@ module OpenCL
|
|
2235
2319
|
end
|
2236
2320
|
# Maps the cl_double8 type of OpenCL
|
2237
2321
|
class Double8 < Struct
|
2238
|
-
|
2239
|
-
|
2322
|
+
type = OpenCL.find_type(:cl_double)
|
2323
|
+
size = type.size
|
2324
|
+
@size = size * 8
|
2325
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ) ], size * 8, size * 8 )
|
2240
2326
|
# Creates a new Double8 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Double8 maps the memory pointed.
|
2241
2327
|
def initialize( s0 = 0.0, s1 = 0.0, s2 = 0.0, s3 = 0.0, s4 = 0.0, s5 = 0.0, s6 = 0.0, s7 = 0.0 )
|
2242
2328
|
if s0.is_a?(FFI::Pointer) then
|
@@ -2328,8 +2414,10 @@ module OpenCL
|
|
2328
2414
|
end
|
2329
2415
|
# Maps the cl_half8 type of OpenCL
|
2330
2416
|
class Half8 < Struct
|
2331
|
-
|
2332
|
-
|
2417
|
+
type = OpenCL.find_type(:cl_half)
|
2418
|
+
size = type.size
|
2419
|
+
@size = size * 8
|
2420
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ) ], size * 8, size * 8 )
|
2333
2421
|
# Creates a new Half8 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Half8 maps the memory pointed.
|
2334
2422
|
def initialize( s0 = 0.0, s1 = 0.0, s2 = 0.0, s3 = 0.0, s4 = 0.0, s5 = 0.0, s6 = 0.0, s7 = 0.0 )
|
2335
2423
|
if s0.is_a?(FFI::Pointer) then
|
@@ -2421,8 +2509,10 @@ module OpenCL
|
|
2421
2509
|
end
|
2422
2510
|
# Maps the cl_char16 type of OpenCL
|
2423
2511
|
class Char16 < Struct
|
2424
|
-
|
2425
|
-
|
2512
|
+
type = OpenCL.find_type(:cl_char)
|
2513
|
+
size = type.size
|
2514
|
+
@size = size * 16
|
2515
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ), OpenCL::StructLayout::Field::new( "s8", size * 8, type ), OpenCL::StructLayout::Field::new( "s9", size * 9, type ), OpenCL::StructLayout::Field::new( "sa", size * 10, type ), OpenCL::StructLayout::Field::new( "sb", size * 11, type ), OpenCL::StructLayout::Field::new( "sc", size * 12, type ), OpenCL::StructLayout::Field::new( "sd", size * 13, type ), OpenCL::StructLayout::Field::new( "se", size * 14, type ), OpenCL::StructLayout::Field::new( "sf", size * 15, type ) ], size * 16, size * 16 )
|
2426
2516
|
# Creates a new Char16 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Char16 maps the memory pointed.
|
2427
2517
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0, s8 = 0, s9 = 0, sa = 0, sb = 0, sc = 0, sd = 0, se = 0, sf = 0 )
|
2428
2518
|
if s0.is_a?(FFI::Pointer) then
|
@@ -2586,8 +2676,10 @@ module OpenCL
|
|
2586
2676
|
end
|
2587
2677
|
# Maps the cl_uchar16 type of OpenCL
|
2588
2678
|
class UChar16 < Struct
|
2589
|
-
|
2590
|
-
|
2679
|
+
type = OpenCL.find_type(:cl_uchar)
|
2680
|
+
size = type.size
|
2681
|
+
@size = size * 16
|
2682
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ), OpenCL::StructLayout::Field::new( "s8", size * 8, type ), OpenCL::StructLayout::Field::new( "s9", size * 9, type ), OpenCL::StructLayout::Field::new( "sa", size * 10, type ), OpenCL::StructLayout::Field::new( "sb", size * 11, type ), OpenCL::StructLayout::Field::new( "sc", size * 12, type ), OpenCL::StructLayout::Field::new( "sd", size * 13, type ), OpenCL::StructLayout::Field::new( "se", size * 14, type ), OpenCL::StructLayout::Field::new( "sf", size * 15, type ) ], size * 16, size * 16 )
|
2591
2683
|
# Creates a new UChar16 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, UChar16 maps the memory pointed.
|
2592
2684
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0, s8 = 0, s9 = 0, sa = 0, sb = 0, sc = 0, sd = 0, se = 0, sf = 0 )
|
2593
2685
|
if s0.is_a?(FFI::Pointer) then
|
@@ -2751,8 +2843,10 @@ module OpenCL
|
|
2751
2843
|
end
|
2752
2844
|
# Maps the cl_short16 type of OpenCL
|
2753
2845
|
class Short16 < Struct
|
2754
|
-
|
2755
|
-
|
2846
|
+
type = OpenCL.find_type(:cl_short)
|
2847
|
+
size = type.size
|
2848
|
+
@size = size * 16
|
2849
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ), OpenCL::StructLayout::Field::new( "s8", size * 8, type ), OpenCL::StructLayout::Field::new( "s9", size * 9, type ), OpenCL::StructLayout::Field::new( "sa", size * 10, type ), OpenCL::StructLayout::Field::new( "sb", size * 11, type ), OpenCL::StructLayout::Field::new( "sc", size * 12, type ), OpenCL::StructLayout::Field::new( "sd", size * 13, type ), OpenCL::StructLayout::Field::new( "se", size * 14, type ), OpenCL::StructLayout::Field::new( "sf", size * 15, type ) ], size * 16, size * 16 )
|
2756
2850
|
# Creates a new Short16 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Short16 maps the memory pointed.
|
2757
2851
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0, s8 = 0, s9 = 0, sa = 0, sb = 0, sc = 0, sd = 0, se = 0, sf = 0 )
|
2758
2852
|
if s0.is_a?(FFI::Pointer) then
|
@@ -2916,8 +3010,10 @@ module OpenCL
|
|
2916
3010
|
end
|
2917
3011
|
# Maps the cl_ushort16 type of OpenCL
|
2918
3012
|
class UShort16 < Struct
|
2919
|
-
|
2920
|
-
|
3013
|
+
type = OpenCL.find_type(:cl_ushort)
|
3014
|
+
size = type.size
|
3015
|
+
@size = size * 16
|
3016
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ), OpenCL::StructLayout::Field::new( "s8", size * 8, type ), OpenCL::StructLayout::Field::new( "s9", size * 9, type ), OpenCL::StructLayout::Field::new( "sa", size * 10, type ), OpenCL::StructLayout::Field::new( "sb", size * 11, type ), OpenCL::StructLayout::Field::new( "sc", size * 12, type ), OpenCL::StructLayout::Field::new( "sd", size * 13, type ), OpenCL::StructLayout::Field::new( "se", size * 14, type ), OpenCL::StructLayout::Field::new( "sf", size * 15, type ) ], size * 16, size * 16 )
|
2921
3017
|
# Creates a new UShort16 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, UShort16 maps the memory pointed.
|
2922
3018
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0, s8 = 0, s9 = 0, sa = 0, sb = 0, sc = 0, sd = 0, se = 0, sf = 0 )
|
2923
3019
|
if s0.is_a?(FFI::Pointer) then
|
@@ -3081,8 +3177,10 @@ module OpenCL
|
|
3081
3177
|
end
|
3082
3178
|
# Maps the cl_int16 type of OpenCL
|
3083
3179
|
class Int16 < Struct
|
3084
|
-
|
3085
|
-
|
3180
|
+
type = OpenCL.find_type(:cl_int)
|
3181
|
+
size = type.size
|
3182
|
+
@size = size * 16
|
3183
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ), OpenCL::StructLayout::Field::new( "s8", size * 8, type ), OpenCL::StructLayout::Field::new( "s9", size * 9, type ), OpenCL::StructLayout::Field::new( "sa", size * 10, type ), OpenCL::StructLayout::Field::new( "sb", size * 11, type ), OpenCL::StructLayout::Field::new( "sc", size * 12, type ), OpenCL::StructLayout::Field::new( "sd", size * 13, type ), OpenCL::StructLayout::Field::new( "se", size * 14, type ), OpenCL::StructLayout::Field::new( "sf", size * 15, type ) ], size * 16, size * 16 )
|
3086
3184
|
# Creates a new Int16 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Int16 maps the memory pointed.
|
3087
3185
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0, s8 = 0, s9 = 0, sa = 0, sb = 0, sc = 0, sd = 0, se = 0, sf = 0 )
|
3088
3186
|
if s0.is_a?(FFI::Pointer) then
|
@@ -3246,8 +3344,10 @@ module OpenCL
|
|
3246
3344
|
end
|
3247
3345
|
# Maps the cl_uint16 type of OpenCL
|
3248
3346
|
class UInt16 < Struct
|
3249
|
-
|
3250
|
-
|
3347
|
+
type = OpenCL.find_type(:cl_uint)
|
3348
|
+
size = type.size
|
3349
|
+
@size = size * 16
|
3350
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ), OpenCL::StructLayout::Field::new( "s8", size * 8, type ), OpenCL::StructLayout::Field::new( "s9", size * 9, type ), OpenCL::StructLayout::Field::new( "sa", size * 10, type ), OpenCL::StructLayout::Field::new( "sb", size * 11, type ), OpenCL::StructLayout::Field::new( "sc", size * 12, type ), OpenCL::StructLayout::Field::new( "sd", size * 13, type ), OpenCL::StructLayout::Field::new( "se", size * 14, type ), OpenCL::StructLayout::Field::new( "sf", size * 15, type ) ], size * 16, size * 16 )
|
3251
3351
|
# Creates a new UInt16 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, UInt16 maps the memory pointed.
|
3252
3352
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0, s8 = 0, s9 = 0, sa = 0, sb = 0, sc = 0, sd = 0, se = 0, sf = 0 )
|
3253
3353
|
if s0.is_a?(FFI::Pointer) then
|
@@ -3411,8 +3511,10 @@ module OpenCL
|
|
3411
3511
|
end
|
3412
3512
|
# Maps the cl_long16 type of OpenCL
|
3413
3513
|
class Long16 < Struct
|
3414
|
-
|
3415
|
-
|
3514
|
+
type = OpenCL.find_type(:cl_long)
|
3515
|
+
size = type.size
|
3516
|
+
@size = size * 16
|
3517
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ), OpenCL::StructLayout::Field::new( "s8", size * 8, type ), OpenCL::StructLayout::Field::new( "s9", size * 9, type ), OpenCL::StructLayout::Field::new( "sa", size * 10, type ), OpenCL::StructLayout::Field::new( "sb", size * 11, type ), OpenCL::StructLayout::Field::new( "sc", size * 12, type ), OpenCL::StructLayout::Field::new( "sd", size * 13, type ), OpenCL::StructLayout::Field::new( "se", size * 14, type ), OpenCL::StructLayout::Field::new( "sf", size * 15, type ) ], size * 16, size * 16 )
|
3416
3518
|
# Creates a new Long16 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Long16 maps the memory pointed.
|
3417
3519
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0, s8 = 0, s9 = 0, sa = 0, sb = 0, sc = 0, sd = 0, se = 0, sf = 0 )
|
3418
3520
|
if s0.is_a?(FFI::Pointer) then
|
@@ -3576,8 +3678,10 @@ module OpenCL
|
|
3576
3678
|
end
|
3577
3679
|
# Maps the cl_ulong16 type of OpenCL
|
3578
3680
|
class ULong16 < Struct
|
3579
|
-
|
3580
|
-
|
3681
|
+
type = OpenCL.find_type(:cl_ulong)
|
3682
|
+
size = type.size
|
3683
|
+
@size = size * 16
|
3684
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ), OpenCL::StructLayout::Field::new( "s8", size * 8, type ), OpenCL::StructLayout::Field::new( "s9", size * 9, type ), OpenCL::StructLayout::Field::new( "sa", size * 10, type ), OpenCL::StructLayout::Field::new( "sb", size * 11, type ), OpenCL::StructLayout::Field::new( "sc", size * 12, type ), OpenCL::StructLayout::Field::new( "sd", size * 13, type ), OpenCL::StructLayout::Field::new( "se", size * 14, type ), OpenCL::StructLayout::Field::new( "sf", size * 15, type ) ], size * 16, size * 16 )
|
3581
3685
|
# Creates a new ULong16 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, ULong16 maps the memory pointed.
|
3582
3686
|
def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0, s8 = 0, s9 = 0, sa = 0, sb = 0, sc = 0, sd = 0, se = 0, sf = 0 )
|
3583
3687
|
if s0.is_a?(FFI::Pointer) then
|
@@ -3741,8 +3845,10 @@ module OpenCL
|
|
3741
3845
|
end
|
3742
3846
|
# Maps the cl_float16 type of OpenCL
|
3743
3847
|
class Float16 < Struct
|
3744
|
-
|
3745
|
-
|
3848
|
+
type = OpenCL.find_type(:cl_float)
|
3849
|
+
size = type.size
|
3850
|
+
@size = size * 16
|
3851
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ), OpenCL::StructLayout::Field::new( "s8", size * 8, type ), OpenCL::StructLayout::Field::new( "s9", size * 9, type ), OpenCL::StructLayout::Field::new( "sa", size * 10, type ), OpenCL::StructLayout::Field::new( "sb", size * 11, type ), OpenCL::StructLayout::Field::new( "sc", size * 12, type ), OpenCL::StructLayout::Field::new( "sd", size * 13, type ), OpenCL::StructLayout::Field::new( "se", size * 14, type ), OpenCL::StructLayout::Field::new( "sf", size * 15, type ) ], size * 16, size * 16 )
|
3746
3852
|
# Creates a new Float16 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Float16 maps the memory pointed.
|
3747
3853
|
def initialize( s0 = 0.0, s1 = 0.0, s2 = 0.0, s3 = 0.0, s4 = 0.0, s5 = 0.0, s6 = 0.0, s7 = 0.0, s8 = 0.0, s9 = 0.0, sa = 0.0, sb = 0.0, sc = 0.0, sd = 0.0, se = 0.0, sf = 0.0 )
|
3748
3854
|
if s0.is_a?(FFI::Pointer) then
|
@@ -3906,8 +4012,10 @@ module OpenCL
|
|
3906
4012
|
end
|
3907
4013
|
# Maps the cl_double16 type of OpenCL
|
3908
4014
|
class Double16 < Struct
|
3909
|
-
|
3910
|
-
|
4015
|
+
type = OpenCL.find_type(:cl_double)
|
4016
|
+
size = type.size
|
4017
|
+
@size = size * 16
|
4018
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ), OpenCL::StructLayout::Field::new( "s8", size * 8, type ), OpenCL::StructLayout::Field::new( "s9", size * 9, type ), OpenCL::StructLayout::Field::new( "sa", size * 10, type ), OpenCL::StructLayout::Field::new( "sb", size * 11, type ), OpenCL::StructLayout::Field::new( "sc", size * 12, type ), OpenCL::StructLayout::Field::new( "sd", size * 13, type ), OpenCL::StructLayout::Field::new( "se", size * 14, type ), OpenCL::StructLayout::Field::new( "sf", size * 15, type ) ], size * 16, size * 16 )
|
3911
4019
|
# Creates a new Double16 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Double16 maps the memory pointed.
|
3912
4020
|
def initialize( s0 = 0.0, s1 = 0.0, s2 = 0.0, s3 = 0.0, s4 = 0.0, s5 = 0.0, s6 = 0.0, s7 = 0.0, s8 = 0.0, s9 = 0.0, sa = 0.0, sb = 0.0, sc = 0.0, sd = 0.0, se = 0.0, sf = 0.0 )
|
3913
4021
|
if s0.is_a?(FFI::Pointer) then
|
@@ -4071,8 +4179,10 @@ module OpenCL
|
|
4071
4179
|
end
|
4072
4180
|
# Maps the cl_half16 type of OpenCL
|
4073
4181
|
class Half16 < Struct
|
4074
|
-
|
4075
|
-
|
4182
|
+
type = OpenCL.find_type(:cl_half)
|
4183
|
+
size = type.size
|
4184
|
+
@size = size * 16
|
4185
|
+
@layout = OpenCL::StructLayout::new([ OpenCL::StructLayout::Field::new( "s0", size * 0, type ), OpenCL::StructLayout::Field::new( "s1", size * 1, type ), OpenCL::StructLayout::Field::new( "s2", size * 2, type ), OpenCL::StructLayout::Field::new( "s3", size * 3, type ), OpenCL::StructLayout::Field::new( "s4", size * 4, type ), OpenCL::StructLayout::Field::new( "s5", size * 5, type ), OpenCL::StructLayout::Field::new( "s6", size * 6, type ), OpenCL::StructLayout::Field::new( "s7", size * 7, type ), OpenCL::StructLayout::Field::new( "s8", size * 8, type ), OpenCL::StructLayout::Field::new( "s9", size * 9, type ), OpenCL::StructLayout::Field::new( "sa", size * 10, type ), OpenCL::StructLayout::Field::new( "sb", size * 11, type ), OpenCL::StructLayout::Field::new( "sc", size * 12, type ), OpenCL::StructLayout::Field::new( "sd", size * 13, type ), OpenCL::StructLayout::Field::new( "se", size * 14, type ), OpenCL::StructLayout::Field::new( "sf", size * 15, type ) ], size * 16, size * 16 )
|
4076
4186
|
# Creates a new Half16 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, Half16 maps the memory pointed.
|
4077
4187
|
def initialize( s0 = 0.0, s1 = 0.0, s2 = 0.0, s3 = 0.0, s4 = 0.0, s5 = 0.0, s6 = 0.0, s7 = 0.0, s8 = 0.0, s9 = 0.0, sa = 0.0, sb = 0.0, sc = 0.0, sd = 0.0, se = 0.0, sf = 0.0 )
|
4078
4188
|
if s0.is_a?(FFI::Pointer) then
|
@@ -2,7 +2,11 @@ using OpenCLRefinements if RUBY_VERSION.scan(/\d+/).collect(&:to_i).first >= 2
|
|
2
2
|
# Maps the OpenCL API using FFI
|
3
3
|
module OpenCL
|
4
4
|
begin
|
5
|
-
|
5
|
+
if ENV["LIBOPENCL_SO"]
|
6
|
+
ffi_lib ENV["LIBOPENCL_SO"]
|
7
|
+
else
|
8
|
+
raise LoadError
|
9
|
+
end
|
6
10
|
rescue LoadError => e
|
7
11
|
begin
|
8
12
|
ffi_lib "OpenCL"
|
@@ -79,12 +83,15 @@ module OpenCL
|
|
79
83
|
INVALID_DEVICE_PARTITION_COUNT = -68
|
80
84
|
INVALID_PIPE_SIZE = -69
|
81
85
|
INVALID_DEVICE_QUEUE = -70
|
86
|
+
INVALID_SPEC_ID = -71
|
87
|
+
MAX_SIZE_RESTRICTION_EXCEEDED = -72
|
82
88
|
INVALID_PARTITION_NAME_EXT = -1059
|
83
89
|
VERSION_1_0 = 1
|
84
90
|
VERSION_1_1 = 1
|
85
91
|
VERSION_1_2 = 1
|
86
92
|
VERSION_2_0 = 1
|
87
93
|
VERSION_2_1 = 1
|
94
|
+
VERSION_2_2 = 1
|
88
95
|
FALSE = 0
|
89
96
|
TRUE = 1
|
90
97
|
BLOCKING = TRUE
|
@@ -357,6 +364,8 @@ module OpenCL
|
|
357
364
|
PROGRAM_NUM_KERNELS = 0x1167
|
358
365
|
PROGRAM_KERNEL_NAMES = 0x1168
|
359
366
|
PROGRAM_IL = 0x1169
|
367
|
+
PROGRAM_SCOPE_GLOBAL_CTORS_PRESENT = 0x116A
|
368
|
+
PROGRAM_SCOPE_GLOBAL_DTORS_PRESENT = 0x116B
|
360
369
|
PROGRAM_BUILD_STATUS = 0x1181
|
361
370
|
PROGRAM_BUILD_OPTIONS = 0x1182
|
362
371
|
PROGRAM_BUILD_LOG = 0x1183
|
@@ -593,6 +602,8 @@ EOF
|
|
593
602
|
[:INVALID_DEVICE_PARTITION_COUNT, :InvalidDevicePartitionCount],
|
594
603
|
[:INVALID_PIPE_SIZE, :InvalidPipeSize],
|
595
604
|
[:INVALID_DEVICE_QUEUE, :InvalidDeviceQueue],
|
605
|
+
[:INVALID_SPEC_ID, :InvalidSpecID],
|
606
|
+
[:MAX_SIZE_RESTRICTION_EXCEEDED, :MaxSizeRestrictionExceeded],
|
596
607
|
[:INVALID_PARTITION_NAME_EXT, :InvalidPartitionNameEXT]
|
597
608
|
].each { |name, capitalized_name|
|
598
609
|
eval error_class_constructor( name, capitalized_name )
|
@@ -1308,6 +1319,8 @@ EOF
|
|
1308
1319
|
NUM_KERNELS = 0x1167
|
1309
1320
|
KERNEL_NAMES = 0x1168
|
1310
1321
|
IL = 0x1169
|
1322
|
+
SCOPE_GLOBAL_CTORS_PRESENT = 0x116A
|
1323
|
+
SCOPE_GLOBAL_DTORS_PRESENT = 0x116B
|
1311
1324
|
BUILD_STATUS = 0x1181
|
1312
1325
|
BUILD_OPTIONS = 0x1182
|
1313
1326
|
BUILD_LOG = 0x1183
|
@@ -1957,6 +1970,13 @@ EOF
|
|
1957
1970
|
attach_function :clCloneKernel, [Kernel,:pointer], Kernel
|
1958
1971
|
attach_function :clGetKernelSubGroupInfo, [Kernel,Device,:cl_kernel_sub_group_info,:size_t,:pointer,:size_t,:pointer,:pointer], :cl_int
|
1959
1972
|
attach_function :clEnqueueSVMMigrateMem, [CommandQueue,:cl_uint,:pointer,:pointer,:cl_mem_migration_flags,:cl_uint,:pointer,:pointer], :cl_int
|
1973
|
+
begin # OpenCL 2.2
|
1974
|
+
callback :clSetProgramReleaseCallback_notify, [Program.by_ref,:pointer], :void
|
1975
|
+
attach_function :clSetProgramReleaseCallback, [Program,:clSetProgramReleaseCallback_notify,:pointer], :cl_int
|
1976
|
+
attach_function :clSetProgramSpecializationConstant, [Program,:cl_uint,:size_t,:pointer], :cl_int
|
1977
|
+
rescue NotFoundError => e
|
1978
|
+
warn "Warning OpenCL 2.1 loader detected!"
|
1979
|
+
end
|
1960
1980
|
rescue NotFoundError => e
|
1961
1981
|
warn "Warning OpenCL 2.0 loader detected!"
|
1962
1982
|
end
|
data/opencl_ruby_ffi.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opencl_ruby_ffi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brice Videau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: narray
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
version: '0'
|
141
141
|
requirements: []
|
142
142
|
rubyforge_project:
|
143
|
-
rubygems_version: 2.
|
143
|
+
rubygems_version: 2.7.6
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: Ruby OpenCL FFI bindings
|