BOAST 1.3.4 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,7 +32,7 @@ module BOAST
32
32
  module #{module_name}
33
33
  extend FFI::Library
34
34
  ffi_lib "#{library_path}"
35
- attach_function :#{method_name}, [ #{@procedure.parameters.collect{ |p| ":"+p.decl_ffi(false,@lang).to_s }.join(", ")} ], :#{@procedure.properties[:return] ? @procedure.properties[:return].type.decl_ffi(false,@lang) : "void" }
35
+ attach_function :#{method_name}, [ #{@procedure.parameters.collect{ |p| ":"+p.decl_ffi(false,@lang).to_s }.join(", ")} ], :#{@procedure.properties[:return] ? @procedure.properties[:return].type.decl_ffi : "void" }
36
36
  def run(*args)
37
37
  raise "Wrong number of arguments for \#{@procedure.name} (\#{args.length} for \#{@procedure.parameters.length})" if args.length < @procedure.parameters.length or args.length > @procedure.parameters.length + 1
38
38
  ev_set = nil
@@ -58,11 +58,11 @@ module BOAST
58
58
  }
59
59
  else
60
60
  @procedure.parameters.each_with_index { |p, i|
61
- if p.scalar_output? then
61
+ if p.scalar_output? or p.reference? then
62
62
  arg_p = FFI::MemoryPointer::new(p.decl_ffi(true, @lang))
63
63
  arg_p.send("write_\#{p.decl_ffi(true,@lang)}",args[i])
64
64
  t_args.push(arg_p)
65
- r_args[p] = arg_p
65
+ r_args[p] = arg_p if p.scalar_output?
66
66
  else
67
67
  t_args.push( args[i] )
68
68
  end
@@ -72,9 +72,15 @@ module BOAST
72
72
  counters = nil
73
73
  ev_set.start if ev_set
74
74
  begin
75
- start = Time::new
76
- ret = #{method_name}(*t_args)
77
- stop = Time::new
75
+ if options[:repeat] then
76
+ start = Time::new
77
+ options[:repeat].times { ret = #{method_name}(*t_args) }
78
+ stop = Time::new
79
+ else
80
+ start = Time::new
81
+ ret = #{method_name}(*t_args)
82
+ stop = Time::new
83
+ end
78
84
  ensure
79
85
  if ev_set then
80
86
  counters = ev_set.stop
@@ -25,7 +25,7 @@ module BOAST
25
25
  chunks = line.scan(/.{1,#{fortran_line_length-4}}/)
26
26
  s += chunks.join("&\n!$&") + "\n"
27
27
  end
28
- elsif line.match(/^\s*!/) then
28
+ elsif line.match(/^\s*!/) or line.match(/^\s*#include/) then
29
29
  s += line
30
30
  else
31
31
  chunks = line.scan(/.{1,#{fortran_line_length-2}}/)
@@ -36,7 +36,12 @@ module BOAST
36
36
  end
37
37
 
38
38
  def fill_library_source
39
- get_output.print line_limited_source
39
+ if fortran_line_length == 0 then
40
+ @code.rewind
41
+ get_output.write @code.read
42
+ else
43
+ get_output.print line_limited_source
44
+ end
40
45
  end
41
46
 
42
47
  def create_procedure_call_parameters
@@ -205,7 +205,7 @@ EOF
205
205
  #Parameters declaration
206
206
  @procedure.parameters.each { |param|
207
207
  get_output.print " #{param.type.decl} "
208
- get_output.print "*" if param.dimension or param.scalar_output?
208
+ get_output.print "*" if param.dimension or param.scalar_output? or param.reference?
209
209
  get_output.puts "#{param.name};"
210
210
  if param.dimension then
211
211
  get_output.puts " size_t _mppa_#{param}_size;"
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.3.4
4
+ version: 1.3.5
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-07-28 00:00:00.000000000 Z
11
+ date: 2016-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: narray