BOAST 0.94 → 0.95
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.
- data/BOAST.gemspec +1 -1
- data/lib/BOAST/Algorithm.rb +16 -7
- data/lib/BOAST/CKernel.rb +2 -1
- data/lib/BOAST/Operators.rb +11 -0
- metadata +2 -2
data/BOAST.gemspec
CHANGED
data/lib/BOAST/Algorithm.rb
CHANGED
@@ -223,7 +223,11 @@ module BOAST
|
|
223
223
|
def ==(x)
|
224
224
|
return Expression::new("==",self,x)
|
225
225
|
end
|
226
|
-
|
226
|
+
|
227
|
+
def !=(x)
|
228
|
+
return Expression::new(BOAST::Different,self,x)
|
229
|
+
end
|
230
|
+
|
227
231
|
def +(x)
|
228
232
|
return Expression::new(BOAST::Addition,self,x)
|
229
233
|
end
|
@@ -553,6 +557,10 @@ module BOAST
|
|
553
557
|
return Expression::new("==",self,x)
|
554
558
|
end
|
555
559
|
|
560
|
+
def !=(x)
|
561
|
+
return Expression::new(BOAST::Different,self,x)
|
562
|
+
end
|
563
|
+
|
556
564
|
def >(x)
|
557
565
|
return Expression::new(">",self,x)
|
558
566
|
end
|
@@ -1371,14 +1379,15 @@ module BOAST
|
|
1371
1379
|
def to_str_fortran(constants, first)
|
1372
1380
|
s = ""
|
1373
1381
|
if first then
|
1374
|
-
s += "
|
1382
|
+
s += " "*BOAST::get_indent_level
|
1383
|
+
s += "select case (#{@expression})\n"
|
1375
1384
|
BOAST::increment_indent_level
|
1376
1385
|
else
|
1377
1386
|
BOAST::decrement_indent_level
|
1378
1387
|
end
|
1379
1388
|
s += " "*BOAST::get_indent_level
|
1380
1389
|
if constants and constants.size>0 then
|
1381
|
-
s += "case #{constants.join(" : ")}"
|
1390
|
+
s += "case (#{constants.join(" : ")})"
|
1382
1391
|
else
|
1383
1392
|
s += "case default"
|
1384
1393
|
end
|
@@ -1389,7 +1398,7 @@ module BOAST
|
|
1389
1398
|
def to_str_c(constants, first)
|
1390
1399
|
s = ""
|
1391
1400
|
if first then
|
1392
|
-
|
1401
|
+
s += " "*BOAST::get_indent_level
|
1393
1402
|
s += "switch(#{@expression}){\n"
|
1394
1403
|
BOAST::increment_indent_level
|
1395
1404
|
else
|
@@ -1480,10 +1489,10 @@ module BOAST
|
|
1480
1489
|
def to_str_fortran(condition, first)
|
1481
1490
|
s = ""
|
1482
1491
|
if first then
|
1483
|
-
s += "if #{condition} then"
|
1492
|
+
s += "if ( #{condition} ) then"
|
1484
1493
|
else
|
1485
1494
|
if condition then
|
1486
|
-
s += "else if #{condition} then"
|
1495
|
+
s += "else if ( #{condition} ) then"
|
1487
1496
|
else
|
1488
1497
|
s += "else"
|
1489
1498
|
end
|
@@ -1576,7 +1585,7 @@ module BOAST
|
|
1576
1585
|
def to_str_fortran
|
1577
1586
|
s = ""
|
1578
1587
|
s += "do #{@iterator}=#{@begin}, #{@end}"
|
1579
|
-
s += ", #{@step}" if
|
1588
|
+
s += ", #{@step}" if 1 != @step
|
1580
1589
|
return s
|
1581
1590
|
end
|
1582
1591
|
def to_str_c
|
data/lib/BOAST/CKernel.rb
CHANGED
@@ -61,6 +61,7 @@ module BOAST
|
|
61
61
|
@@compiler_default_options.each_key { |k|
|
62
62
|
@@compiler_default_options[k] = ENV[k.to_s] if ENV[k.to_s]
|
63
63
|
}
|
64
|
+
@@compiler_default_options[:LD] = ENV["LD"] if ENV["LD"]
|
64
65
|
@@verbose = ENV["VERBOSE"] if ENV["VERBOSE"]
|
65
66
|
end
|
66
67
|
|
@@ -341,7 +342,7 @@ EOF
|
|
341
342
|
def build(options = {})
|
342
343
|
compiler_options = BOAST::get_compiler_options
|
343
344
|
compiler_options.update(options)
|
344
|
-
return build_opencl(
|
345
|
+
return build_opencl(compiler_options) if @lang == BOAST::CL
|
345
346
|
ldflags = self.setup_compiler(compiler_options)
|
346
347
|
extension = ".c" if @lang == BOAST::C
|
347
348
|
extension = ".cu" if @lang == BOAST::CUDA
|
data/lib/BOAST/Operators.rb
CHANGED
@@ -201,6 +201,17 @@ module BOAST
|
|
201
201
|
end
|
202
202
|
end
|
203
203
|
|
204
|
+
class Different < Operator
|
205
|
+
def Different.to_s(arg1, arg2, return_type)
|
206
|
+
return basic_usage(arg1, arg2)
|
207
|
+
end
|
208
|
+
|
209
|
+
def Different.basic_usage(arg1, arg2)
|
210
|
+
return "#{arg1} /= #{arg2}" if BOAST::get_lang == FORTRAN
|
211
|
+
return "#{arg1} != #{arg2}"
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
204
215
|
class Affectation < Operator
|
205
216
|
def Affectation.to_s(arg1, arg2, return_type)
|
206
217
|
if BOAST::get_lang == C then
|
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.95'
|
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-06-
|
12
|
+
date: 2014-06-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: narray
|