BOAST 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca2740cb851da646fa30581de14043280bd95ffe
4
- data.tar.gz: edafed822810e02453fc6418cea1da470ad47c8c
3
+ metadata.gz: ea64b71758e5e5a415024b05dffe731bf990a1ff
4
+ data.tar.gz: 6ecb5d7acdae700d5e9521491e3dd71ef751e550
5
5
  SHA512:
6
- metadata.gz: 8ae1bcaf2964999e45ba8ca1aab3642425f8c24dba9aff508106cf65d5b4baadd0709b3ef12349388dc6e8ea89ca6281de32df3a15bb29ebc87a1780291114da
7
- data.tar.gz: b0b4d95e68c5395a9d9740f7f59c900babfa419b261cd000add8d5238899c3178d2953ea073d4721ba397e6cb6678e17e040e1e8e90c82bef02fb7716c941ab9
6
+ metadata.gz: c827fa7966599f2f807f1f123c2b5a0781260092701d63767da7b75638142ab062b5469f1d14c4d760e1c11f3f693f66fadb085d6a494d5f64188de050433888
7
+ data.tar.gz: bbef18791ef66fd3b25ad9aaf7b75892e169204b5bb4fbe1da82eb43286b968c7da2e6cec46914aff6a072e27e203f05fe998084657e9d6dd87d86ac3cefe09e
data/BOAST.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'BOAST'
3
- s.version = "1.3.0"
3
+ s.version = "1.3.1"
4
4
  s.author = "Brice Videau"
5
5
  s.email = "brice.videau@imag.fr"
6
6
  s.homepage = "https://github.com/Nanosim-LIG/boast"
data/README.md CHANGED
@@ -4,6 +4,10 @@ BOAST
4
4
  This section will present some simple examples to familiarize the user
5
5
  with BOAST. More samples can be found in the git repository.
6
6
 
7
+ Documentation can be found here:
8
+ http://www.rubydoc.info/github/Nanosim-LIG/boast/master
9
+ .
10
+
7
11
  Installation
8
12
  ------------
9
13
 
@@ -77,6 +77,10 @@ module BOAST
77
77
  return false
78
78
  end
79
79
 
80
+ # Creates a new instance of Real.
81
+ # @param [Hash] hash contains named properties for the type
82
+ # @option hash [Integer] :size size of the Real type in byte. By default {BOAST.get_default_real_size}.
83
+ # @option hash [Integer] :vector_length length of the vector of Real. By default 1.
80
84
  def initialize(hash={})
81
85
  if hash[:size] then
82
86
  @size = hash[:size]
@@ -151,6 +155,11 @@ module BOAST
151
155
  return false
152
156
  end
153
157
 
158
+ # Creates a new instance of Int.
159
+ # @param [Hash] hash contains named properties for the type
160
+ # @option hash [Integer] :size size of the Int type in byte. By default {BOAST.get_default_int_size}.
161
+ # @option hash [Integer] :vector_length length of the vector of Int. By default 1.
162
+ # @option hash [Integer] :signed specifies if the Int is signed or not. By default {BOAST.get_default_int_signed}.
154
163
  def initialize(hash={})
155
164
  if hash[:size] then
156
165
  @size = hash[:size]
@@ -255,6 +264,10 @@ module BOAST
255
264
 
256
265
  attr_reader :name, :members, :members_array
257
266
 
267
+ # Creates a new structured type.
268
+ # @param [Hash] hash named options
269
+ # @option hash [#to_s] :type_name
270
+ # @option hash [Array<Variable>] :members list of Variable that create the type
258
271
  def initialize(hash={})
259
272
  @name = hash[:type_name]
260
273
  @members = {}
@@ -14,6 +14,12 @@ module BOAST
14
14
  attr_reader :properties
15
15
  attr_reader :headers
16
16
 
17
+ # Creates a new Procedure
18
+ # @param [#to_s] name Procedure identifier
19
+ # @param [Array<Variable>] parameters list of the procedure parameters.
20
+ # @param [Hash] properties set of named properties for the Procedure.
21
+ # @option properties [Array<Variables>] :constants list of constant variables that are used in the Procedure. (see parameter in Fortran).
22
+ # @option properties [Array<#to_s>] :headers list of headers that need to be included in order to compile the Procedure
17
23
  def initialize(name, parameters=[], properties={}, &block)
18
24
  @name = name
19
25
  @parameters = parameters
@@ -46,6 +52,7 @@ module BOAST
46
52
  return close_c if [C, CL, CUDA].include?( lang )
47
53
  end
48
54
 
55
+ # Returns a {CKernel} with the Procedure as entry point.
49
56
  def ckernel
50
57
  old_output = output
51
58
  k = CKernel::new
@@ -183,6 +190,9 @@ module BOAST
183
190
  s = indent + to_s_fortran
184
191
  s += "\n"
185
192
  increment_indent_level
193
+ parameters.each { |p|
194
+ p.type.define if p.type.kind_of? CStruct
195
+ }
186
196
  s += indent + "integer, parameter :: wp=kind(1.0d0)"
187
197
  output.puts s
188
198
  constants.each { |c|
@@ -38,14 +38,14 @@ module BOAST
38
38
  @val2 = v2
39
39
  end
40
40
 
41
- # Returns a {String} representation of the {Dimension}
41
+ # Returns a String representation of the {Dimension}
42
42
  def to_s
43
43
  if lang == FORTRAN and @val2 then
44
44
  return "#{@val1}:#{@val2}"
45
- elsif lang == FORTRAN and get_array_start != 1 then
46
- return "#{get_array_start}:#{@size-(1+get_array_start)}"
47
45
  elsif lang == FORTRAN and size.nil?
48
46
  return "*"
47
+ elsif lang == FORTRAN and get_array_start != 1 then
48
+ return "#{get_array_start}:#{@size-(1+get_array_start)}"
49
49
  else
50
50
  return @size.to_s
51
51
  end
@@ -234,7 +234,18 @@ module BOAST
234
234
  # Creates a new {Variable}
235
235
  # @param [#to_s] name
236
236
  # @param [DataType] type
237
- # @param [Hash] properties a set of named properties.
237
+ # @param [Hash] properties a set of named properties. Properties are also propagated to the {DataType}.
238
+ # @option properties [Symbol] :direction (or *:dir*) can be one of *:in*, *:out* or *:inout*. Specify the intent of the variable.
239
+ # @option properties [Array<Dimension>] :dimension (or *:dim*) variable is an array rather than a scalar. Dimensions are given in Fortran order (contiguous first).
240
+ # @option properties [Object] :constant (or *:const*) states that the variable is a constant and give its value. For Variable with the *:dimension* property set must be a {ConstArray}
241
+ # @option properties [Boolean] :restrict specifies that the compiler can assume no aliasing to this array.
242
+ # @option properties [Symbol] :allocate specify that the variable is to be allocated and where. Can only be *:heap* or *:stack* for now.
243
+ # @option properties [Boolean] :local indicates that the variable is to be allocated on the __local space of OpenCL devices or __shared__ space of CUDA devices. In C or FORTRAN this has the same effect as *:allocate* => *:stack*.
244
+ # @option properties [Boolean] :texture for OpenCL and CUDA. In OpenCL also specifies that a sampler has to be generated to access the array variable.
245
+ # @option properties [Integer] :align specifies the alignment the variable will be declared/allocated with if allocated or is supposed to have if it is coming from another context.
246
+ # @option properties [Boolean] :replace_constant specifies that for scalar constants this variable should be replaced by its constant value. For constant arrays, the value of the array will be replaced if the index can be determined at evaluation.
247
+ # @option properties [Boolean] :deferred_shape for Fortran interface generation mainly see Fortran documentation
248
+ # @option properties [Boolean] :optional for Fortran interface generation mainly see Fortran documentation
238
249
  def initialize(name, type, properties={})
239
250
  @name = name.to_s
240
251
  @direction = properties[:direction] ? properties[:direction] : properties[:dir]
@@ -189,6 +189,7 @@ EOF
189
189
 
190
190
  end
191
191
 
192
+ # @private
192
193
  class GenericOptimization
193
194
 
194
195
  attr_accessor :repeat
@@ -28,7 +28,7 @@ module BOAST
28
28
  fill_library_source_old
29
29
  get_output.write <<EOF
30
30
  extern "C" {
31
- #{@procedure.boast_header_s(CUDA)}{
31
+ #{@procedure.send(:boast_header_s,CUDA)}{
32
32
  dim3 dimBlock(block_size[0], block_size[1], block_size[2]);
33
33
  dim3 dimGrid(block_number[0], block_number[1], block_number[2]);
34
34
  cudaEvent_t __start, __stop;
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.0
4
+ version: 1.3.1
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-21 00:00:00.000000000 Z
11
+ date: 2016-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: narray
@@ -268,4 +268,3 @@ signing_key:
268
268
  specification_version: 4
269
269
  summary: BOAST is a computing kernel metaprogramming tool.
270
270
  test_files: []
271
- has_rdoc: false