Class: Yadriggy::C::OclCodeGen::KernelPrinter

Inherits:
Object
  • Object
show all
Defined in:
lib/yadriggy/c/opencl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#printerObject (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

#downObject



306
307
308
309
310
# File 'lib/yadriggy/c/opencl.rb', line 306

def down()
  @printer << "\"\\"
  @printer.down
  @printer << '"'
end

#nlObject



318
319
320
321
# File 'lib/yadriggy/c/opencl.rb', line 318

def nl()
  @printer << "\"\\" << :nl << '"'
  self
end

#upObject



312
313
314
315
316
# File 'lib/yadriggy/c/opencl.rb', line 312

def up()
  @printer << "\"\\"
  @printer.up
  @printer << '"'
end