class Ikra::Symbolic::ArrayInHostSectionCommand

An array that that is referenced using C++/CUDA expressions. Such an array does not necessarily have to be present in the Ruby interpreter. Its size does also not have to be known at compile time.

Attributes

base_type[RW]
target[RW]

Public Class Methods

new(target, base_type, block_size: DEFAULT_BLOCK_SIZE) click to toggle source
Calls superclass method Ikra::Symbolic::ArrayCommand::new
# File lib/symbolic/host_section.rb, line 62
def initialize(target, base_type, block_size: DEFAULT_BLOCK_SIZE)
    super(block_size: block_size)

    if base_type == nil
        raise AssertionError.new("base_type missing")
    end

    # One thread per array element
    @input = [SingleInput.new(command: target, pattern: :tid)]
    @base_type = base_type
end

Public Instance Methods

==(other) click to toggle source
Calls superclass method Ikra::Symbolic::ArrayCommand#==
# File lib/symbolic/host_section.rb, line 84
def ==(other)
    return super(other) && base_type == other.base_type
end
accept(visitor) click to toggle source
# File lib/symbolic/visitor.rb, line 52
def accept(visitor)
    visitor.visit_array_in_host_section_command(self)
end
dimensions() click to toggle source

TODO: Support multiple dimensions

# File lib/symbolic/host_section.rb, line 80
def dimensions
    return [size]
end
size() click to toggle source
# File lib/symbolic/host_section.rb, line 74
def size
    # Size is not known at compile time. Return a source code string here.
    return "#{input.first.command}->size()"
end