Class: BOAST::Sizet

Inherits:
Object show all
Defined in:
lib/BOAST/Algorithm.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash = {}) ⇒ Sizet

Returns a new instance of Sizet.



1080
1081
1082
1083
1084
# File 'lib/BOAST/Algorithm.rb', line 1080

def initialize(hash={})
  if hash[:signed] != nil then
    @signed = hash[:signed]
  end
end

Instance Attribute Details

#signed ⇒ Object (readonly)

Returns the value of attribute signed.



1079
1080
1081
# File 'lib/BOAST/Algorithm.rb', line 1079

def signed
  @signed
end

Class Method Details

.parens(*args, &block) ⇒ Object



1075
1076
1077
# File 'lib/BOAST/Algorithm.rb', line 1075

def self.parens(*args,&block)
  return Variable::new(args[0], self, *args[1..-1], &block)
end

Instance Method Details

#decl ⇒ Object



1085
1086
1087
1088
1089
1090
1091
1092
# File 'lib/BOAST/Algorithm.rb', line 1085

def decl
  return "integer(kind=#{BOAST::get_default_int_size})" if BOAST::get_lang == FORTRAN
  if not @signed then
    return "size_t" if [C, CL, CUDA].include?( BOAST::get_lang )
  else
    return "ptrdiff_t" if [C, CL, CUDA].include?( BOAST::get_lang )
  end
end