Class: MilkTea::Types::Simd

Inherits:
Base
  • Object
show all
Defined in:
lib/milk_tea/core/types/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#accept, #bitwise?, #boolean?, #field_c_name, #float?, #integer?, #sendable?, #void?

Constructor Details

#initialize(element_type, lane_count:) ⇒ Simd

Returns a new instance of Simd.



1566
1567
1568
1569
1570
1571
1572
1573
1574
# File 'lib/milk_tea/core/types/types.rb', line 1566

def initialize(element_type, lane_count:)
  @element_type = element_type
  @lane_count = lane_count
  @name = "simd[#{element_type}, #{lane_count}]"
  @module_name = nil
  @fields = {}.freeze
  @hash = [self.class, element_type, lane_count].hash
  freeze
end

Instance Attribute Details

#element_typeObject (readonly)

Returns the value of attribute element_type.



1564
1565
1566
# File 'lib/milk_tea/core/types/types.rb', line 1564

def element_type
  @element_type
end

#hashObject (readonly)

Returns the value of attribute hash.



1582
1583
1584
# File 'lib/milk_tea/core/types/types.rb', line 1582

def hash
  @hash
end

#lane_countObject (readonly)

Returns the value of attribute lane_count.



1564
1565
1566
# File 'lib/milk_tea/core/types/types.rb', line 1564

def lane_count
  @lane_count
end

#module_nameObject (readonly)

Returns the value of attribute module_name.



1564
1565
1566
# File 'lib/milk_tea/core/types/types.rb', line 1564

def module_name
  @module_name
end

#nameObject (readonly)

Returns the value of attribute name.



1564
1565
1566
# File 'lib/milk_tea/core/types/types.rb', line 1564

def name
  @name
end

Instance Method Details

#childrenObject



1600
1601
1602
# File 'lib/milk_tea/core/types/types.rb', line 1600

def children
  [element_type]
end

#eql?(other) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


1576
1577
1578
# File 'lib/milk_tea/core/types/types.rb', line 1576

def eql?(other)
  other.is_a?(Simd) && other.element_type == element_type && other.lane_count == lane_count
end

#field(name) ⇒ Object



1588
1589
1590
# File 'lib/milk_tea/core/types/types.rb', line 1588

def field(name)
  @fields[name]
end

#fieldsObject



1584
1585
1586
# File 'lib/milk_tea/core/types/types.rb', line 1584

def fields
  @fields
end

#numeric?Boolean

Returns:

  • (Boolean)


1592
1593
1594
# File 'lib/milk_tea/core/types/types.rb', line 1592

def numeric?
  true
end

#to_sObject



1596
1597
1598
# File 'lib/milk_tea/core/types/types.rb', line 1596

def to_s
  @name
end