opencl_ruby_ffi 1.3.2 → 1.3.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: acb95c841675fa710d38152d404a4793e719377d
4
- data.tar.gz: 7210478d7cd4d25bc2a5927933cdd1f7baf9d615
3
+ metadata.gz: 2aaf99112a7a7223edf3461b3e7c813d3c0c44b0
4
+ data.tar.gz: 7c5bb20e06c5152dcfacd31f1506f2d3205b0f21
5
5
  SHA512:
6
- metadata.gz: 5d6a9321eb0a9ac0328be3d712226345b51e41ea49731171732134270bf638be47ed31dd3eb6bf3cb3643d2ae09ff62621bb5f5b27b1dfc9c2a122dcdca771c9
7
- data.tar.gz: 60e325360ba6a96d9610803ef567354f77f735e99e7c30e25e51d4cc7031642551f3feea2f051c58b3b3b89474d0584c5a19e50052f01a2755bcc39ce4840391
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/opencl_ruby_ffi/opencl_ruby_ffi_base.rb lib/**/**/*.rb
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
@@ -17,7 +17,3 @@ require "opencl_ruby_ffi/Pipe.rb"
17
17
  require "opencl_ruby_ffi/SVM.rb"
18
18
  require "opencl_ruby_ffi/ext.rb"
19
19
  require "opencl_ruby_ffi/gl_ext.rb"
20
-
21
- require "narray_ffi"
22
-
23
-
@@ -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, fs, format, width, height, depth, row_pitch, slice_pitch, d, error )
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
- # Enqueues the Kernel in the given queue, specifying the global_work_size. Arguments for the kernel are specified afterwards. Last, a hash containing options for enqueu_ndrange kernel can be specified
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 = self.num_args
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.last
239
+ options = args.pop
232
240
  else
233
241
  options = {}
234
242
  end
235
- n.times { |i|
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
 
@@ -164,7 +164,6 @@ module OpenCL
164
164
  strs = [strings].flatten
165
165
  end
166
166
  n_strs = strs.size
167
- strs_lengths = MemoryPointer::new( :size_t, n_strs )
168
167
  c_strs = MemoryPointer::new( :pointer, n_strs )
169
168
 
170
169
  c_strs_p = []
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
- f = attach_extension_function( "clGetGLContextInfoKHR", :cl_int, [:pointer, :cl_gl_context_info, :size_t, :pointer, :pointer] )
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 )
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
- # Creates a new Device and retains it if specified and aplicable
923
- def initialize(ptr, retain = true)
924
- super(ptr)
925
- if platform.version_number >= 1.2 and retain then
926
- error = OpenCL.clRetainDevice(ptr)
927
- error_check( error )
928
- end
929
- end
930
-
931
- # method called at Device deletion, releases the object if aplicable
932
- # @private
933
- def self.release(ptr)
934
- plat = FFI::MemoryPointer::new( Platform )
935
- OpenCL.clGetDeviceInfo( ptr, OpenCL::Device::PLATFORM, plat.size, plat, nil)
936
- platform = OpenCL::Platform::new(plat.read_pointer)
937
- if platform.version_number >= 1.2 then
938
- OpenCL.clReleaseDevice(ptr)
939
- end
940
- end
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
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'opencl_ruby_ffi'
3
- s.version = "1.3.2"
3
+ s.version = "1.3.3"
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"
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.2
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: 2016-05-27 00:00:00.000000000 Z
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