Module: SGC::Cuda

Includes:
Memory
Defined in:
lib/cuda/runtime/cuda.rb,
lib/cuda/runtime/event.rb,
lib/cuda/runtime/error.rb,
lib/cuda/runtime/device.rb,
lib/cuda/runtime/stream.rb,
lib/cuda/runtime/memory.rb,
lib/cuda/runtime/thread.rb,
lib/cuda/runtime/version.rb,
lib/cuda/runtime/function.rb,
lib/cuda/runtime/ffi-cuda.rb

Defined Under Namespace

Modules: API, CudaMemory, Error Classes: CudaArrayFlags, CudaChannelFormatDesc, CudaChannelFormatKind, CudaComputeMode, CudaDevice, CudaDeviceFlags, CudaDeviceMemory, CudaDeviceProp, CudaError, CudaEvent, CudaEventFlags, CudaExtent, CudaFunction, CudaFunctionAttributes, CudaFunctionCache, CudaHostAllocFlags, CudaHostRegisterFlags, CudaLimit, CudaMemcpy3DParms, CudaMemcpyKind, CudaMemoryType, CudaOutputMode, CudaPitchedPtr, CudaPos, CudaStream, CudaSurfaceBoundaryMode, CudaSurfaceFormatMode, CudaTextureAddressMode, CudaTextureFilterMode, CudaTextureReadMode, CudaThread, Dim3, SurfaceReference, TextureReference

Class Method Summary (collapse)

Class Method Details

+ (Integer) driver_version

Returns The CUDA driver version.

Returns:

  • (Integer)

    The CUDA driver version.



32
33
34
35
36
37
# File 'lib/cuda/runtime/version.rb', line 32

def driver_version
    p = FFI::MemoryPointer.new(:int)
    status = API::cudaDriverGetVersion(p)
    Pvt::handle_error(status, "Failed to query the CUDA driver version.")
    p.read_int
end

+ (String) get_error_string(e)

Returns The error string of e.

Parameters:

  • e (Integer, CudaError)

    A CUDA error value or label.

Returns:

  • (String)

    The error string of e.



98
99
100
# File 'lib/cuda/runtime/error.rb', line 98

def get_error_string(e)
    API::cudaGetErrorString(e)
end

+ (Integer) get_last_error

Returns The error value of the last CUDA error.

Returns:

  • (Integer)

    The error value of the last CUDA error.



105
106
107
# File 'lib/cuda/runtime/error.rb', line 105

def get_last_error
    API::cudaGetLastError
end

+ (Integer) peek_at_last_error

Return the last CUDA error, but do not reset the error.

Returns:

  • (Integer)

    The error value of the last CUDA error.



113
114
115
# File 'lib/cuda/runtime/error.rb', line 113

def peek_at_last_error
    API::cudaPeekAtLastError
end

+ (Integer) runtime_version

Returns The CUDA Runtime version.

Returns:

  • (Integer)

    The CUDA Runtime version.



42
43
44
45
46
47
# File 'lib/cuda/runtime/version.rb', line 42

def runtime_version
    p = FFI::MemoryPointer.new(:int)
    status = API::cudaRuntimeGetVersion(p)
    Pvt::handle_error(status, "Failed to query the CUDA Runtime version.")
    p.read_int
end