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.



1099
1100
1101
1102
1103
# File 'lib/BOAST/Algorithm.rb', line 1099

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

Instance Attribute Details

#signedObject (readonly)

Returns the value of attribute signed.



1098
1099
1100
# File 'lib/BOAST/Algorithm.rb', line 1098

def signed
  @signed
end

Class Method Details

.parens(*args, &block) ⇒ Object



1094
1095
1096
# File 'lib/BOAST/Algorithm.rb', line 1094

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

Instance Method Details

#declObject



1104
1105
1106
1107
1108
1109
1110
1111
# File 'lib/BOAST/Algorithm.rb', line 1104

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