Class: SGC::Cuda::API::Dim3
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- SGC::Cuda::API::Dim3
- Defined in:
- lib/cuda/runtime/ffi-cuda.rb
Instance Method Summary collapse
- #[](index) ⇒ Object
- #[]=(index, value) ⇒ Object
-
#initialize(x, y, z) ⇒ Dim3
constructor
A new instance of Dim3.
- #x ⇒ Object
- #x=(value) ⇒ Object
- #y ⇒ Object
- #y=(value) ⇒ Object
- #z ⇒ Object
- #z=(value) ⇒ Object
Constructor Details
#initialize(x, y, z) ⇒ Dim3
Returns a new instance of Dim3.
269 270 271 272 273 |
# File 'lib/cuda/runtime/ffi-cuda.rb', line 269 def initialize(x, y, z) init @array = get(:array) @array[0], @array[1], @array[2] = x, y, z end |
Instance Method Details
#[](index) ⇒ Object
275 |
# File 'lib/cuda/runtime/ffi-cuda.rb', line 275 def [](index); @array[index]; end |
#[]=(index, value) ⇒ Object
276 |
# File 'lib/cuda/runtime/ffi-cuda.rb', line 276 def []=(index, value); @array[index] = value; end |
#x ⇒ Object
278 |
# File 'lib/cuda/runtime/ffi-cuda.rb', line 278 def x; @array[0]; end |
#x=(value) ⇒ Object
282 |
# File 'lib/cuda/runtime/ffi-cuda.rb', line 282 def x=(value); @array[0] = value; end |
#y ⇒ Object
279 |
# File 'lib/cuda/runtime/ffi-cuda.rb', line 279 def y; @array[1]; end |
#y=(value) ⇒ Object
283 |
# File 'lib/cuda/runtime/ffi-cuda.rb', line 283 def y=(value); @array[1] = value; end |
#z ⇒ Object
280 |
# File 'lib/cuda/runtime/ffi-cuda.rb', line 280 def z; @array[2]; end |
#z=(value) ⇒ Object
284 |
# File 'lib/cuda/runtime/ffi-cuda.rb', line 284 def z=(value); @array[2] = value; end |