Class: BOAST::CustomType

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash = {}) ⇒ CustomType

Returns a new instance of CustomType.



305
306
307
308
309
310
311
312
# File 'lib/BOAST/DataTypes.rb', line 305

def initialize(hash={})
  @name = hash[:type_name]
  @size = hash[:size]
  @size = 0 if @size.nil?
  @vector_length = hash[:vector_length]
  @vector_length = 1 if @vector_length.nil?
  @total_size = @vector_length*@size
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



304
305
306
# File 'lib/BOAST/DataTypes.rb', line 304

def name
  @name
end

#sizeObject (readonly)

Returns the value of attribute size.



304
305
306
# File 'lib/BOAST/DataTypes.rb', line 304

def size
  @size
end

#vector_lengthObject (readonly)

Returns the value of attribute vector_length.



304
305
306
# File 'lib/BOAST/DataTypes.rb', line 304

def vector_length
  @vector_length
end

Instance Method Details

#declObject



313
314
315
# File 'lib/BOAST/DataTypes.rb', line 313

def decl
  return "#{@name}" if [C, CL, CUDA].include?( BOAST::get_lang )
end