Class: Yadriggy::C::OclCodeGen::KernelPrinter
- Inherits:
-
Object
- Object
- Yadriggy::C::OclCodeGen::KernelPrinter
- Defined in:
- lib/yadriggy/c/opencl.rb
Instance Attribute Summary collapse
-
#printer ⇒ Object
readonly
Returns the value of attribute printer.
Instance Method Summary collapse
-
#<<(code) ⇒ Object
-
#down ⇒ Object
-
#initialize(printer) ⇒ KernelPrinter
constructor
A new instance of KernelPrinter.
-
#nl ⇒ Object
-
#up ⇒ Object
Constructor Details
#initialize(printer) ⇒ KernelPrinter
Returns a new instance of KernelPrinter.
302 303 304 |
# File 'lib/yadriggy/c/opencl.rb', line 302 def initialize(printer) @printer = printer end |
Instance Attribute Details
#printer ⇒ Object (readonly)
Returns the value of attribute printer.
300 301 302 |
# File 'lib/yadriggy/c/opencl.rb', line 300 def printer @printer end |
Instance Method Details
#<<(code) ⇒ Object
323 324 325 326 |
# File 'lib/yadriggy/c/opencl.rb', line 323 def << (code) code == :nl ? nl : @printer << code self end |
#down ⇒ Object
306 307 308 309 310 |
# File 'lib/yadriggy/c/opencl.rb', line 306 def down() @printer << "\"\\" @printer.down @printer << '"' end |
#nl ⇒ Object
318 319 320 321 |
# File 'lib/yadriggy/c/opencl.rb', line 318 def nl() @printer << "\"\\" << :nl << '"' self end |
#up ⇒ Object
312 313 314 315 316 |
# File 'lib/yadriggy/c/opencl.rb', line 312 def up() @printer << "\"\\" @printer.up @printer << '"' end |