opencl_ruby_ffi 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/lib/opencl_ruby_ffi.rb +0 -4
- data/lib/opencl_ruby_ffi/Image.rb +1 -1
- data/lib/opencl_ruby_ffi/Kernel.rb +12 -6
- data/lib/opencl_ruby_ffi/Program.rb +0 -1
- data/lib/opencl_ruby_ffi/amd/device_attribute_query.rb +0 -1
- data/lib/opencl_ruby_ffi/ext/device_fission.rb +0 -1
- data/lib/opencl_ruby_ffi/khr/d3d10_sharing.rb +0 -1
- data/lib/opencl_ruby_ffi/khr/d3d11_sharing.rb +0 -1
- data/lib/opencl_ruby_ffi/khr/dx9_media_sharing.rb +0 -1
- data/lib/opencl_ruby_ffi/khr/egl_event.rb +0 -1
- data/lib/opencl_ruby_ffi/khr/egl_image.rb +0 -1
- data/lib/opencl_ruby_ffi/khr/fp16.rb +0 -1
- data/lib/opencl_ruby_ffi/khr/fp64.rb +0 -1
- data/lib/opencl_ruby_ffi/khr/gl_event.rb +0 -1
- data/lib/opencl_ruby_ffi/khr/gl_sharing.rb +1 -2
- data/lib/opencl_ruby_ffi/khr/icd.rb +0 -1
- data/lib/opencl_ruby_ffi/khr/initalize_memory.rb +0 -1
- data/lib/opencl_ruby_ffi/khr/priority_hints.rb +0 -1
- data/lib/opencl_ruby_ffi/khr/spir.rb +0 -1
- data/lib/opencl_ruby_ffi/khr/sub_groups.rb +0 -1
- data/lib/opencl_ruby_ffi/khr/terminate_context.rb +0 -1
- data/lib/opencl_ruby_ffi/khr/throttle_hints.rb +0 -1
- data/lib/opencl_ruby_ffi/nv/device_attribute_query.rb +0 -1
- data/lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb +21 -20
- data/opencl_ruby_ffi.gemspec +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2aaf99112a7a7223edf3461b3e7c813d3c0c44b0
|
4
|
+
data.tar.gz: 7c5bb20e06c5152dcfacd31f1506f2d3205b0f21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63aa2044a7c9322484e92e6d72c7f41df687c8c8204a20ac26539dd017aff5c4dedbeb86edd170645f9cfdc0ec712de5461b0bbd125fbceb89cd3db2aacf02c8
|
7
|
+
data.tar.gz: 88633e9e8fd7d3c5d54a4d422cc2bcd3999631863cdca78054ceba5454a45246e88a7ad09cd71c67e560e0f08475323b60053baf886463844a96cdf1129ef246
|
data/.yardopts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
-p templates_custom/ --no-private lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb lib/**/*.rb lib
|
1
|
+
-p templates_custom/ --no-private lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb lib/**/*.rb lib/**/**/*.rb
|
data/lib/opencl_ruby_ffi.rb
CHANGED
@@ -103,7 +103,7 @@ module OpenCL
|
|
103
103
|
flags = get_flags( options )
|
104
104
|
host_ptr = options[:host_ptr]
|
105
105
|
error = MemoryPointer::new( :cl_int )
|
106
|
-
img_ptr = clCreateImage3D( context,
|
106
|
+
img_ptr = clCreateImage3D( context, flags, format, width, height, depth, row_pitch, slice_pitch, host_ptr, error )
|
107
107
|
error_check(error.read_cl_int)
|
108
108
|
return Image::new(img_ptr, false)
|
109
109
|
end
|
@@ -93,6 +93,7 @@ module OpenCL
|
|
93
93
|
end
|
94
94
|
|
95
95
|
end
|
96
|
+
|
96
97
|
# Sets this Arg to value. The size of value can be specified.
|
97
98
|
def set(value, size = nil)
|
98
99
|
if value.class == SVMPointer and @kernel.context.platform.version_number >= 2.0 then
|
@@ -222,19 +223,24 @@ module OpenCL
|
|
222
223
|
OpenCL.set_kernel_arg(self, index, value, size)
|
223
224
|
end
|
224
225
|
|
225
|
-
#
|
226
|
+
# Set the arguments of the kernel, arguments can be a scalar or an [ arg, size ] duplet.
|
227
|
+
def set_args(*args)
|
228
|
+
num_args.times { |i|
|
229
|
+
OpenCL.set_kernel_arg(self, i, *[args[i]].flatten )
|
230
|
+
}
|
231
|
+
end
|
232
|
+
|
233
|
+
# Enqueues the Kernel in the given queue, specifying the global_work_size. Arguments for the kernel are specified afterwards, they can be scalar or [arg, size]. Last, a hash containing options for enqueu_ndrange kernel can be specified
|
226
234
|
def enqueue_with_args(command_queue, global_work_size, *args)
|
227
|
-
n =
|
235
|
+
n = num_args
|
228
236
|
error_check(INVALID_KERNEL_ARGS) if args.length < n
|
229
237
|
error_check(INVALID_KERNEL_ARGS) if args.length > n + 1
|
230
238
|
if args.length == n + 1
|
231
|
-
options = args.
|
239
|
+
options = args.pop
|
232
240
|
else
|
233
241
|
options = {}
|
234
242
|
end
|
235
|
-
|
236
|
-
self.set_arg(i, args[i])
|
237
|
-
}
|
243
|
+
set_args(*args)
|
238
244
|
command_queue.enqueue_ndrange_kernel(self, global_work_size, options)
|
239
245
|
end
|
240
246
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'opencl_ruby_ffi'
|
2
1
|
using OpenCLRefinements if RUBY_VERSION.scan(/\d+/).collect(&:to_i).first >= 2
|
3
2
|
|
4
3
|
module OpenCL
|
@@ -20,7 +19,7 @@ module OpenCL
|
|
20
19
|
|
21
20
|
end
|
22
21
|
|
23
|
-
|
22
|
+
attach_extension_function( "clGetGLContextInfoKHR", :cl_int, [:pointer, :cl_gl_context_info, :size_t, :pointer, :pointer] )
|
24
23
|
|
25
24
|
def self.get_gl_context_info_khr( properties, param_name )
|
26
25
|
props = MemoryPointer::new( :cl_context_properties, properties.length + 1 )
|
@@ -918,26 +918,27 @@ EOF
|
|
918
918
|
SVM_FINE_GRAIN_SYSTEM = (1 << 2)
|
919
919
|
SVM_ATOMICS = (1 << 3)
|
920
920
|
PAGE_SIZE_QCOM = 0x40A1
|
921
|
-
|
922
|
-
#
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
#
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
921
|
+
|
922
|
+
#DEFINED in ext/device_fission.rb
|
923
|
+
# # Creates a new Device and retains it if specified and aplicable
|
924
|
+
# def initialize(ptr, retain = true)
|
925
|
+
# super(ptr)
|
926
|
+
# if platform.version_number >= 1.2 and retain then
|
927
|
+
# error = OpenCL.clRetainDevice(ptr)
|
928
|
+
# error_check( error )
|
929
|
+
# end
|
930
|
+
# end
|
931
|
+
#
|
932
|
+
# # method called at Device deletion, releases the object if aplicable
|
933
|
+
# # @private
|
934
|
+
# def self.release(ptr)
|
935
|
+
# plat = FFI::MemoryPointer::new( Platform )
|
936
|
+
# OpenCL.clGetDeviceInfo( ptr, OpenCL::Device::PLATFORM, plat.size, plat, nil)
|
937
|
+
# platform = OpenCL::Platform::new(plat.read_pointer)
|
938
|
+
# if platform.version_number >= 1.2 then
|
939
|
+
# OpenCL.clReleaseDevice(ptr)
|
940
|
+
# end
|
941
|
+
# end
|
941
942
|
|
942
943
|
end
|
943
944
|
|
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.3
|
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: 2017-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: narray
|
@@ -145,4 +145,3 @@ signing_key:
|
|
145
145
|
specification_version: 4
|
146
146
|
summary: Ruby OpenCL FFI bindings
|
147
147
|
test_files: []
|
148
|
-
has_rdoc: false
|