BOAST 1.0.3 → 1.0.4
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 +4 -4
- data/BOAST.gemspec +2 -31
- data/README.md +240 -0
- data/lib/BOAST/{OpenMP.rb → Language/OpenMP.rb} +1 -0
- data/lib/BOAST/{Variable.rb → Language/Variable.rb} +2 -1
- data/lib/BOAST/Runtime/CKernel.rb +94 -0
- data/lib/BOAST/Runtime/CRuntime.rb +32 -0
- data/lib/BOAST/Runtime/CUDARuntime.rb +158 -0
- data/lib/BOAST/Runtime/CompiledRuntime.rb +398 -0
- data/lib/BOAST/Runtime/Compilers.rb +205 -0
- data/lib/BOAST/Runtime/Config.rb +94 -0
- data/lib/BOAST/Runtime/FFIRuntime.rb +104 -0
- data/lib/BOAST/Runtime/FORTRANRuntime.rb +45 -0
- data/lib/BOAST/Runtime/MPPARuntime.rb +464 -0
- data/lib/BOAST/Runtime/NonRegression.rb +157 -0
- data/lib/BOAST/Runtime/OpenCLRuntime.rb +181 -0
- data/lib/BOAST/Runtime/Probe.rb +136 -0
- data/lib/BOAST.rb +37 -26
- metadata +40 -28
- data/lib/BOAST/CKernel.rb +0 -1236
- /data/lib/BOAST/{Algorithm.rb → Language/Algorithm.rb} +0 -0
- /data/lib/BOAST/{Arithmetic.rb → Language/Arithmetic.rb} +0 -0
- /data/lib/BOAST/{BOAST_OpenCL.rb → Language/BOAST_OpenCL.rb} +0 -0
- /data/lib/BOAST/{Case.rb → Language/Case.rb} +0 -0
- /data/lib/BOAST/{ControlStructure.rb → Language/ControlStructure.rb} +0 -0
- /data/lib/BOAST/{DataTypes.rb → Language/DataTypes.rb} +0 -0
- /data/lib/BOAST/{Expression.rb → Language/Expression.rb} +0 -0
- /data/lib/BOAST/{For.rb → Language/For.rb} +0 -0
- /data/lib/BOAST/{FuncCall.rb → Language/FuncCall.rb} +0 -0
- /data/lib/BOAST/{Functors.rb → Language/Functors.rb} +0 -0
- /data/lib/BOAST/{If.rb → Language/If.rb} +0 -0
- /data/lib/BOAST/{Index.rb → Language/Index.rb} +0 -0
- /data/lib/BOAST/{Inspectable.rb → Language/Inspectable.rb} +0 -0
- /data/lib/BOAST/{Operators.rb → Language/Operators.rb} +0 -0
- /data/lib/BOAST/{Optimization.rb → Language/Optimization.rb} +0 -0
- /data/lib/BOAST/{Parens.rb → Language/Parens.rb} +0 -0
- /data/lib/BOAST/{Pragma.rb → Language/Pragma.rb} +0 -0
- /data/lib/BOAST/{Print.rb → Language/Print.rb} +0 -0
- /data/lib/BOAST/{Procedure.rb → Language/Procedure.rb} +0 -0
- /data/lib/BOAST/{Slice.rb → Language/Slice.rb} +0 -0
- /data/lib/BOAST/{State.rb → Language/State.rb} +0 -0
- /data/lib/BOAST/{Transitions.rb → Language/Transitions.rb} +0 -0
- /data/lib/BOAST/{While.rb → Language/While.rb} +0 -0
@@ -0,0 +1,157 @@
|
|
1
|
+
module BOAST
|
2
|
+
|
3
|
+
class CKernel
|
4
|
+
|
5
|
+
def load_ref_inputs(path = "", suffix = ".in" )
|
6
|
+
return load_ref_files( path, suffix, :in )
|
7
|
+
end
|
8
|
+
|
9
|
+
def load_ref_outputs(path = "", suffix = ".out" )
|
10
|
+
return load_ref_files( path, suffix, :out )
|
11
|
+
end
|
12
|
+
|
13
|
+
def compare_ref(ref_outputs, outputs, epsilon = nil)
|
14
|
+
res = {}
|
15
|
+
@procedure.parameters.each_with_index { |param, indx|
|
16
|
+
if param.direction == :in or param.constant then
|
17
|
+
next
|
18
|
+
end
|
19
|
+
if param.dimension then
|
20
|
+
diff = (outputs[indx] - ref_outputs[indx]).abs
|
21
|
+
if epsilon then
|
22
|
+
diff.each { |elem|
|
23
|
+
raise "Error: #{param.name} different from ref by: #{elem}!" if elem > epsilon
|
24
|
+
}
|
25
|
+
end
|
26
|
+
res[param.name] = diff.max
|
27
|
+
else
|
28
|
+
raise "Error: #{param.name} different from ref: #{outputs[indx]} != #{ref_outputs[indx]} !" if epsilon and (outputs[indx] - ref_outputs[indx]).abs > epsilon
|
29
|
+
res[param.name] = (outputs[indx] - ref_outputs[indx]).abs
|
30
|
+
end
|
31
|
+
}
|
32
|
+
return res
|
33
|
+
end
|
34
|
+
|
35
|
+
def get_array_type(param)
|
36
|
+
if param.type.class == Real then
|
37
|
+
case param.type.size
|
38
|
+
when 4
|
39
|
+
type = NArray::SFLOAT
|
40
|
+
when 8
|
41
|
+
type = NArray::FLOAT
|
42
|
+
else
|
43
|
+
STDERR::puts "Unsupported Float size for NArray: #{param.type.size}, defaulting to byte" if debug?
|
44
|
+
type = NArray::BYTE
|
45
|
+
end
|
46
|
+
elsif param.type.class == Int then
|
47
|
+
case param.type.size
|
48
|
+
when 1
|
49
|
+
type = NArray::BYTE
|
50
|
+
when 2
|
51
|
+
type = NArray::SINT
|
52
|
+
when 4
|
53
|
+
type = NArray::SINT
|
54
|
+
else
|
55
|
+
STDERR::puts "Unsupported Int size for NArray: #{param.type.size}, defaulting to byte" if debug?
|
56
|
+
type = NArray::BYTE
|
57
|
+
end
|
58
|
+
else
|
59
|
+
STDERR::puts "Unkown array type for NArray: #{param.type}, defaulting to byte" if debug?
|
60
|
+
type = NArray::BYTE
|
61
|
+
end
|
62
|
+
return type
|
63
|
+
end
|
64
|
+
|
65
|
+
def get_scalar_type(param)
|
66
|
+
if param.type.class == Real then
|
67
|
+
case param.type.size
|
68
|
+
when 4
|
69
|
+
type = "f"
|
70
|
+
when 8
|
71
|
+
type = "d"
|
72
|
+
else
|
73
|
+
raise "Unsupported Real scalar size: #{param.type.size}!"
|
74
|
+
end
|
75
|
+
elsif param.type.class == Int then
|
76
|
+
case param.type.size
|
77
|
+
when 1
|
78
|
+
type = "C"
|
79
|
+
when 2
|
80
|
+
type = "S"
|
81
|
+
when 4
|
82
|
+
type = "L"
|
83
|
+
when 8
|
84
|
+
type = "Q"
|
85
|
+
else
|
86
|
+
raise "Unsupported Int scalar size: #{param.type.size}!"
|
87
|
+
end
|
88
|
+
if param.type.signed? then
|
89
|
+
type.downcase!
|
90
|
+
end
|
91
|
+
end
|
92
|
+
return type
|
93
|
+
end
|
94
|
+
|
95
|
+
def read_param(param, directory, suffix, intent)
|
96
|
+
if intent == :out and ( param.direction == :in or param.constant ) then
|
97
|
+
return nil
|
98
|
+
end
|
99
|
+
f = File::new( directory + "/" + param.name+suffix, "rb" )
|
100
|
+
if param.dimension then
|
101
|
+
type = get_array_type(param)
|
102
|
+
if f.size == 0 then
|
103
|
+
res = NArray::new(type, 1)
|
104
|
+
else
|
105
|
+
res = NArray.to_na(f.read, type)
|
106
|
+
end
|
107
|
+
else
|
108
|
+
type = get_scalar_type(param)
|
109
|
+
res = f.read.unpack(type).first
|
110
|
+
end
|
111
|
+
f.close
|
112
|
+
return res
|
113
|
+
end
|
114
|
+
|
115
|
+
def get_gpu_dim(directory)
|
116
|
+
f = File::new( directory + "/problem_size", "r")
|
117
|
+
s = f.read
|
118
|
+
local_dim, global_dim = s.scan(/<(.*?)>/)
|
119
|
+
local_dim = local_dim.pop.split(",").collect!{ |e| e.to_i }
|
120
|
+
global_dim = global_dim.pop.split(",").collect!{ |e| e.to_i }
|
121
|
+
(local_dim.length..2).each{ |i| local_dim[i] = 1 }
|
122
|
+
(global_dim.length..2).each{ |i| global_dim[i] = 1 }
|
123
|
+
if @lang == CL then
|
124
|
+
local_dim.each_index { |indx| global_dim[indx] *= local_dim[indx] }
|
125
|
+
res = { :global_work_size => global_dim, :local_work_size => local_dim }
|
126
|
+
else
|
127
|
+
res = { :block_number => global_dim, :block_size => local_dim }
|
128
|
+
end
|
129
|
+
f.close
|
130
|
+
return res
|
131
|
+
end
|
132
|
+
|
133
|
+
def load_ref_files( path = "", suffix = "", intent )
|
134
|
+
proc_path = path + "/#{@procedure.name}/"
|
135
|
+
res_h = {}
|
136
|
+
begin
|
137
|
+
dirs = Pathname.new(proc_path).children.select { |c| c.directory? }
|
138
|
+
rescue
|
139
|
+
return res_h
|
140
|
+
end
|
141
|
+
dirs.collect! { |d| d.to_s }
|
142
|
+
dirs.each { |d|
|
143
|
+
res = []
|
144
|
+
@procedure.parameters.collect { |param|
|
145
|
+
res.push read_param(param, d, suffix, intent)
|
146
|
+
}
|
147
|
+
if @lang == CUDA or @lang == CL then
|
148
|
+
res.push get_gpu_dim(d)
|
149
|
+
end
|
150
|
+
res_h[d] = res
|
151
|
+
}
|
152
|
+
return res_h
|
153
|
+
end
|
154
|
+
|
155
|
+
end
|
156
|
+
|
157
|
+
end
|
@@ -0,0 +1,181 @@
|
|
1
|
+
module BOAST
|
2
|
+
module OpenCLRuntime
|
3
|
+
|
4
|
+
def select_cl_platform(options)
|
5
|
+
platforms = OpenCL::get_platforms
|
6
|
+
if options[:platform_vendor] then
|
7
|
+
platforms.select!{ |p|
|
8
|
+
p.vendor.match(options[:platform_vendor])
|
9
|
+
}
|
10
|
+
elsif options[:CLVENDOR] then
|
11
|
+
platforms.select!{ |p|
|
12
|
+
p.vendor.match(options[:CLVENDOR])
|
13
|
+
}
|
14
|
+
end
|
15
|
+
if options[:CLPLATFORM] then
|
16
|
+
platforms.select!{ |p|
|
17
|
+
p.name.match(options[:CLPLATFORM])
|
18
|
+
}
|
19
|
+
end
|
20
|
+
return platforms.first
|
21
|
+
end
|
22
|
+
|
23
|
+
def select_cl_device(options)
|
24
|
+
platform = select_cl_platform(options)
|
25
|
+
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
|
26
|
+
devices = platform.devices(type)
|
27
|
+
if options[:device_name] then
|
28
|
+
devices.select!{ |d|
|
29
|
+
d.name.match(options[:device_name])
|
30
|
+
}
|
31
|
+
elsif options[:CLDEVICE] then
|
32
|
+
devices.select!{ |d|
|
33
|
+
d.name.match(options[:CLDEVICE])
|
34
|
+
}
|
35
|
+
end
|
36
|
+
return devices.first
|
37
|
+
end
|
38
|
+
|
39
|
+
def init_opencl_types
|
40
|
+
@@opencl_real_types = {
|
41
|
+
2 => OpenCL::Half,
|
42
|
+
4 => OpenCL::Float,
|
43
|
+
8 => OpenCL::Double
|
44
|
+
}
|
45
|
+
|
46
|
+
@@opencl_int_types = {
|
47
|
+
true => {
|
48
|
+
1 => OpenCL::Char,
|
49
|
+
2 => OpenCL::Short,
|
50
|
+
4 => OpenCL::Int,
|
51
|
+
8 => OpenCL::Long
|
52
|
+
},
|
53
|
+
false => {
|
54
|
+
1 => OpenCL::UChar,
|
55
|
+
2 => OpenCL::UShort,
|
56
|
+
4 => OpenCL::UInt,
|
57
|
+
8 => OpenCL::ULong
|
58
|
+
}
|
59
|
+
}
|
60
|
+
end
|
61
|
+
|
62
|
+
def init_opencl(options)
|
63
|
+
require 'opencl_ruby_ffi'
|
64
|
+
init_opencl_types
|
65
|
+
device = select_cl_device(options)
|
66
|
+
@context = OpenCL::create_context([device])
|
67
|
+
program = @context.create_program_with_source([@code.string])
|
68
|
+
opts = options[:CLFLAGS]
|
69
|
+
begin
|
70
|
+
program.build(:options => options[:CLFLAGS])
|
71
|
+
rescue OpenCL::Error => e
|
72
|
+
puts e.to_s
|
73
|
+
puts program.build_status
|
74
|
+
puts program.build_log
|
75
|
+
if options[:verbose] or get_verbose then
|
76
|
+
puts @code.string
|
77
|
+
end
|
78
|
+
raise "OpenCL Failed to build #{@procedure.name}"
|
79
|
+
end
|
80
|
+
if options[:verbose] or get_verbose then
|
81
|
+
program.build_log.each {|dev,log|
|
82
|
+
puts "#{device.name}: #{log}"
|
83
|
+
}
|
84
|
+
end
|
85
|
+
@queue = @context.create_command_queue(device, :properties => OpenCL::CommandQueue::PROFILING_ENABLE)
|
86
|
+
@kernel = program.create_kernel(@procedure.name)
|
87
|
+
return self
|
88
|
+
end
|
89
|
+
|
90
|
+
def create_opencl_array(arg, parameter)
|
91
|
+
if parameter.direction == :in then
|
92
|
+
flags = OpenCL::Mem::Flags::READ_ONLY
|
93
|
+
elsif parameter.direction == :out then
|
94
|
+
flags = OpenCL::Mem::Flags::WRITE_ONLY
|
95
|
+
else
|
96
|
+
flags = OpenCL::Mem::Flags::READ_WRITE
|
97
|
+
end
|
98
|
+
if parameter.texture then
|
99
|
+
param = @context.create_image_2D( OpenCL::ImageFormat::new( OpenCL::ChannelOrder::R, OpenCL::ChannelType::UNORM_INT8 ), arg.size * arg.element_size, 1, :flags => flags )
|
100
|
+
@queue.enqueue_write_image( param, arg, :blocking => true )
|
101
|
+
else
|
102
|
+
param = @context.create_buffer( arg.size * arg.element_size, :flags => flags )
|
103
|
+
@queue.enqueue_write_buffer( param, arg, :blocking => true )
|
104
|
+
end
|
105
|
+
return param
|
106
|
+
end
|
107
|
+
|
108
|
+
def create_opencl_scalar(arg, parameter)
|
109
|
+
if parameter.type.is_a?(Real) then
|
110
|
+
return @@opencl_real_types[parameter.type.size]::new(arg)
|
111
|
+
elsif parameter.type.is_a?(Int) then
|
112
|
+
return @@opencl_int_types[parameter.type.signed][parameter.type.size]::new(arg)
|
113
|
+
else
|
114
|
+
return arg
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
def create_opencl_param(arg, parameter)
|
119
|
+
if parameter.dimension then
|
120
|
+
return create_opencl_array(arg, parameter)
|
121
|
+
else
|
122
|
+
return create_opencl_scalar(arg, parameter)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
def read_opencl_param(param, arg, parameter)
|
127
|
+
if parameter.texture then
|
128
|
+
@queue.enqueue_read_image( param, arg, :blocking => true )
|
129
|
+
else
|
130
|
+
@queue.enqueue_read_buffer( param, arg, :blocking => true )
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
def build(options={})
|
135
|
+
compiler_options = BOAST::get_compiler_options
|
136
|
+
compiler_options.update(options)
|
137
|
+
init_opencl(compiler_options)
|
138
|
+
|
139
|
+
run_method = <<EOF
|
140
|
+
def self.run(*args)
|
141
|
+
raise "Wrong number of arguments \#{args.length} for #{@procedure.parameters.length}" if args.length > #{@procedure.parameters.length+1} or args.length < #{@procedure.parameters.length}
|
142
|
+
params = []
|
143
|
+
opts = {}
|
144
|
+
opts = args.pop if args.length == #{@procedure.parameters.length+1}
|
145
|
+
@procedure.parameters.each_index { |i|
|
146
|
+
params[i] = create_opencl_param( args[i], @procedure.parameters[i] )
|
147
|
+
}
|
148
|
+
params.each_index{ |i|
|
149
|
+
@kernel.set_arg(i, params[i])
|
150
|
+
}
|
151
|
+
gws = opts[:global_work_size]
|
152
|
+
if not gws then
|
153
|
+
gws = []
|
154
|
+
opts[:block_number].each_index { |i|
|
155
|
+
gws.push(opts[:block_number][i]*opts[:block_size][i])
|
156
|
+
}
|
157
|
+
end
|
158
|
+
lws = opts[:local_work_size]
|
159
|
+
if not lws then
|
160
|
+
lws = opts[:block_size]
|
161
|
+
end
|
162
|
+
event = @queue.enqueue_NDrange_kernel(@kernel, gws, :local_work_size => lws)
|
163
|
+
@procedure.parameters.each_index { |i|
|
164
|
+
if @procedure.parameters[i].dimension and (@procedure.parameters[i].direction == :inout or @procedure.parameters[i].direction == :out) then
|
165
|
+
read_opencl_param( params[i], args[i], @procedure.parameters[i] )
|
166
|
+
end
|
167
|
+
}
|
168
|
+
result = {}
|
169
|
+
result[:start] = event.profiling_command_start
|
170
|
+
result[:end] = event.profiling_command_end
|
171
|
+
result[:duration] = (result[:end] - result[:start])/1000000000.0
|
172
|
+
return result
|
173
|
+
end
|
174
|
+
EOF
|
175
|
+
eval run_method
|
176
|
+
return self
|
177
|
+
end
|
178
|
+
|
179
|
+
end
|
180
|
+
|
181
|
+
end
|
@@ -0,0 +1,136 @@
|
|
1
|
+
module BOAST
|
2
|
+
|
3
|
+
module TimerProbe
|
4
|
+
extend PrivateStateAccessor
|
5
|
+
|
6
|
+
RESULT = BOAST::Int( "_boast_duration", :size => 8 )
|
7
|
+
|
8
|
+
module_function
|
9
|
+
|
10
|
+
def header
|
11
|
+
if OS.mac? then
|
12
|
+
get_output.print <<EOF
|
13
|
+
#if __cplusplus
|
14
|
+
extern "C" {
|
15
|
+
#endif
|
16
|
+
#include <mach/mach_time.h>
|
17
|
+
#if __cplusplus
|
18
|
+
}
|
19
|
+
#endif
|
20
|
+
EOF
|
21
|
+
else
|
22
|
+
get_output.print "#include <time.h>\n"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def decl
|
27
|
+
if OS.mac? then
|
28
|
+
get_output.print " uint64_t _mac_boast_start, _mac_boast_stop;\n"
|
29
|
+
get_output.print " mach_timebase_info_data_t _mac_boast_timebase_info;\n"
|
30
|
+
else
|
31
|
+
get_output.print " struct timespec _boast_start, _boast_stop;\n"
|
32
|
+
end
|
33
|
+
BOAST::decl RESULT
|
34
|
+
end
|
35
|
+
|
36
|
+
def configure
|
37
|
+
end
|
38
|
+
|
39
|
+
def start
|
40
|
+
if OS.mac? then
|
41
|
+
get_output.print " _mac_boast_start = mach_absolute_time();\n"
|
42
|
+
else
|
43
|
+
get_output.print " clock_gettime(CLOCK_REALTIME, &_boast_start);\n"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def stop
|
48
|
+
if OS.mac? then
|
49
|
+
get_output.print " _mac_boast_stop = mach_absolute_time();\n"
|
50
|
+
else
|
51
|
+
get_output.print " clock_gettime(CLOCK_REALTIME, &_boast_stop);\n"
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def compute
|
56
|
+
if @lang != CUDA then
|
57
|
+
if OS.mac? then
|
58
|
+
get_output.print " mach_timebase_info(&_mac_boast_timebase_info);\n"
|
59
|
+
get_output.print " #{RESULT} = (_mac_boast_stop - _mac_boast_start) * _mac_boast_timebase_info.numer / _mac_boast_timebase_info.denom;\n"
|
60
|
+
else
|
61
|
+
get_output.print " #{RESULT} = (_boast_stop.tv_sec - _boast_start.tv_sec) * (unsigned long long int)1000000000 + _boast_stop.tv_nsec - _boast_start.tv_nsec;\n"
|
62
|
+
end
|
63
|
+
get_output.print " rb_hash_aset(_boast_stats,ID2SYM(rb_intern(\"duration\")),rb_float_new((double)#{RESULT}*(double)1e-9));\n"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
module PAPIProbe
|
70
|
+
extend PrivateStateAccessor
|
71
|
+
|
72
|
+
module_function
|
73
|
+
|
74
|
+
def name
|
75
|
+
return "PAPI"
|
76
|
+
end
|
77
|
+
|
78
|
+
def header
|
79
|
+
end
|
80
|
+
|
81
|
+
def decl
|
82
|
+
get_output.print " VALUE _boast_event_set = Qnil;\n"
|
83
|
+
get_output.print " VALUE _boast_papi_results = Qnil;\n"
|
84
|
+
end
|
85
|
+
|
86
|
+
def configure
|
87
|
+
get_output.print <<EOF
|
88
|
+
if( _boast_rb_opts != Qnil ) {
|
89
|
+
VALUE _boast_PAPI_rb_ptr = Qnil;
|
90
|
+
_boast_PAPI_rb_ptr = rb_hash_aref(_boast_rb_opts, ID2SYM(rb_intern("PAPI")));
|
91
|
+
if( _boast_PAPI_rb_ptr != Qnil ) {
|
92
|
+
VALUE _boast_PAPI = Qnil;
|
93
|
+
VALUE _boast_EventSet = Qnil;
|
94
|
+
rb_eval_string("require 'PAPI'");
|
95
|
+
_boast_PAPI = rb_const_get(rb_cObject, rb_intern("PAPI"));
|
96
|
+
_boast_EventSet = rb_const_get(_boast_PAPI, rb_intern("EventSet"));
|
97
|
+
_boast_event_set = rb_funcall(_boast_EventSet, rb_intern("new"), 0);
|
98
|
+
rb_funcall(_boast_event_set, rb_intern("add_named"), 1, _boast_PAPI_rb_ptr);
|
99
|
+
}
|
100
|
+
}
|
101
|
+
EOF
|
102
|
+
end
|
103
|
+
|
104
|
+
def start
|
105
|
+
get_output.print <<EOF
|
106
|
+
if( _boast_event_set != Qnil) {
|
107
|
+
rb_funcall(_boast_event_set, rb_intern("start"), 0);
|
108
|
+
}
|
109
|
+
EOF
|
110
|
+
end
|
111
|
+
|
112
|
+
def stop
|
113
|
+
get_output.print <<EOF
|
114
|
+
if( _boast_event_set != Qnil) {
|
115
|
+
_boast_papi_results = rb_funcall(_boast_event_set, rb_intern("stop"), 0);
|
116
|
+
}
|
117
|
+
EOF
|
118
|
+
end
|
119
|
+
|
120
|
+
def compute
|
121
|
+
get_output.print <<EOF
|
122
|
+
if( _boast_papi_results != Qnil) {
|
123
|
+
VALUE _boast_papi_stats = Qnil;
|
124
|
+
_boast_papi_stats = rb_ary_new3(1,rb_hash_aref(_boast_rb_opts, ID2SYM(rb_intern("PAPI"))));
|
125
|
+
_boast_papi_stats = rb_funcall(_boast_papi_stats, rb_intern("flatten"), 0);
|
126
|
+
_boast_papi_stats = rb_funcall(_boast_papi_stats, rb_intern("zip"), 1, _boast_papi_results);
|
127
|
+
_boast_papi_results = rb_funcall(rb_const_get(rb_cObject, rb_intern("Hash")), rb_intern("send"), 2, ID2SYM(rb_intern("[]")), _boast_papi_stats );
|
128
|
+
rb_hash_aset(_boast_stats,ID2SYM(rb_intern(\"PAPI\")),_boast_papi_results);
|
129
|
+
}
|
130
|
+
EOF
|
131
|
+
end
|
132
|
+
|
133
|
+
end
|
134
|
+
|
135
|
+
end
|
136
|
+
|
data/lib/BOAST.rb
CHANGED
@@ -1,26 +1,37 @@
|
|
1
|
-
require 'BOAST/State.rb'
|
2
|
-
require 'BOAST/Functors.rb'
|
3
|
-
require 'BOAST/Inspectable.rb'
|
4
|
-
require 'BOAST/Transitions.rb'
|
5
|
-
require 'BOAST/Arithmetic.rb'
|
6
|
-
require 'BOAST/Operators.rb'
|
7
|
-
require 'BOAST/DataTypes.rb'
|
8
|
-
require 'BOAST/Expression.rb'
|
9
|
-
require 'BOAST/Index.rb'
|
10
|
-
require 'BOAST/Variable.rb'
|
11
|
-
require 'BOAST/Slice.rb'
|
12
|
-
require 'BOAST/FuncCall.rb'
|
13
|
-
require 'BOAST/Procedure.rb'
|
14
|
-
require 'BOAST/Algorithm.rb'
|
15
|
-
require 'BOAST/ControlStructure.rb'
|
16
|
-
require 'BOAST/OpenMP.rb'
|
17
|
-
require 'BOAST/If.rb'
|
18
|
-
require 'BOAST/For.rb'
|
19
|
-
require 'BOAST/Case.rb'
|
20
|
-
require 'BOAST/While.rb'
|
21
|
-
require 'BOAST/Pragma.rb'
|
22
|
-
require 'BOAST/
|
23
|
-
require 'BOAST/
|
24
|
-
require 'BOAST/
|
25
|
-
require 'BOAST/
|
26
|
-
require 'BOAST/
|
1
|
+
require 'BOAST/Language/State.rb'
|
2
|
+
require 'BOAST/Language/Functors.rb'
|
3
|
+
require 'BOAST/Language/Inspectable.rb'
|
4
|
+
require 'BOAST/Language/Transitions.rb'
|
5
|
+
require 'BOAST/Language/Arithmetic.rb'
|
6
|
+
require 'BOAST/Language/Operators.rb'
|
7
|
+
require 'BOAST/Language/DataTypes.rb'
|
8
|
+
require 'BOAST/Language/Expression.rb'
|
9
|
+
require 'BOAST/Language/Index.rb'
|
10
|
+
require 'BOAST/Language/Variable.rb'
|
11
|
+
require 'BOAST/Language/Slice.rb'
|
12
|
+
require 'BOAST/Language/FuncCall.rb'
|
13
|
+
require 'BOAST/Language/Procedure.rb'
|
14
|
+
require 'BOAST/Language/Algorithm.rb'
|
15
|
+
require 'BOAST/Language/ControlStructure.rb'
|
16
|
+
require 'BOAST/Language/OpenMP.rb'
|
17
|
+
require 'BOAST/Language/If.rb'
|
18
|
+
require 'BOAST/Language/For.rb'
|
19
|
+
require 'BOAST/Language/Case.rb'
|
20
|
+
require 'BOAST/Language/While.rb'
|
21
|
+
require 'BOAST/Language/Pragma.rb'
|
22
|
+
require 'BOAST/Runtime/Config.rb'
|
23
|
+
require 'BOAST/Runtime/Probe.rb'
|
24
|
+
require 'BOAST/Runtime/Compilers.rb'
|
25
|
+
require 'BOAST/Runtime/OpenCLRuntime.rb'
|
26
|
+
require 'BOAST/Runtime/CompiledRuntime.rb'
|
27
|
+
require 'BOAST/Runtime/CRuntime.rb'
|
28
|
+
require 'BOAST/Runtime/CUDARuntime.rb'
|
29
|
+
require 'BOAST/Runtime/FORTRANRuntime.rb'
|
30
|
+
require 'BOAST/Runtime/FFIRuntime.rb'
|
31
|
+
require 'BOAST/Runtime/MPPARuntime.rb'
|
32
|
+
require 'BOAST/Runtime/CKernel.rb'
|
33
|
+
require 'BOAST/Runtime/NonRegression.rb'
|
34
|
+
require 'BOAST/Language/Parens.rb'
|
35
|
+
require 'BOAST/Language/BOAST_OpenCL.rb'
|
36
|
+
require 'BOAST/Language/Optimization.rb'
|
37
|
+
require 'BOAST/Language/Print.rb'
|
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.0.
|
4
|
+
version: 1.0.4
|
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-
|
11
|
+
date: 2015-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: narray
|
@@ -153,33 +153,45 @@ extra_rdoc_files: []
|
|
153
153
|
files:
|
154
154
|
- BOAST.gemspec
|
155
155
|
- LICENSE
|
156
|
+
- README.md
|
156
157
|
- lib/BOAST.rb
|
157
|
-
- lib/BOAST/Algorithm.rb
|
158
|
-
- lib/BOAST/Arithmetic.rb
|
159
|
-
- lib/BOAST/BOAST_OpenCL.rb
|
160
|
-
- lib/BOAST/
|
161
|
-
- lib/BOAST/
|
162
|
-
- lib/BOAST/
|
163
|
-
- lib/BOAST/
|
164
|
-
- lib/BOAST/
|
165
|
-
- lib/BOAST/
|
166
|
-
- lib/BOAST/
|
167
|
-
- lib/BOAST/
|
168
|
-
- lib/BOAST/
|
169
|
-
- lib/BOAST/
|
170
|
-
- lib/BOAST/
|
171
|
-
- lib/BOAST/
|
172
|
-
- lib/BOAST/
|
173
|
-
- lib/BOAST/
|
174
|
-
- lib/BOAST/
|
175
|
-
- lib/BOAST/
|
176
|
-
- lib/BOAST/
|
177
|
-
- lib/BOAST/
|
178
|
-
- lib/BOAST/
|
179
|
-
- lib/BOAST/
|
180
|
-
- lib/BOAST/
|
181
|
-
- lib/BOAST/
|
182
|
-
- lib/BOAST/
|
158
|
+
- lib/BOAST/Language/Algorithm.rb
|
159
|
+
- lib/BOAST/Language/Arithmetic.rb
|
160
|
+
- lib/BOAST/Language/BOAST_OpenCL.rb
|
161
|
+
- lib/BOAST/Language/Case.rb
|
162
|
+
- lib/BOAST/Language/ControlStructure.rb
|
163
|
+
- lib/BOAST/Language/DataTypes.rb
|
164
|
+
- lib/BOAST/Language/Expression.rb
|
165
|
+
- lib/BOAST/Language/For.rb
|
166
|
+
- lib/BOAST/Language/FuncCall.rb
|
167
|
+
- lib/BOAST/Language/Functors.rb
|
168
|
+
- lib/BOAST/Language/If.rb
|
169
|
+
- lib/BOAST/Language/Index.rb
|
170
|
+
- lib/BOAST/Language/Inspectable.rb
|
171
|
+
- lib/BOAST/Language/OpenMP.rb
|
172
|
+
- lib/BOAST/Language/Operators.rb
|
173
|
+
- lib/BOAST/Language/Optimization.rb
|
174
|
+
- lib/BOAST/Language/Parens.rb
|
175
|
+
- lib/BOAST/Language/Pragma.rb
|
176
|
+
- lib/BOAST/Language/Print.rb
|
177
|
+
- lib/BOAST/Language/Procedure.rb
|
178
|
+
- lib/BOAST/Language/Slice.rb
|
179
|
+
- lib/BOAST/Language/State.rb
|
180
|
+
- lib/BOAST/Language/Transitions.rb
|
181
|
+
- lib/BOAST/Language/Variable.rb
|
182
|
+
- lib/BOAST/Language/While.rb
|
183
|
+
- lib/BOAST/Runtime/CKernel.rb
|
184
|
+
- lib/BOAST/Runtime/CRuntime.rb
|
185
|
+
- lib/BOAST/Runtime/CUDARuntime.rb
|
186
|
+
- lib/BOAST/Runtime/CompiledRuntime.rb
|
187
|
+
- lib/BOAST/Runtime/Compilers.rb
|
188
|
+
- lib/BOAST/Runtime/Config.rb
|
189
|
+
- lib/BOAST/Runtime/FFIRuntime.rb
|
190
|
+
- lib/BOAST/Runtime/FORTRANRuntime.rb
|
191
|
+
- lib/BOAST/Runtime/MPPARuntime.rb
|
192
|
+
- lib/BOAST/Runtime/NonRegression.rb
|
193
|
+
- lib/BOAST/Runtime/OpenCLRuntime.rb
|
194
|
+
- lib/BOAST/Runtime/Probe.rb
|
183
195
|
homepage: https://github.com/Nanosim-LIG/boast
|
184
196
|
licenses:
|
185
197
|
- BSD
|