Module: SGC::Cuda

Includes:
Memory
Defined in:
lib/cuda/runtime/cuda.rb,
lib/cuda/runtime/error.rb,
lib/cuda/runtime/event.rb,
lib/cuda/runtime/device.rb,
lib/cuda/runtime/memory.rb,
lib/cuda/runtime/stream.rb,
lib/cuda/runtime/thread.rb,
lib/cuda/runtime/version.rb,
lib/cuda/runtime/ffi-cuda.rb,
lib/cuda/runtime/function.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

.driver_versionInteger

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

.get_error_string(e) ⇒ String

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

.get_last_errorInteger

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

.peek_at_last_errorInteger

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

.runtime_versionInteger

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