BOAST 1.2.2 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/BOAST.gemspec +2 -2
  3. data/lib/BOAST.rb +1 -0
  4. data/lib/BOAST/Language/Algorithm.rb +68 -30
  5. data/lib/BOAST/Language/Annotation.rb +1 -0
  6. data/lib/BOAST/Language/Architectures.rb +1 -0
  7. data/lib/BOAST/Language/Arithmetic.rb +15 -9
  8. data/lib/BOAST/Language/BOAST_OpenCL.rb +94 -87
  9. data/lib/BOAST/Language/CPUID_by_name.rb +1 -0
  10. data/lib/BOAST/Language/Case.rb +6 -0
  11. data/lib/BOAST/Language/CodeBlock.rb +1 -0
  12. data/lib/BOAST/Language/Comment.rb +14 -11
  13. data/lib/BOAST/Language/Config.rb +23 -15
  14. data/lib/BOAST/Language/ControlStructure.rb +10 -2
  15. data/lib/BOAST/Language/DataTypes.rb +23 -15
  16. data/lib/BOAST/Language/Expression.rb +3 -0
  17. data/lib/BOAST/Language/For.rb +31 -26
  18. data/lib/BOAST/Language/FuncCall.rb +7 -0
  19. data/lib/BOAST/Language/Functors.rb +56 -19
  20. data/lib/BOAST/Language/If.rb +3 -0
  21. data/lib/BOAST/Language/Index.rb +11 -9
  22. data/lib/BOAST/Language/Intrinsics.rb +2 -0
  23. data/lib/BOAST/Language/OpenMP.rb +57 -40
  24. data/lib/BOAST/Language/Operators.rb +27 -19
  25. data/lib/BOAST/Language/Pragma.rb +1 -0
  26. data/lib/BOAST/Language/Print.rb +3 -0
  27. data/lib/BOAST/Language/Procedure.rb +81 -76
  28. data/lib/BOAST/Language/Slice.rb +16 -14
  29. data/lib/BOAST/Language/State.rb +126 -55
  30. data/lib/BOAST/Language/Transitions.rb +26 -26
  31. data/lib/BOAST/Language/Variable.rb +89 -58
  32. data/lib/BOAST/Language/While.rb +3 -0
  33. data/lib/BOAST/Runtime/AffinityProbe.rb +65 -0
  34. data/lib/BOAST/Runtime/CKernel.rb +44 -1
  35. data/lib/BOAST/Runtime/CRuntime.rb +3 -0
  36. data/lib/BOAST/Runtime/CUDARuntime.rb +3 -0
  37. data/lib/BOAST/Runtime/CompiledRuntime.rb +4 -0
  38. data/lib/BOAST/Runtime/Compilers.rb +6 -5
  39. data/lib/BOAST/Runtime/Config.rb +1 -1
  40. data/lib/BOAST/Runtime/FFIRuntime.rb +3 -0
  41. data/lib/BOAST/Runtime/FORTRANRuntime.rb +3 -0
  42. data/lib/BOAST/Runtime/MPPARuntime.rb +2 -0
  43. data/lib/BOAST/Runtime/NonRegression.rb +5 -3
  44. data/lib/BOAST/Runtime/OpenCLRuntime.rb +7 -10
  45. data/lib/BOAST/Runtime/Probe.rb +2 -0
  46. metadata +7 -6
@@ -1,8 +1,11 @@
1
1
  module BOAST
2
2
 
3
+ # @private
3
4
  module CRuntime
4
5
  include CompiledRuntime
5
6
 
7
+ private
8
+
6
9
  def fill_library_header
7
10
  get_output.puts "#include <stdlib.h>"
8
11
  get_output.puts "#include <inttypes.h>"
@@ -1,8 +1,11 @@
1
1
  module BOAST
2
2
 
3
+ # @private
3
4
  module CUDARuntime
4
5
  include CRuntime
5
6
 
7
+ private
8
+
6
9
  alias fill_library_source_old fill_library_source
7
10
  alias fill_library_header_old fill_library_header
8
11
  alias fill_module_header_old fill_module_header
@@ -34,6 +34,8 @@ module BOAST
34
34
  attr_accessor :binary
35
35
  attr_accessor :source
36
36
 
37
+ private
38
+
37
39
  @@extensions = {
38
40
  C => ".c",
39
41
  CUDA => ".cu",
@@ -391,6 +393,8 @@ EOF
391
393
  }
392
394
  end
393
395
 
396
+ public
397
+
394
398
  def build(options={})
395
399
  compiler_options = BOAST::get_compiler_options
396
400
  compiler_options.update(options)
@@ -5,6 +5,7 @@ require 'os'
5
5
 
6
6
  module BOAST
7
7
 
8
+ # @private
8
9
  module Compilers
9
10
  include Rake::DSL
10
11
 
@@ -51,7 +52,7 @@ module BOAST
51
52
  cflags += " -DHAVE_NARRAY_H" if narray_path
52
53
  cflags += " -I/usr/local/k1tools/include" if @architecture == MPPA
53
54
  objext = RbConfig::CONFIG["OBJEXT"]
54
- if options[:openmp] and @lang == C and not disable_openmp then
55
+ if (options[:openmp] or options[:OPENMP]) and @lang == C and not disable_openmp then
55
56
  openmp_cflags = get_openmp_flags(c_compiler)
56
57
  raise "unkwown openmp flags for: #{c_compiler}" if not openmp_cflags
57
58
  cflags += " #{openmp_cflags}"
@@ -79,7 +80,7 @@ module BOAST
79
80
  cxx_compiler = options[:CXX]
80
81
  cxxflags = options[:CXXFLAGS]
81
82
  cxxflags += " -fPIC #{includes}"
82
- if options[:openmp] and @lang == C and not disable_openmp then
83
+ if (options[:openmp] or options[:OPENMP]) and @lang == C and not disable_openmp then
83
84
  openmp_cxxflags = get_openmp_flags(cxx_compiler)
84
85
  raise "unkwown openmp flags for: #{cxx_compiler}" if not openmp_cxxflags
85
86
  cxxflags += " #{openmp_cxxflags}"
@@ -97,7 +98,7 @@ module BOAST
97
98
  fcflags += " -march=#{get_model}"
98
99
  fcflags += " -fPIC"
99
100
  fcflags += " -fno-second-underscore" if f_compiler == 'g95'
100
- if options[:openmp] and @lang == FORTRAN and not disable_openmp then
101
+ if (options[:openmp] or options[:OPENMP]) and @lang == FORTRAN and not disable_openmp then
101
102
  openmp_fcflags = get_openmp_flags(f_compiler)
102
103
  raise "unkwown openmp flags for: #{f_compiler}" if not openmp_fcflags
103
104
  fcflags += " #{openmp_fcflags}"
@@ -152,7 +153,7 @@ module BOAST
152
153
  c_compiler = "cc" if not c_compiler
153
154
  linker = options[:LD]
154
155
  linker = c_compiler if not linker
155
- if options[:openmp] and not disable_openmp then
156
+ if (options[:openmp] or options[:OPENMP]) and not disable_openmp then
156
157
  openmp_ldflags = get_openmp_flags(linker)
157
158
  raise "unknown openmp flags for: #{linker}" if not openmp_ldflags
158
159
  ldflags += " #{openmp_ldflags}"
@@ -171,7 +172,7 @@ module BOAST
171
172
 
172
173
  def setup_compilers(options = {})
173
174
  Rake::Task::clear
174
- verbose = options[:verbose]
175
+ verbose = options[:VERBOSE]
175
176
  verbose = get_verbose if not verbose
176
177
  Rake::verbose(verbose)
177
178
  Rake::FileUtilsExt.verbose_flag=verbose
@@ -19,7 +19,7 @@ module BOAST
19
19
  :CLDEVICETYPE => nil,
20
20
  :MAQAO => 'maqao',
21
21
  :MAQAO_FLAGS => '',
22
- :openmp => false
22
+ :OPENMP => false
23
23
  }
24
24
 
25
25
  @@openmp_default_flags = {
@@ -1,7 +1,10 @@
1
1
  module BOAST
2
2
 
3
+ # @private
3
4
  module FFIRuntime
4
5
 
6
+ private
7
+
5
8
  def target
6
9
  return library_path
7
10
  end
@@ -1,8 +1,11 @@
1
1
  module BOAST
2
2
 
3
+ # @private
3
4
  module FORTRANRuntime
4
5
  include CompiledRuntime
5
6
 
7
+ private
8
+
6
9
  def method_name
7
10
  return @procedure.name + "_"
8
11
  end
@@ -1,5 +1,6 @@
1
1
  module BOAST
2
2
 
3
+ # @private
3
4
  module MPPAProbe
4
5
  extend PrivateStateAccessor
5
6
 
@@ -54,6 +55,7 @@ EOF
54
55
 
55
56
  end
56
57
 
58
+ # @private
57
59
  module MPPARuntime
58
60
  include CRuntime
59
61
 
@@ -2,11 +2,11 @@ module BOAST
2
2
 
3
3
  class CKernel
4
4
 
5
- def load_ref_inputs(path = "", suffix = ".in" )
5
+ def load_ref_inputs(path = ".", suffix = ".in" )
6
6
  return load_ref_files( path, suffix, :in )
7
7
  end
8
8
 
9
- def load_ref_outputs(path = "", suffix = ".out" )
9
+ def load_ref_outputs(path = ".", suffix = ".out" )
10
10
  return load_ref_files( path, suffix, :out )
11
11
  end
12
12
 
@@ -32,6 +32,8 @@ module BOAST
32
32
  return res
33
33
  end
34
34
 
35
+ private
36
+
35
37
  def get_array_type(param)
36
38
  if param.type.class == Real then
37
39
  case param.type.size
@@ -130,7 +132,7 @@ module BOAST
130
132
  return res
131
133
  end
132
134
 
133
- def load_ref_files( path = "", suffix = "", intent )
135
+ def load_ref_files( path, suffix, intent )
134
136
  proc_path = path + "/#{@procedure.name}/"
135
137
  res_h = {}
136
138
  begin
@@ -1,4 +1,6 @@
1
1
  module BOAST
2
+
3
+ # @private
2
4
  module OpenCLRuntime
3
5
 
4
6
  attr_reader :context
@@ -6,11 +8,7 @@ module BOAST
6
8
 
7
9
  def select_cl_platforms(options)
8
10
  platforms = OpenCL::get_platforms
9
- if options[:platform_vendor] then
10
- platforms.select!{ |p|
11
- p.vendor.match(options[:platform_vendor])
12
- }
13
- elsif options[:CLVENDOR] then
11
+ if options[:CLVENDOR] then
14
12
  platforms.select!{ |p|
15
13
  p.vendor.match(options[:CLVENDOR])
16
14
  }
@@ -30,12 +28,11 @@ module BOAST
30
28
  devices = context.devices
31
29
  else
32
30
  platforms = select_cl_platforms(options)
33
- 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
31
+ type = options[:CLDEVICETYPE] ? OpenCL::Device::Type.const_get(options[:CLDEVICETYPE]) : OpenCL::Device::Type::ALL
34
32
  devices = platforms.collect { |plt| plt.devices(type) }
35
33
  devices.flatten!
36
34
  end
37
- name_pattern = options[:device_name]
38
- name_pattern = options[:CLDEVICE] unless name_pattern
35
+ name_pattern = options[:CLDEVICE]
39
36
  if name_pattern then
40
37
  devices.select!{ |d|
41
38
  d.name.match(name_pattern)
@@ -63,12 +60,12 @@ module BOAST
63
60
  puts e.to_s
64
61
  puts program.build_status
65
62
  puts program.build_log
66
- if options[:verbose] or get_verbose then
63
+ if options[:VERBOSE] or get_verbose then
67
64
  puts @code.string
68
65
  end
69
66
  raise "OpenCL Failed to build #{@procedure.name}"
70
67
  end
71
- if options[:verbose] or get_verbose then
68
+ if options[:VERBOSE] or get_verbose then
72
69
  program.build_log.each {|dev,log|
73
70
  puts "#{device.name}: #{log}"
74
71
  }
@@ -1,5 +1,6 @@
1
1
  module BOAST
2
2
 
3
+ # @private
3
4
  module TimerProbe
4
5
  extend PrivateStateAccessor
5
6
 
@@ -64,6 +65,7 @@ EOF
64
65
 
65
66
  end
66
67
 
68
+ # @private
67
69
  module PAPIProbe
68
70
  extend PrivateStateAccessor
69
71
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: BOAST
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.3.0
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-17 00:00:00.000000000 Z
11
+ date: 2016-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: narray
@@ -56,20 +56,20 @@ dependencies:
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: '1.2'
59
+ version: '1.3'
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: 1.2.1
62
+ version: 1.3.2
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '1.2'
69
+ version: '1.3'
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
- version: 1.2.1
72
+ version: 1.3.2
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: systemu
75
75
  requirement: !ruby/object:Gem::Requirement
@@ -228,6 +228,7 @@ files:
228
228
  - lib/BOAST/Language/Variable.rb
229
229
  - lib/BOAST/Language/While.rb
230
230
  - lib/BOAST/Optimization/Optimization.rb
231
+ - lib/BOAST/Runtime/AffinityProbe.rb
231
232
  - lib/BOAST/Runtime/CKernel.rb
232
233
  - lib/BOAST/Runtime/CRuntime.rb
233
234
  - lib/BOAST/Runtime/CUDARuntime.rb