Class: Cumo::CUDA::LinkState
- Inherits:
-
Object
- Object
- Cumo::CUDA::LinkState
- Defined in:
- lib/cumo/cuda/link_state.rb
Overview
CUDA link state.
Instance Method Summary collapse
- #add_ptr_data(data, name) ⇒ Object
- #complete ⇒ Object
- #destroy ⇒ Object
-
#initialize ⇒ LinkState
constructor
A new instance of LinkState.
Constructor Details
#initialize ⇒ LinkState
Returns a new instance of LinkState.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/cumo/cuda/link_state.rb', line 6 def initialize @ptr = Driver.cuLinkCreate if block_given? begin yield(self) ensure destroy end end end |
Instance Method Details
#add_ptr_data(data, name) ⇒ Object
23 24 25 |
# File 'lib/cumo/cuda/link_state.rb', line 23 def add_ptr_data(data, name) Driver.cuLinkAddData(@ptr, Driver::CU_JIT_INPUT_PTX, data, name) end |
#complete ⇒ Object
27 28 29 |
# File 'lib/cumo/cuda/link_state.rb', line 27 def complete cubin = Driver.cuLinkComplete(@ptr) end |
#destroy ⇒ Object
17 18 19 20 21 |
# File 'lib/cumo/cuda/link_state.rb', line 17 def destroy return unless @ptr Driver.cuLinkDestroy(@ptr) @ptr = nil end |