BOAST 0.999 → 0.9991
Sign up to get free protection for your applications and to get access to all the features.
- data/BOAST.gemspec +1 -1
- data/lib/BOAST/CKernel.rb +34 -13
- data/lib/BOAST/Procedure.rb +3 -1
- data/lib/BOAST/Variable.rb +1 -1
- metadata +2 -2
data/BOAST.gemspec
CHANGED
data/lib/BOAST/CKernel.rb
CHANGED
@@ -20,6 +20,10 @@ module BOAST
|
|
20
20
|
:NVCCFLAGS => '-O2',
|
21
21
|
:LDFLAGS => '',
|
22
22
|
:CLFLAGS => '',
|
23
|
+
:CLVENDOR => nil,
|
24
|
+
:CLPLATFORM => nil,
|
25
|
+
:CLDEVICE => nil,
|
26
|
+
:CLDEVICETYPE => nil,
|
23
27
|
:openmp => false
|
24
28
|
}
|
25
29
|
|
@@ -252,27 +256,44 @@ module BOAST
|
|
252
256
|
return ld_flags
|
253
257
|
end
|
254
258
|
|
255
|
-
def
|
256
|
-
require 'opencl_ruby_ffi'
|
257
|
-
platform = nil
|
259
|
+
def select_cl_platform(options)
|
258
260
|
platforms = OpenCL::get_platforms
|
259
261
|
if options[:platform_vendor] then
|
260
|
-
platforms.
|
261
|
-
|
262
|
+
platforms.select!{ |p|
|
263
|
+
p.vendor.match(options[:platform_vendor])
|
264
|
+
}
|
265
|
+
elsif options[:CLVENDOR] then
|
266
|
+
platforms.select!{ |p|
|
267
|
+
p.vendor.match(options[:CLVENDOR])
|
262
268
|
}
|
263
|
-
else
|
264
|
-
platform = platforms.first
|
265
269
|
end
|
266
|
-
|
267
|
-
|
270
|
+
if options[:CLPLATFORM] then
|
271
|
+
platforms.select!{ |p|
|
272
|
+
p.name.match(options[:CLPLATFORM])
|
273
|
+
}
|
274
|
+
end
|
275
|
+
return platforms.first
|
276
|
+
end
|
277
|
+
|
278
|
+
def select_cl_device(options)
|
279
|
+
platform = select_cl_platform(options)
|
280
|
+
type = options[:device_type] ? OpenCL::Device::Type.const_get(options[:device_type]) : options[:CLDEVICETYPE] ? OpenCL::Device::Type.const_get(options[:CLDEVICETYPE]) : OpenCL::Device::Type::ALL
|
268
281
|
devices = platform.devices(type)
|
269
282
|
if options[:device_name] then
|
270
|
-
devices.
|
271
|
-
|
283
|
+
devices.select!{ |d|
|
284
|
+
d.name.match(options[:device_name])
|
285
|
+
}
|
286
|
+
elsif options[:CLDEVICE] then
|
287
|
+
devices.select!{ |d|
|
288
|
+
d.name.match(options[:CLDEVICE])
|
272
289
|
}
|
273
|
-
else
|
274
|
-
device = devices.first
|
275
290
|
end
|
291
|
+
return devices.first
|
292
|
+
end
|
293
|
+
|
294
|
+
def build_opencl(options)
|
295
|
+
require 'opencl_ruby_ffi'
|
296
|
+
device = select_cl_device(options)
|
276
297
|
@context = OpenCL::create_context([device])
|
277
298
|
program = @context.create_program_with_source([@code.string])
|
278
299
|
opts = options[:CLFLAGS]
|
data/lib/BOAST/Procedure.rb
CHANGED
@@ -109,7 +109,9 @@ module BOAST
|
|
109
109
|
# s += self.header(BOAST::get_lang,false)
|
110
110
|
# s += ";\n"
|
111
111
|
if BOAST::get_lang == CL then
|
112
|
-
if
|
112
|
+
if @properties[:local] then
|
113
|
+
s += "static "
|
114
|
+
else
|
113
115
|
s += "__kernel "
|
114
116
|
wgs = @properties[:reqd_work_group_size]
|
115
117
|
if wgs then
|
data/lib/BOAST/Variable.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: BOAST
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.9991'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-08-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: narray
|