opencl_ruby_ffi 1.3.3 → 1.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/opencl_ruby_ffi/Buffer.rb +7 -1
- data/lib/opencl_ruby_ffi/CommandQueue.rb +27 -12
- data/lib/opencl_ruby_ffi/Context.rb +79 -7
- data/lib/opencl_ruby_ffi/Device.rb +95 -13
- data/lib/opencl_ruby_ffi/Event.rb +13 -4
- data/lib/opencl_ruby_ffi/Image.rb +7 -1
- data/lib/opencl_ruby_ffi/Kernel.rb +30 -10
- data/lib/opencl_ruby_ffi/Mem.rb +28 -12
- data/lib/opencl_ruby_ffi/Pipe.rb +8 -0
- data/lib/opencl_ruby_ffi/Platform.rb +33 -6
- data/lib/opencl_ruby_ffi/Program.rb +127 -14
- data/lib/opencl_ruby_ffi/SVM.rb +23 -11
- data/lib/opencl_ruby_ffi/Sampler.rb +2 -1
- data/lib/opencl_ruby_ffi/ext.rb +1 -0
- data/lib/opencl_ruby_ffi/intel/accelerator.rb +152 -0
- data/lib/opencl_ruby_ffi/intel/advanced_motion_estimation.rb +65 -0
- data/lib/opencl_ruby_ffi/intel/driver_diagnostics.rb +19 -0
- data/lib/opencl_ruby_ffi/intel/kernel_profiling.rb +38 -0
- data/lib/opencl_ruby_ffi/intel/motion_estimation.rb +26 -0
- data/lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb +586 -0
- data/lib/opencl_ruby_ffi/intel/unofficial.rb +95 -0
- data/lib/opencl_ruby_ffi/khr/device_uuid.rb +119 -0
- data/lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb +220 -110
- data/lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb +249 -18
- data/lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb +115 -7
- data/lib/opencl_ruby_ffi/opencl_types.rb +4 -0
- data/opencl_ruby_ffi.gemspec +4 -5
- metadata +13 -6
@@ -0,0 +1,95 @@
|
|
1
|
+
if RUBY_VERSION.scan(/\d+/).collect(&:to_i).first >= 2
|
2
|
+
using OpenCLRefinements
|
3
|
+
end
|
4
|
+
|
5
|
+
module OpenCL
|
6
|
+
|
7
|
+
# Unofficial kernel profiling extension
|
8
|
+
CONTEXT_KERNEL_PROFILING_MODES_COUNT_INTEL = 0x407A
|
9
|
+
CONTEXT_KERNEL_PROFILING_MODE_INFO_INTEL = 0x407B
|
10
|
+
KERNEL_IL_SYMBOLS_INTEL = 0x407C
|
11
|
+
KERNEL_BINARY_PROGRAM_INTEL = 0x407D
|
12
|
+
# Unofficial VTune Debug Info extension
|
13
|
+
PROGRAM_DEBUG_INFO_INTEL = 0x4100
|
14
|
+
PROGRAM_DEBUG_INFO_SIZES_INTEL = 0x4101
|
15
|
+
KERNEL_BINARIES_INTEL = 0x4102
|
16
|
+
KERNEL_BINARY_SIZES_INTEL = 0x4103
|
17
|
+
|
18
|
+
class Kernel
|
19
|
+
IL_SYMBOLS_INTEL = 0x407C
|
20
|
+
BINARY_PROGRAM_INTEL = 0x407D
|
21
|
+
BINARIES_INTEL = 0x4102
|
22
|
+
BINARY_SIZES_INTEL = 0x4103
|
23
|
+
|
24
|
+
def binary_program_intel(device = program.devices.first)
|
25
|
+
sz = MemoryPointer::new( :size_t )
|
26
|
+
begin
|
27
|
+
error = OpenCL.clGetKernelWorkGroupInfo(self, device, BINARY_PROGRAM_INTEL, 0, nil, sz)
|
28
|
+
error_check(error)
|
29
|
+
sz = sz.read_size_t
|
30
|
+
bin = MemoryPointer::new(sz)
|
31
|
+
error = OpenCL.clGetKernelWorkGroupInfo(self, device, BINARY_PROGRAM_INTEL, sz, bin, nil)
|
32
|
+
error_check(error)
|
33
|
+
return bin.read_bytes(sz)
|
34
|
+
rescue
|
35
|
+
error = OpenCL.clGetKernelInfo(self, BINARY_PROGRAM_INTEL, 0, nil, sz)
|
36
|
+
error_check(error)
|
37
|
+
sz = sz.read_size_t
|
38
|
+
bin = MemoryPointer::new(sz)
|
39
|
+
error = OpenCL.clGetKernelInfo(self, BINARY_PROGRAM_INTEL, sz, bin, nil)
|
40
|
+
error_check(error)
|
41
|
+
return bin.read_bytes(sz)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
get_info_array("Kernel", :size_t, "binary_sizes_intel")
|
46
|
+
|
47
|
+
def binaries_intel
|
48
|
+
sizes = self.binary_sizes_intel
|
49
|
+
bin_array = MemoryPointer::new( :pointer, sizes.length )
|
50
|
+
total_size = 0
|
51
|
+
pointers = []
|
52
|
+
sizes.each_with_index { |s, i|
|
53
|
+
total_size += s
|
54
|
+
pointers[i] = MemoryPointer::new(s)
|
55
|
+
bin_array[i].write_pointer(pointers[i])
|
56
|
+
}
|
57
|
+
error = OpenCL.clGetKernelInfo(self, BINARIES_INTEL, total_size, bin_array, nil)
|
58
|
+
error_check(error)
|
59
|
+
bins = []
|
60
|
+
devs = self.program.devices
|
61
|
+
sizes.each_with_index { |s, i|
|
62
|
+
bins.push [devs[i], pointers[i].read_bytes(s)]
|
63
|
+
}
|
64
|
+
return bins
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
class Program
|
70
|
+
DEBUG_INFO_INTEL = 0x4100
|
71
|
+
DEBUG_INFO_SIZES_INTEL = 0x4101
|
72
|
+
|
73
|
+
get_info_array("Program", :size_t, "debug_info_sizes_intel")
|
74
|
+
|
75
|
+
def debug_info_intel
|
76
|
+
sizes = self.debug_info_sizes_intel
|
77
|
+
bin_array = MemoryPointer::new( :pointer, sizes.length )
|
78
|
+
total_size = 0
|
79
|
+
sizes.each_with_index { |s, i|
|
80
|
+
total_size += s
|
81
|
+
pointers[i] = MemoryPointer::new(s)
|
82
|
+
bin_array[i].write_pointer(pointers[i])
|
83
|
+
}
|
84
|
+
error = OpenCL.clGetProgramInfo(self, DEBUG_INFO_INTEL, total_size, bin_array, nil)
|
85
|
+
error_check(error)
|
86
|
+
bins = []
|
87
|
+
devs = self.devices
|
88
|
+
sizes.each_with_index { |s, i|
|
89
|
+
bins.push [devs[i], pointers[i].read_bytes(s)]
|
90
|
+
}
|
91
|
+
return bins
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
@@ -0,0 +1,119 @@
|
|
1
|
+
using OpenCLRefinements if RUBY_VERSION.scan(/\d+/).collect(&:to_i).first >= 2
|
2
|
+
|
3
|
+
module OpenCL
|
4
|
+
|
5
|
+
UUID_SIZE_KHR = 16
|
6
|
+
LUID_SIZE_KHR = 8
|
7
|
+
|
8
|
+
DEVICE_UUID_KHR = 0x106A
|
9
|
+
DRIVER_UUID_KHR = 0x106B
|
10
|
+
DEVICE_LUID_VALID_KHR = 0x106C
|
11
|
+
DEVICE_LUID_KHR = 0x106D
|
12
|
+
DEVICE_NODE_MASK_KHR = 0x106E
|
13
|
+
|
14
|
+
class UUID < Struct
|
15
|
+
layout :id, [ OpenCL.find_type(:cl_uchar), UUID_SIZE_KHR ]
|
16
|
+
def to_s
|
17
|
+
a = self[:id].to_a
|
18
|
+
s = ""
|
19
|
+
s << "%02x" % a[15]
|
20
|
+
s << "%02x" % a[14]
|
21
|
+
s << "%02x" % a[13]
|
22
|
+
s << "%02x" % a[12]
|
23
|
+
s << "-"
|
24
|
+
s << "%02x" % a[11]
|
25
|
+
s << "%02x" % a[10]
|
26
|
+
s << "-"
|
27
|
+
s << "%02x" % a[9]
|
28
|
+
s << "%02x" % a[8]
|
29
|
+
s << "-"
|
30
|
+
s << "%02x" % a[7]
|
31
|
+
s << "%02x" % a[6]
|
32
|
+
s << "-"
|
33
|
+
s << "%02x" % a[5]
|
34
|
+
s << "%02x" % a[4]
|
35
|
+
s << "%02x" % a[3]
|
36
|
+
s << "%02x" % a[2]
|
37
|
+
s << "%02x" % a[1]
|
38
|
+
s << "%02x" % a[0]
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.from_string(uuid)
|
42
|
+
new.from_string(uuid)
|
43
|
+
end
|
44
|
+
|
45
|
+
def from_string(uuid)
|
46
|
+
m = uuid.match(/(\h\h)(\h\h)(\h\h)(\h\h)-(\h\h)(\h\h)-(\h\h)(\h\h)-(\h\h)(\h\h)-(\h\h)(\h\h)(\h\h)(\h\h)(\h\h)(\h\h)/)
|
47
|
+
raise "invalid format" unless m
|
48
|
+
UUID_SIZE_KHR.times { |i|
|
49
|
+
self[:id][UUID_SIZE_KHR-1-i] = m[i+1].to_i(16)
|
50
|
+
}
|
51
|
+
self
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
class LUID < Struct
|
56
|
+
layout :id, [ OpenCL.find_type(:cl_uchar), LUID_SIZE_KHR ]
|
57
|
+
def to_s
|
58
|
+
a = self[:id].to_a
|
59
|
+
s = ""
|
60
|
+
s << "%02x" % a[7]
|
61
|
+
s << "%02x" % a[6]
|
62
|
+
s << "%02x" % a[5]
|
63
|
+
s << "%02x" % a[4]
|
64
|
+
s << "%02x" % a[3]
|
65
|
+
s << "%02x" % a[2]
|
66
|
+
s << "%02x" % a[1]
|
67
|
+
s << "%02x" % a[0]
|
68
|
+
end
|
69
|
+
|
70
|
+
def self.from_string(uuid)
|
71
|
+
new.from_string(uuid)
|
72
|
+
end
|
73
|
+
|
74
|
+
def from_string(uuid)
|
75
|
+
m = uuid.match(/(\h\h)(\h\h)(\h\h)(\h\h)(\h\h)(\h\h)(\h\h)(\h\h)/)
|
76
|
+
raise "invalid format" unless m
|
77
|
+
LUID_SIZE_KHR.times { |i|
|
78
|
+
self[:id][LUID_SIZE_KHR-1-i] = m[i+1].to_i(16)
|
79
|
+
}
|
80
|
+
self
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
class Device
|
85
|
+
UUID_KHR = 0x106A
|
86
|
+
LUID_VALID_KHR = 0x106C
|
87
|
+
LUID_KHR = 0x106D
|
88
|
+
NODE_MASK_KHR = 0x106E
|
89
|
+
|
90
|
+
module KHRDeviceUUID
|
91
|
+
extend InnerGenerator
|
92
|
+
get_info("Device", :cl_bool, "luid_valid_khr")
|
93
|
+
get_info("Device", :cl_uint, "node_mask_khr")
|
94
|
+
|
95
|
+
def uuid_khr
|
96
|
+
id = UUID.new
|
97
|
+
error = OpenCL.clGetDeviceInfo( self, UUID_KHR, UUID_SIZE_KHR, id, nil)
|
98
|
+
error_check(error)
|
99
|
+
return id
|
100
|
+
end
|
101
|
+
|
102
|
+
def driver_uuid_khr
|
103
|
+
id = UUID.new
|
104
|
+
error = OpenCL.clGetDeviceInfo( self, DRIVER_UUID_KHR, UUID_SIZE_KHR, id, nil)
|
105
|
+
error_check(error)
|
106
|
+
return id
|
107
|
+
end
|
108
|
+
|
109
|
+
def luid_khr
|
110
|
+
id = LUID.new
|
111
|
+
error = OpenCL.clGetDeviceInfo( self, LUID_KHR, LUID_SIZE_KHR, id, nil)
|
112
|
+
error_check(error)
|
113
|
+
return id
|
114
|
+
end
|
115
|
+
end
|
116
|
+
register_extension( :cl_khr_device_uuid, KHRDeviceUUID, "extensions.include?(\"cl_khr_device_uuid\")" )
|
117
|
+
end
|
118
|
+
|
119
|
+
end
|
@@ -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
|