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 +4 -4
- data/lib/opencl_ruby_ffi/Device.rb +18 -1
- data/lib/opencl_ruby_ffi/Program.rb +2 -2
- data/opencl_ruby_ffi.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3dcf4b8021f9c49c828c7a503eeb9f9e0d1e600c
|
4
|
+
data.tar.gz: 1307599f84de5d549f9f9d9e9196e0585018431d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 =
|
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].
|
137
|
-
p = FFI::MemoryPointer::new(binaries[indx].
|
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
|
}
|
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.0.
|
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-
|
11
|
+
date: 2015-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: narray
|