Class: Ikra::Translator::BlockTranslationResult

Inherits:
Object
  • Object
show all
Defined in:
lib/translator/block_translator.rb

Overview

The result of Ruby-to-CUDA translation of a block using Ikra::Translator

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(c_source:, result_type:, function_name:, aux_methods: []) ⇒ BlockTranslationResult

Returns a new instance of BlockTranslationResult.



27
28
29
30
31
32
# File 'lib/translator/block_translator.rb', line 27

def initialize(c_source:, result_type:, function_name:, aux_methods: [])
    @block_source = c_source
    @result_type = result_type
    @function_name = function_name
    @aux_methods = aux_methods
end

Instance Attribute Details

#aux_methods ⇒ String

(including transitive method calls)

Returns:

  • (String) —

    Auxiliary methods that are called by this block



25
26
27
# File 'lib/translator/block_translator.rb', line 25

def aux_methods
  @aux_methods
end

#block_source ⇒ String

Returns Generated CUDA source code.

Returns:

  • (String) —

    Generated CUDA source code



15
16
17
# File 'lib/translator/block_translator.rb', line 15

def block_source
  @block_source
end

#function_name ⇒ String

Returns Name of function of block in CUDA source code.

Returns:

  • (String) —

    Name of function of block in CUDA source code



21
22
23
# File 'lib/translator/block_translator.rb', line 21

def function_name
  @function_name
end

#result_type ⇒ UnionType

Return value type of method/block

Returns:

  • (UnionType) —

    Return value type of method/block



18
19
20
# File 'lib/translator/block_translator.rb', line 18

def result_type
  @result_type
end