opencl_ruby_ffi 1.3.4 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/opencl_ruby_ffi/CommandQueue.rb +2 -1
- 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/motion_estimation.rb +26 -0
- data/lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb +78 -0
- data/lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb +2 -2
- data/opencl_ruby_ffi.gemspec +3 -3
- metadata +8 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 406f911ff3d3ea9c5f815c7854ea7cd3e4879c51dc583df94fcf73adf0532c6b
|
|
4
|
+
data.tar.gz: 4cc80ef3c64b55142ee8f6db0786b7f9d2062104e8d17df32077545e9dd41bbc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cd58bb929a02b1c730f7319bb45fb0f3955e1afc90b5dbb3a1c201439f9cd50dec7fd647843064c097f011725540f69f6fa40455a418398b16c470606780fd55
|
|
7
|
+
data.tar.gz: b08e3de035ec44212bd1841fcf0464cd17b4ecb6eb5712728c5a99df5cf06f044b56e2578ef0377179bd3fa973c1c8787d86ea70b46e86a784f0cbea84e03d1b
|
|
@@ -639,7 +639,8 @@ module OpenCL
|
|
|
639
639
|
offset = options[:offset] if options[:offset]
|
|
640
640
|
pattern_size = pattern.size
|
|
641
641
|
pattern_size = options[:pattern_size] if options[:pattern_size]
|
|
642
|
-
size = (buffer.size - offset)
|
|
642
|
+
size = (buffer.size - offset)
|
|
643
|
+
size -= size % pattern_size
|
|
643
644
|
size = options[:size] if options[:size]
|
|
644
645
|
num_events, events = get_event_wait_list( options )
|
|
645
646
|
event = MemoryPointer::new( Event )
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
module OpenCL
|
|
2
|
+
|
|
3
|
+
ACCELERATOR_DESCRIPTOR_INTEL = 0x4090
|
|
4
|
+
ACCELERATOR_REFERENCE_COUNT_INTEL = 0x4091
|
|
5
|
+
ACCELERATOR_CONTEXT_INTEL = 0x4092
|
|
6
|
+
ACCELERATOR_TYPE_INTEL = 0x4093
|
|
7
|
+
INVALID_ACCELERATOR_INTEL = -1094
|
|
8
|
+
INVALID_ACCELERATOR_TYPE_INTEL = -1095
|
|
9
|
+
INVALID_ACCELERATOR_DESCRIPTOR_INTEL = -1096
|
|
10
|
+
ACCELERATOR_TYPE_NOT_SUPPORTED_INTEL = -1097
|
|
11
|
+
|
|
12
|
+
typedef :cl_uint, :cl_accelerator_type_intel
|
|
13
|
+
typedef :cl_uint, :cl_accelerator_info_intel
|
|
14
|
+
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
if RUBY_VERSION.scan(/\d+/).collect(&:to_i).first >= 2
|
|
18
|
+
module OpenCLRefinements
|
|
19
|
+
refine FFI::Pointer do
|
|
20
|
+
methods_prefix = [:put, :get, :write, :read, :put_array_of, :get_array_of]
|
|
21
|
+
[[:cl_uint, :cl_accelerator_type_intel],
|
|
22
|
+
[:cl_uint, :cl_accelerator_info_intel]].each { |orig, add|
|
|
23
|
+
methods_prefix.each { |meth|
|
|
24
|
+
alias_method "#{meth}_#{add}".to_sym, "#{meth}_#{orig}".to_sym
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
using OpenCLRefinements
|
|
30
|
+
else
|
|
31
|
+
class FFI::Pointer
|
|
32
|
+
methods_prefix = [:put, :get, :write, :read, :put_array_of, :get_array_of]
|
|
33
|
+
[[:cl_uint, :cl_accelerator_type_intel],
|
|
34
|
+
[:cl_uint, :cl_accelerator_info_intel]].each { |orig, add|
|
|
35
|
+
methods_prefix.each { |meth|
|
|
36
|
+
alias_method "#{meth}_#{add}".to_sym, "#{meth}_#{orig}".to_sym
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
module OpenCL
|
|
43
|
+
|
|
44
|
+
class Error
|
|
45
|
+
eval error_class_constructor( :INVALID_ACCELERATOR_INTEL, :InvalidAcceleratorINTEL )
|
|
46
|
+
eval error_class_constructor( :INVALID_ACCELERATOR_TYPE_INTEL, :InvalidAcceleratorTypeINTEL )
|
|
47
|
+
eval error_class_constructor( :INVALID_ACCELERATOR_DESCRIPTOR_INTEL, :InvalidAcceleratorDescriptorINTEL )
|
|
48
|
+
eval error_class_constructor( :ACCELERATOR_TYPE_NOT_SUPPORTED_INTEL, :AcceleratorTypeNotSupportedINTEL )
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
class AcceleratorINTEL < ExtendedStruct
|
|
52
|
+
class AcceleratorINTELPointer < FFI::Pointer
|
|
53
|
+
attr_accessor :context
|
|
54
|
+
def initialize(ptr, context)
|
|
55
|
+
super(ptr)
|
|
56
|
+
@context = context
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
include InnerInterface
|
|
61
|
+
extend ExtensionInnerGenerator
|
|
62
|
+
layout :dummy, :pointer
|
|
63
|
+
DESCRIPTOR_INTEL = 0x4090
|
|
64
|
+
REFERENCE_COUNT_INTEL = 0x4091
|
|
65
|
+
CONTEXT_INTEL = 0x4092
|
|
66
|
+
TYPE_INTEL = 0x4093
|
|
67
|
+
|
|
68
|
+
def platform
|
|
69
|
+
@context.platform
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def initialize(ptr, context = ptr.context, retain = true)
|
|
73
|
+
super(AcceleratorINTELPointer::new(ptr, context))
|
|
74
|
+
@context = context
|
|
75
|
+
context.__retain_accelerator_intel(ptr) if retain
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def self.release(ptr)
|
|
79
|
+
ptr.context.__release_accelerator_intel(ptr)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def descriptor_intel
|
|
83
|
+
f = platform.get_extension_function("clGetAcceleratorInfoINTEL", :cl_int,
|
|
84
|
+
[OpenCL::AcceleratorINTEL, :cl_accelerator_info_intel, :size_t, :pointer, :pointer])
|
|
85
|
+
error_check(OpenCL::INVALID_OPERATION) unless f
|
|
86
|
+
|
|
87
|
+
ptr1 = MemoryPointer::new( :size_t, 1)
|
|
88
|
+
error = f.call(self, DESCRIPTOR_INTEL, 0, nil, ptr1)
|
|
89
|
+
error_check(error)
|
|
90
|
+
ptr2 = MemoryPointer::new( ptr1.read_size_t )
|
|
91
|
+
error = f.call(self, DESCRIPTOR_INTEL, ptr1.read_size_t, ptr2, nil)
|
|
92
|
+
error_check(error)
|
|
93
|
+
return ptr2
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def context_intel
|
|
97
|
+
f = platform.get_extension_function("clGetAcceleratorInfoINTEL", :cl_int,
|
|
98
|
+
[OpenCL::AcceleratorINTEL, :cl_accelerator_info_intel, :size_t, :pointer, :pointer])
|
|
99
|
+
error_check(OpenCL::INVALID_OPERATION) unless f
|
|
100
|
+
|
|
101
|
+
ptr = MemoryPointer::new( Context )
|
|
102
|
+
error = f.call(self, CONTEXT_INTEL, Context.size, ptr, nil)
|
|
103
|
+
error_check(error)
|
|
104
|
+
return Context::new( ptr.read_pointer )
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
get_info_ext("AcceleratorINTEL", :cl_uint, "reference_count_intel", "clGetAcceleratorInfoINTEL")
|
|
108
|
+
get_info_ext("AcceleratorINTEL", :cl_uint, "type_intel", "clGetAcceleratorInfoINTEL")
|
|
109
|
+
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
class Context
|
|
113
|
+
module AcceleratorINTEL
|
|
114
|
+
|
|
115
|
+
def create_accelerator_intel(accelerator_type, descriptor, options = {})
|
|
116
|
+
name = "clCreateAcceleratorINTEL"
|
|
117
|
+
return_type = OpenCL::AcceleratorINTEL
|
|
118
|
+
params = [Context, :cl_accelerator_type_intel, :size_t, :pointer, :pointer]
|
|
119
|
+
f = platform.get_extension_function(name, return_type, params)
|
|
120
|
+
error_check(OpenCL::INVALID_OPERATION) unless f
|
|
121
|
+
error = MemoryPointer::new( :cl_int )
|
|
122
|
+
size = descriptor.size
|
|
123
|
+
acc = f.call(self, accelerator_type, size, descriptor, error)
|
|
124
|
+
error_check(error.read_cl_int)
|
|
125
|
+
return OpenCL::AcceleratorINTEL::new( acc, self, false )
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def __release_accelerator_intel(ptr)
|
|
129
|
+
name = "clReleaseAcceleratorINTEL"
|
|
130
|
+
return_type = :cl_int
|
|
131
|
+
params = [OpenCL::AcceleratorINTEL]
|
|
132
|
+
f = platform.get_extension_function(name, return_type, params)
|
|
133
|
+
error_check(OpenCL::INVALID_OPERATION) unless f
|
|
134
|
+
error = f.call(ptr)
|
|
135
|
+
error_check(error)
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
def __retain_accelerator_intel(ptr)
|
|
139
|
+
name = "clRetainAcceleratorINTEL"
|
|
140
|
+
return_type = :cl_int
|
|
141
|
+
params = [OpenCL::AcceleratorINTEL]
|
|
142
|
+
f = platform.get_extension_function(name, return_type, params)
|
|
143
|
+
error_check(OpenCL::INVALID_OPERATION) unless f
|
|
144
|
+
error = f.call(ptr)
|
|
145
|
+
error_check(error)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
end
|
|
149
|
+
register_extension( :cl_intel_accelerator, AcceleratorINTEL, "platform.extensions.include?(\"cl_intel_accelerator\")" )
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
end
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
using OpenCLRefinements if RUBY_VERSION.scan(/\d+/).collect(&:to_i).first >= 2
|
|
2
|
+
|
|
3
|
+
require_relative 'motion_estimation'
|
|
4
|
+
|
|
5
|
+
module OpenCL
|
|
6
|
+
|
|
7
|
+
DEVICE_ME_VERSION_INTEL = 0x407E
|
|
8
|
+
|
|
9
|
+
ME_CHROMA_INTRA_PREDICT_ENABLED_INTEL = 0x1
|
|
10
|
+
ME_LUMA_INTRA_PREDICT_ENABLED_INTEL = 0x2
|
|
11
|
+
|
|
12
|
+
ME_SKIP_BLOCK_TYPE_16x16_INTEL = 0x0
|
|
13
|
+
ME_SKIP_BLOCK_TYPE_8x8_INTEL = 0x4
|
|
14
|
+
|
|
15
|
+
ME_COST_PENALTY_NONE_INTEL = 0x0
|
|
16
|
+
ME_COST_PENALTY_LOW_INTEL = 0x1
|
|
17
|
+
ME_COST_PENALTY_NORMAL_INTEL = 0x2
|
|
18
|
+
ME_COST_PENALTY_HIGH_INTEL = 0x3
|
|
19
|
+
|
|
20
|
+
ME_COST_PRECISION_QPEL_INTEL = 0x0
|
|
21
|
+
ME_COST_PRECISION_HEL_INTEL = 0x1
|
|
22
|
+
ME_COST_PRECISION_PEL_INTEL = 0x2
|
|
23
|
+
ME_COST_PRECISION_DPEL_INTEL = 0x3
|
|
24
|
+
|
|
25
|
+
ME_LUMA_PREDICTOR_MODE_VERTICAL_INTEL = 0x0
|
|
26
|
+
ME_LUMA_PREDICTOR_MODE_HORIZONTAL_INTEL = 0x1
|
|
27
|
+
ME_LUMA_PREDICTOR_MODE_DC_INTEL = 0x2
|
|
28
|
+
ME_LUMA_PREDICTOR_MODE_DIAGONAL_DOWN_LEFT_INTEL = 0x3
|
|
29
|
+
|
|
30
|
+
ME_LUMA_PREDICTOR_MODE_DIAGONAL_DOWN_RIGHT_INTEL = 0x4
|
|
31
|
+
ME_LUMA_PREDICTOR_MODE_PLANE_INTEL = 0x4
|
|
32
|
+
ME_LUMA_PREDICTOR_MODE_VERTICAL_RIGHT_INTEL = 0x5
|
|
33
|
+
ME_LUMA_PREDICTOR_MODE_HORIZONTAL_DOWN_INTEL = 0x6
|
|
34
|
+
ME_LUMA_PREDICTOR_MODE_VERTICAL_LEFT_INTEL = 0x7
|
|
35
|
+
ME_LUMA_PREDICTOR_MODE_HORIZONTAL_UP_INTEL = 0x8
|
|
36
|
+
|
|
37
|
+
ME_CHROMA_PREDICTOR_MODE_DC_INTEL = 0x0
|
|
38
|
+
ME_CHROMA_PREDICTOR_MODE_HORIZONTAL_INTEL = 0x1
|
|
39
|
+
ME_CHROMA_PREDICTOR_MODE_VERTICAL_INTEL = 0x2
|
|
40
|
+
ME_CHROMA_PREDICTOR_MODE_PLANE_INTEL = 0x3
|
|
41
|
+
|
|
42
|
+
ME_VERSION_LEGACY_INTEL = 0x0
|
|
43
|
+
ME_VERSION_ADVANCED_VER_1_INTEL = 0x1
|
|
44
|
+
ME_VERSION_ADVANCED_VER_2_INTEL = 0x2
|
|
45
|
+
|
|
46
|
+
ME_FORWARD_INPUT_MODE_INTEL = 0x1
|
|
47
|
+
ME_BACKWARD_INPUT_MODE_INTEL = 0x2
|
|
48
|
+
ME_BIDIRECTION_INPUT_MODE_INTEL = 0x3
|
|
49
|
+
|
|
50
|
+
ME_BIDIR_WEIGHT_QUARTER_INTEL = 0x10
|
|
51
|
+
ME_BIDIR_WEIGHT_THIRD_INTEL = 0x15
|
|
52
|
+
ME_BIDIR_WEIGHT_HALF_INTEL = 0x20
|
|
53
|
+
ME_BIDIR_WEIGHT_TWO_THIRD_INTEL = 0x2B
|
|
54
|
+
ME_BIDIR_WEIGHT_THREE_QUARTER_INTEL = 0x30
|
|
55
|
+
|
|
56
|
+
class Device
|
|
57
|
+
ME_VERSION_INTEL = 0x407E
|
|
58
|
+
module AdvanceMotionEstimationINTEL
|
|
59
|
+
extend InnerGenerator
|
|
60
|
+
get_info("Device", :cl_uint, "me_version_intel")
|
|
61
|
+
|
|
62
|
+
end
|
|
63
|
+
register_extension( :cl_intel_advanced_motion_estimation, AdvanceMotionEstimationINTEL, "platform.extensions.include?(\"cl_intel_advanced_motion_estimation\")" )
|
|
64
|
+
end
|
|
65
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
using OpenCLRefinements if RUBY_VERSION.scan(/\d+/).collect(&:to_i).first >= 2
|
|
2
|
+
|
|
3
|
+
module OpenCL
|
|
4
|
+
CONTEXT_DRIVER_DIAGNOSTICS_INTEL = 0x4106
|
|
5
|
+
CONTEXT_SHOW_DIAGNOSTICS_INTEL = 0x4106
|
|
6
|
+
CONTEXT_DIAGNOSTICS_LEVEL_GOOD_INTEL = 0x1
|
|
7
|
+
CONTEXT_DIAGNOSTICS_LEVEL_BAD_INTEL = 0x2
|
|
8
|
+
CONTEXT_DIAGNOSTICS_LEVEL_NEUTRAL_INTEL = 0x4
|
|
9
|
+
|
|
10
|
+
class Context
|
|
11
|
+
DRIVER_DIAGNOSTICS_INTEL = 0x4106
|
|
12
|
+
SHOW_DIAGNOSTICS_INTEL = 0x4106
|
|
13
|
+
DIAGNOSTICS_LEVEL_GOOD_INTEL = 0x1
|
|
14
|
+
DIAGNOSTICS_LEVEL_BAD_INTEL = 0x2
|
|
15
|
+
DIAGNOSTICS_LEVEL_NEUTRAL_INTEL = 0x4
|
|
16
|
+
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
using OpenCLRefinements if RUBY_VERSION.scan(/\d+/).collect(&:to_i).first >= 2
|
|
2
|
+
|
|
3
|
+
require_relative 'accelerator'
|
|
4
|
+
|
|
5
|
+
module OpenCL
|
|
6
|
+
ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL = 0x0
|
|
7
|
+
ME_MB_TYPE_16x16_INTEL = 0x0
|
|
8
|
+
ME_MB_TYPE_8x8_INTEL = 0x1
|
|
9
|
+
ME_MB_TYPE_4x4_INTEL = 0x2
|
|
10
|
+
ME_SUBPIXEL_MODE_INTEGER_INTEL = 0x0
|
|
11
|
+
ME_SUBPIXEL_MODE_HPEL_INTEL = 0x1
|
|
12
|
+
ME_SUBPIXEL_MODE_QPEL_INTEL = 0x2
|
|
13
|
+
ME_SAD_ADJUST_MODE_NONE_INTEL = 0x0
|
|
14
|
+
ME_SAD_ADJUST_MODE_HAAR_INTEL = 0x1
|
|
15
|
+
ME_SEARCH_PATH_RADIUS_2_2_INTEL = 0x0
|
|
16
|
+
ME_SEARCH_PATH_RADIUS_4_4_INTEL = 0x1
|
|
17
|
+
ME_SEARCH_PATH_RADIUS_16_12_INTEL = 0x5
|
|
18
|
+
|
|
19
|
+
class MotionEstimationDescINTEL < FFI::Struct
|
|
20
|
+
layout :mb_block_type, :cl_uint,
|
|
21
|
+
:subpixel_mode, :cl_uint,
|
|
22
|
+
:sad_adjust_mode, :cl_uint,
|
|
23
|
+
:search_path_type, :cl_uint
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
end
|
|
@@ -284,6 +284,84 @@ module OpenCL
|
|
|
284
284
|
include InnerInterface
|
|
285
285
|
end
|
|
286
286
|
|
|
287
|
+
module ExtensionInnerGenerator
|
|
288
|
+
|
|
289
|
+
private
|
|
290
|
+
# Generates a new method for klass that use the given clGetKlassInfo on the object platform, to read an info of the given type. The info queried is specified by name.
|
|
291
|
+
# @param [String] klass the property is to be found
|
|
292
|
+
# @param [Symbol] type of the property
|
|
293
|
+
# @param [String] name of the property
|
|
294
|
+
# @!macro [attach] get_info
|
|
295
|
+
# @!method $3
|
|
296
|
+
# Returns the OpenCL::$1::$3 info
|
|
297
|
+
# @return $2
|
|
298
|
+
def get_info_ext(klass, type, name, function)
|
|
299
|
+
klass_name = klass
|
|
300
|
+
klass_name = "MemObject" if klass == "Mem"
|
|
301
|
+
s = <<EOF
|
|
302
|
+
def #{name.downcase}
|
|
303
|
+
f = platform.get_extension_function("#{function}", :cl_int, [#{klass_name}, :cl_uint, :size_t, :pointer, :pointer])
|
|
304
|
+
error_check(OpenCL::INVALID_OPERATION) unless f
|
|
305
|
+
|
|
306
|
+
ptr1 = MemoryPointer::new( :size_t, 1)
|
|
307
|
+
error = f.call(self, #{klass}::#{name.upcase}, 0, nil, ptr1)
|
|
308
|
+
error_check(error)
|
|
309
|
+
ptr2 = MemoryPointer::new( ptr1.read_size_t )
|
|
310
|
+
error = f.call(self, #{klass}::#{name.upcase}, ptr1.read_size_t, ptr2, nil)
|
|
311
|
+
error_check(error)
|
|
312
|
+
if(convert_type(:#{type})) then
|
|
313
|
+
return convert_type(:#{type})::new(ptr2.read_#{type})
|
|
314
|
+
else
|
|
315
|
+
return ptr2.read_#{type}
|
|
316
|
+
end
|
|
317
|
+
end
|
|
318
|
+
EOF
|
|
319
|
+
if type == :cl_bool then
|
|
320
|
+
s += <<EOF
|
|
321
|
+
def #{name.downcase}?
|
|
322
|
+
#{name.downcase} == 0 ? false : true
|
|
323
|
+
end
|
|
324
|
+
EOF
|
|
325
|
+
end
|
|
326
|
+
module_eval s
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
# Generates a new method for klass that use the apropriate clGetKlassInfo, to read an Array of element of the given type. The info queried is specified by name.
|
|
330
|
+
# @param [String] klass the property is to be found
|
|
331
|
+
# @param [Symbol] type of the property
|
|
332
|
+
# @param [String] name of the property
|
|
333
|
+
# @!macro [attach] get_info_array
|
|
334
|
+
# @!method $3
|
|
335
|
+
# Returns the OpenCL::$1::$3 info
|
|
336
|
+
# @return an Array of $2
|
|
337
|
+
def get_info_array_ext(klass, type, name, function)
|
|
338
|
+
klass_name = klass
|
|
339
|
+
klass_name = "MemObject" if klass == "Mem"
|
|
340
|
+
s = <<EOF
|
|
341
|
+
def #{name.downcase}
|
|
342
|
+
f = platform.get_extension_function("#{function}", :cl_int, [:cl_uint, :size_t, :pointer, :pointer])
|
|
343
|
+
error_check(OpenCL::INVALID_OPERATION) unless f
|
|
344
|
+
|
|
345
|
+
ptr1 = MemoryPointer::new( :size_t, 1)
|
|
346
|
+
error = f.call(self, #{klass}::#{name.upcase}, 0, nil, ptr1)
|
|
347
|
+
error_check(error)
|
|
348
|
+
ptr2 = MemoryPointer::new( ptr1.read_size_t )
|
|
349
|
+
error = f.call(self, #{klass}::#{name.upcase}, ptr1.read_size_t, ptr2, nil)
|
|
350
|
+
error_check(error)
|
|
351
|
+
arr = ptr2.get_array_of_#{type}(0, ptr1.read_size_t/ OpenCL.find_type(:#{type}).size)
|
|
352
|
+
if(convert_type(:#{type})) then
|
|
353
|
+
return arr.collect { |e| convert_type(:#{type})::new(e) }
|
|
354
|
+
else
|
|
355
|
+
return arr
|
|
356
|
+
end
|
|
357
|
+
end
|
|
358
|
+
EOF
|
|
359
|
+
module_eval s
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
end
|
|
363
|
+
private_constant :ExtensionInnerGenerator
|
|
364
|
+
|
|
287
365
|
module InnerGenerator
|
|
288
366
|
|
|
289
367
|
private
|
|
@@ -1844,9 +1844,9 @@ EOF
|
|
|
1844
1844
|
attach_function :clGetPlatformInfo, [Platform,:cl_platform_info,:size_t,:pointer,:pointer], :cl_int
|
|
1845
1845
|
attach_function :clGetDeviceIDs, [Platform,:cl_device_type,:cl_uint,:pointer,:pointer], :cl_int
|
|
1846
1846
|
attach_function :clGetDeviceInfo, [Device,:cl_device_info,:size_t,:pointer,:pointer], :cl_int
|
|
1847
|
-
callback :clCreateContext_notify, [:
|
|
1847
|
+
callback :clCreateContext_notify, [:string,:pointer,:size_t,:pointer], :void
|
|
1848
1848
|
attach_function :clCreateContext, [:pointer,:cl_uint,:pointer,:clCreateContext_notify,:pointer,:pointer], Context
|
|
1849
|
-
callback :clCreateContextFromType_notify, [:
|
|
1849
|
+
callback :clCreateContextFromType_notify, [:string,:pointer,:size_t,:pointer], :void
|
|
1850
1850
|
attach_function :clCreateContextFromType, [:pointer,:cl_device_type,:clCreateContextFromType_notify,:pointer,:pointer], Context
|
|
1851
1851
|
attach_function :clRetainContext, [Context], :cl_int
|
|
1852
1852
|
attach_function :clReleaseContext, [Context], :cl_int
|
data/opencl_ruby_ffi.gemspec
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.name = 'opencl_ruby_ffi'
|
|
3
|
-
s.version = "1.3.
|
|
3
|
+
s.version = "1.3.5"
|
|
4
4
|
s.author = "Brice Videau"
|
|
5
5
|
s.email = "brice.videau@imag.fr"
|
|
6
6
|
s.homepage = "https://github.com/Nanosim-LIG/opencl-ruby"
|
|
7
7
|
s.summary = "Ruby OpenCL FFI bindings"
|
|
8
|
-
s.description = "Ruby OpenCL FFI bindings. OpenCL 2.
|
|
9
|
-
s.files = Dir[ 'opencl_ruby_ffi.gemspec', 'LICENSE', 'lib
|
|
8
|
+
s.description = "Ruby OpenCL FFI bindings. OpenCL 2.2 ready"
|
|
9
|
+
s.files = Dir[ 'opencl_ruby_ffi.gemspec', 'LICENSE', 'lib/**/**/*.rb', '.yardopts', 'templates_custom/default/module/setup.rb' ]
|
|
10
10
|
s.has_rdoc = false
|
|
11
11
|
s.license = 'BSD-2-Clause'
|
|
12
12
|
s.required_ruby_version = '>= 1.8.7'
|
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.5
|
|
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: 2019-08-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: narray
|
|
@@ -70,7 +70,7 @@ dependencies:
|
|
|
70
70
|
- - ">="
|
|
71
71
|
- !ruby/object:Gem::Version
|
|
72
72
|
version: 1.0.0
|
|
73
|
-
description: Ruby OpenCL FFI bindings. OpenCL 2.
|
|
73
|
+
description: Ruby OpenCL FFI bindings. OpenCL 2.2 ready
|
|
74
74
|
email: brice.videau@imag.fr
|
|
75
75
|
executables: []
|
|
76
76
|
extensions: []
|
|
@@ -97,6 +97,10 @@ files:
|
|
|
97
97
|
- lib/opencl_ruby_ffi/ext.rb
|
|
98
98
|
- lib/opencl_ruby_ffi/ext/device_fission.rb
|
|
99
99
|
- lib/opencl_ruby_ffi/gl_ext.rb
|
|
100
|
+
- lib/opencl_ruby_ffi/intel/accelerator.rb
|
|
101
|
+
- lib/opencl_ruby_ffi/intel/advanced_motion_estimation.rb
|
|
102
|
+
- lib/opencl_ruby_ffi/intel/driver_diagnostics.rb
|
|
103
|
+
- lib/opencl_ruby_ffi/intel/motion_estimation.rb
|
|
100
104
|
- lib/opencl_ruby_ffi/khr/d3d10_sharing.rb
|
|
101
105
|
- lib/opencl_ruby_ffi/khr/d3d11_sharing.rb
|
|
102
106
|
- lib/opencl_ruby_ffi/khr/dx9_media_sharing.rb
|
|
@@ -140,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
140
144
|
version: '0'
|
|
141
145
|
requirements: []
|
|
142
146
|
rubyforge_project:
|
|
143
|
-
rubygems_version: 2.7.6
|
|
147
|
+
rubygems_version: 2.7.6.2
|
|
144
148
|
signing_key:
|
|
145
149
|
specification_version: 4
|
|
146
150
|
summary: Ruby OpenCL FFI bindings
|