Class: MilkTea::Types::Simd

Inherits:
Base
  • Object
show all
Defined in:
lib/milk_tea/core/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.



1560
1561
1562
1563
1564
1565
1566
1567
1568
# File 'lib/milk_tea/core/types.rb', line 1560

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.



1558
1559
1560
# File 'lib/milk_tea/core/types.rb', line 1558

def element_type
  @element_type
end

#hashObject (readonly)

Returns the value of attribute hash.



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

def hash
  @hash
end

#lane_countObject (readonly)

Returns the value of attribute lane_count.



1558
1559
1560
# File 'lib/milk_tea/core/types.rb', line 1558

def lane_count
  @lane_count
end

#module_nameObject (readonly)

Returns the value of attribute module_name.



1558
1559
1560
# File 'lib/milk_tea/core/types.rb', line 1558

def module_name
  @module_name
end

#nameObject (readonly)

Returns the value of attribute name.



1558
1559
1560
# File 'lib/milk_tea/core/types.rb', line 1558

def name
  @name
end

Instance Method Details

#childrenObject



1594
1595
1596
# File 'lib/milk_tea/core/types.rb', line 1594

def children
  [element_type]
end

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

Returns:

  • (Boolean)


1570
1571
1572
# File 'lib/milk_tea/core/types.rb', line 1570

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

#field(name) ⇒ Object



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

def field(name)
  @fields[name]
end

#fieldsObject



1578
1579
1580
# File 'lib/milk_tea/core/types.rb', line 1578

def fields
  @fields
end

#numeric?Boolean

Returns:

  • (Boolean)


1586
1587
1588
# File 'lib/milk_tea/core/types.rb', line 1586

def numeric?
  true
end

#to_sObject



1590
1591
1592
# File 'lib/milk_tea/core/types.rb', line 1590

def to_s
  @name
end