Module: MetaCL::DSL::DataDefinitions
- Included in:
- Root
- Defined in:
- lib/metacl/dsl/data_definitions.rb
Instance Method Summary collapse
- #array(name, type, length, options = {}) ⇒ Object
- #matrix(name, type, size_n, size_m, options = {}) ⇒ Object
- #numeric(name, type, options = {}) ⇒ Object
Instance Method Details
#array(name, type, length, options = {}) ⇒ Object
12 13 14 15 16 |
# File 'lib/metacl/dsl/data_definitions.rb', line 12 def array(name, type, length, = {}) @program.resources.add_array name, length, type @inner_code << Templates::InitArray.render(name, type, length, [:fill_with], @program.platform) << "\n\n" end |
#matrix(name, type, size_n, size_m, options = {}) ⇒ Object
18 19 20 21 22 |
# File 'lib/metacl/dsl/data_definitions.rb', line 18 def matrix(name, type, size_n, size_m, = {}) @program.resources.add_matrix name, size_n, size_m, type @inner_code << Templates::InitMatrix.render(name, type, size_n, size_m, [:fill_with], @program.platform) << "\n\n" end |
#numeric(name, type, options = {}) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/metacl/dsl/data_definitions.rb', line 5 def numeric(name, type, = {}) value = [:value] @program.resources.add_numeric name, type @inner_code << Templates::InitNumeric.render(name, type, value, @program.platform) << "\n\n" end |