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.



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

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.



1085
1086
1087
# File 'lib/BOAST/Algorithm.rb', line 1085

def signed
  @signed
end

Class Method Details

.parens(*args, &block) ⇒ Object



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

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

Instance Method Details

#decl ⇒ Object



1091
1092
1093
1094
1095
1096
1097
1098
# File 'lib/BOAST/Algorithm.rb', line 1091

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