Class: SGC::Cuda::API::Dim3

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/cuda/runtime/ffi-cuda.rb

Instance Method Summary collapse

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

#xObject



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

#yObject



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

#zObject



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