opencl_ruby_ffi 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b70a1f7693cf95d7be13695e3462dccfa46af4d3
4
- data.tar.gz: 4a191813b7b7638b33931afaa74aeccd9246ba65
3
+ metadata.gz: 3dcf4b8021f9c49c828c7a503eeb9f9e0d1e600c
4
+ data.tar.gz: 1307599f84de5d549f9f9d9e9196e0585018431d
5
5
  SHA512:
6
- metadata.gz: ff3e4bf3b550df5a645eb3a738f3510c1e9bf5551bd8619210bc489d0ac9bbce82ef9637007b71e94f41320034f8232b18b39a866da251d2692fcebf310bc9bc
7
- data.tar.gz: 86db94d389802daf7dd038b0a08c2e360671a00b219fb8149c2ad9a448b4246c3388ec397bcfcca0196a7ae908ac27f24588212171627cf0d5a8660289c6ef90
6
+ metadata.gz: 1e589b2ceeb66a8b86a2d4ac4aa28f19ec5c031fb1a1b5a99ff7c9afcc221a28df50897eeb8529366a876d7a82a839a8638335f0bda8060b4b8c84786750db8f
7
+ data.tar.gz: 93ea8a45aa81f3712f6e42298e8317bfe29c86fa088f6118e58aae9423b17cd89888be0f780be81d791312a72a7d5eeaf706876fda91cb695c6c09431c922824
@@ -61,10 +61,27 @@ module OpenCL
61
61
  ker = FFI::MemoryPointer::new( built_in_kernels_size.read_size_t )
62
62
  error = OpenCL.clGetDeviceInfo( self, BUILT_IN_KERNELS, built_in_kernels_size.read_size_t, ker, nil)
63
63
  error_check(error)
64
- ker_string = ext.read_string
64
+ ker_string = ker.read_string
65
65
  return ker_string.split(";")
66
66
  end
67
67
 
68
+ # Return an Array of String corresponding to the SPIR versions supported by the device
69
+ def spir_versions
70
+ spir_versions_size = FFI::MemoryPointer::new( :size_t )
71
+ error = OpenCL.clGetDeviceInfo( self, SPIR_VERSIONS, 0, nil, spir_versions_size)
72
+ error_check(error)
73
+ vers = FFI::MemoryPointer::new( spir_versions_size.read_size_t )
74
+ error = OpenCL.clGetDeviceInfo( self, SPIR_VERSIONS, spir_versions_size.read_size_t, vers, nil)
75
+ error_check(error)
76
+ vers_string = vers.read_string
77
+ return vers_string.split(" ")
78
+ end
79
+
80
+ def spir_versions_number
81
+ vers_strings = spir_versions
82
+ return vers_strings.collect { |s| s.scan(/(\d+\.\d+)/).first.first.to_f }
83
+ end
84
+
68
85
  %w( BUILT_IN_KERNELS DRIVER_VERSION VERSION VENDOR PROFILE OPENCL_C_VERSION NAME ).each { |prop|
69
86
  eval get_info("Device", :string, prop)
70
87
  }
@@ -133,8 +133,8 @@ module OpenCL
133
133
  binaries_p = FFI::MemoryPointer::new( :pointer, num_devices )
134
134
  num_devices.times { |indx|
135
135
  devices_p[indx].write_pointer(devices[indx])
136
- lengths[indx].write_size_t(binaries[indx].size)
137
- p = FFI::MemoryPointer::new(binaries[indx].size)
136
+ lengths[indx].write_size_t(binaries[indx].bytesize)
137
+ p = FFI::MemoryPointer::new(binaries[indx].bytesize)
138
138
  p.write_bytes(binaries[indx])
139
139
  binaries_p[indx].write_pointer(p)
140
140
  }
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'opencl_ruby_ffi'
3
- s.version = "1.0.2"
3
+ s.version = "1.0.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.0.2
4
+ version: 1.0.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: 2015-05-26 00:00:00.000000000 Z
11
+ date: 2015-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: narray