Module: SGC::CU::API

Extended by:
FFI::Library
Defined in:
lib/cuda/driver/ffi-cu.rb

Defined Under Namespace

Classes: CUDevProp, CudaArray3DDescriptor, CudaArrayDescriptor, CudaMemcpy2D, CudaMemcpy3D, CudaMemcpy3DPeer, Enum

Constant Summary collapse

CUResult =
enum(
    :SUCCESS, 0,
    :ERROR_INVALID_VALUE, 1,
    :ERROR_OUT_OF_MEMORY, 2,
    :ERROR_NOT_INITIALIZED, 3,
    :ERROR_DEINITIALIZED, 4,
    :ERROR_PROFILER_DISABLED, 5,
    :ERROR_PROFILER_NOT_INITIALIZED, 6,
    :ERROR_PROFILER_ALREADY_STARTED, 7,
    :ERROR_PROFILER_ALREADY_STOPPED, 8,
    :ERROR_NO_DEVICE, 100,
    :ERROR_INVALID_DEVICE, 101,
    :ERROR_INVALID_IMAGE, 200,
    :ERROR_INVALID_CONTEXT, 201,
    :ERROR_CONTEXT_ALREADY_CURRENT, 202, # Deprecated.
    :ERROR_MAP_FAILED, 205,
    :ERROR_UNMAP_FAILED, 206,
    :ERROR_ARRAY_IS_MAPPED, 207,
    :ERROR_ALREADY_MAPPED, 208,
    :ERROR_NO_BINARY_FOR_GPU, 209,
    :ERROR_ALREADY_ACQUIRED, 210,
    :ERROR_NOT_MAPPED, 211,
    :ERROR_NOT_MAPPED_AS_ARRAY, 212,
    :ERROR_NOT_MAPPED_AS_POINTER, 213,
    :ERROR_ECC_UNCORRECTABLE, 214,
    :ERROR_UNSUPPORTED_LIMIT, 215,
    :ERROR_CONTEXT_ALREADY_IN_USE, 216,
    :ERROR_INVALID_SOURCE, 300,
    :ERROR_FILE_NOT_FOUND, 301,
    :ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND, 302,
    :ERROR_SHARED_OBJECT_INIT_FAILED, 303,
    :ERROR_OPERATING_SYSTEM, 304,
    :ERROR_INVALID_HANDLE, 400,
    :ERROR_NOT_FOUND, 500,
    :ERROR_NOT_READY, 600,
    :ERROR_LAUNCH_FAILED, 700,
    :ERROR_LAUNCH_OUT_OF_RESOURCES, 701,
    :ERROR_LAUNCH_TIMEOUT, 702,
    :ERROR_LAUNCH_INCOMPATIBLE_TEXTURING, 703,
    :ERROR_PEER_ACCESS_ALREADY_ENABLED, 704,
    :ERROR_PEER_ACCESS_NOT_ENABLED, 705,
    :ERROR_PRIMARY_CONTEXT_ACTIVE, 708,
    :ERROR_CONTEXT_IS_DESTROYED, 709,
    :ERROR_UNKNOWN, 999,
)
CUComputeMode =
enum(
    :DEFAULT, 0,
    :EXCLUSIVE, 1,
    :PROHIBITED, 2,
    :EXCLUSIVE_PROCESS, 3,
)
CUDeviceAttribute =
enum(
    :MAX_THREADS_PER_BLOCK, 1,
    :MAX_BLOCK_DIM_X, 2,
    :MAX_BLOCK_DIM_Y, 3,
    :MAX_BLOCK_DIM_Z, 4,
    :MAX_GRID_DIM_X, 5,
    :MAX_GRID_DIM_Y, 6,
    :MAX_GRID_DIM_Z, 7,
    :MAX_SHARED_MEMORY_PER_BLOCK, 8,
    :SHARED_MEMORY_PER_BLOCK, 8, # Deprecated. Use :MAX_SHARED_MEMORY_PER_BLOCK.
    :TOTAL_CONSTANT_MEMORY, 9,
    :WARP_SIZE, 10,
    :MAX_PITCH, 11,
    :MAX_REGISTERS_PER_BLOCK, 12,
    :REGISTERS_PER_BLOCK, 12, # Deprecated. Use :MAX_REGISTERS_PER_BLOCK.
    :CLOCK_RATE, 13,
    :TEXTURE_ALIGNMENT, 14,
    :GPU_OVERLAP, 15, # Deprecated. Use :ASYNC_ENGINE_COUNT.
    :MULTIPROCESSOR_COUNT, 16,
    :KERNEL_EXEC_TIMEOUT, 17,
    :INTEGRATED, 18,
    :CAN_MAP_HOST_MEMORY, 19,
    :COMPUTE_MODE, 20,
    :MAXIMUM_TEXTURE1D_WIDTH, 21,
    :MAXIMUM_TEXTURE2D_WIDTH, 22,
    :MAXIMUM_TEXTURE2D_HEIGHT, 23,
    :MAXIMUM_TEXTURE3D_WIDTH, 24,
    :MAXIMUM_TEXTURE3D_HEIGHT, 25,
    :MAXIMUM_TEXTURE3D_DEPTH, 26,
    :MAXIMUM_TEXTURE2D_LAYERED_WIDTH, 27,
    :MAXIMUM_TEXTURE2D_LAYERED_HEIGHT, 28,
    :MAXIMUM_TEXTURE2D_LAYERED_LAYERS, 29,
    :MAXIMUM_TEXTURE2D_ARRAY_WIDTH, 27, # Deprecated. Use :MAXIMUM_TEXTURE2D_LAYERED_WIDTH.
    :MAXIMUM_TEXTURE2D_ARRAY_HEIGHT, 28, # Deprecated. Use :MAXINUM_TEXTURE2D_LAYERED_HEIGHT.
    :MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES, 29, # Deprecated. Use :MAXIMUM_TEXTURE2D_LAYERED_LAYERS.
    :SURFACE_ALIGNMENT, 30,
    :CONCURRENT_KERNELS, 31,
    :ECC_ENABLED, 32,
    :PCI_BUS_ID, 33,
    :PCI_DEVICE_ID, 34,
    :TCC_DRIVER, 35,
    :MEMORY_CLOCK_RATE, 36,
    :GLOBAL_MEMORY_BUS_WIDTH, 37,
    :L2_CACHE_SIZE, 38,
    :MAX_THREADS_PER_MULTIPROCESSOR, 39,
    :ASYNC_ENGINE_COUNT, 40,
    :UNIFIED_ADDRESSING, 41,
    :MAXIMUM_TEXTURE1D_LAYERED_WIDTH, 42,
    :MAXINUM_TEXTURE1D_LAYERED_LAYERS, 43,
)
CUContextFlags =
enum(
    :SCHED_AUTO, 0x00,
    :SCHED_SPIN, 0x01,
    :SCHED_YIELD, 0x02,
    :SCHED_BLOCKING_SYNC, 0x04,
    :BLOCKING_SYNC, 0x04, # Deprecated. Use :SCHED_BLOCKING_SYNC.
    :MAP_HOST, 0x08,
    :LMEM_RESIZE_TO_MAX, 0x10,
)
CULimit =
enum(
    :STACK_SIZE, 0x00,
    :PRINTF_FIFO_SIZE, 0x01,
    :MALLOC_HEAP_SIZE, 0x02,
)
CUFunctionAttribute =
enum(
    :MAX_THREADS_PER_BLOCK, 0,
    :SHARED_SIZE_BYTES, 1,
    :CONST_SIZE_BYTES, 2,
    :LOCAL_SIZE_BYTES, 3,
    :NUM_REGS, 4,
    :PTX_VERSION, 5,
    :BINARY_VERSION, 6,
)
CUFunctionCache =
enum(
    :PREFER_NONE, 0x00,
    :PREFER_SHARED, 0x01,
    :PREFER_L1, 0x02,
)
CUEventFlags =
enum(
    :DEFAULT, 0,
    :BLOCKING_SYNC, 1,
    :DISABLE_TIMING, 2,
)
CUAddressMode =
enum(
    :WRAP, 0,
    :CLAMP, 1,
    :MIRROR, 2,
    :BORDER, 3,
)
CUFilterMode =
enum(
    :POINT, 0,
    :LINEAR, 1,
)
CUTexRefFlags =
enum(
    :READ_AS_INTEGER, 0x01,
    :NORMALIZED_COORDINATES, 0x02,
    :SRGB, 0x10,
)
CUArrayFormat =
enum(
    :UNSIGNED_INT8, 0x01,
    :UNSIGNED_INT16, 0x02,
    :UNSIGNED_INT32, 0x03,
    :SIGNED_INT8, 0x08,
    :SIGNED_INT16, 0x09,
    :SIGNED_INT32, 0x0a,
    :HALF, 0x10,
    :FLOAT, 0x20,
)
CUMemoryType =
enum(
    :HOST, 0x01,
    :DEVICE, 0x02,
    :ARRAY, 0x03,
    :UNIFIED, 0x04,
)
CUPointerAttribute =
enum(
    :CONTEXT, 1,
    :MEMORY_TYPE, 2,
    :DEVICE_POINTER, 3,
    :HOST_POINTER, 4,
)
CUJitOption =
enum(
    :MAX_REGISTERS, 0,
    :THREADS_PER_BLOCK,
    :WALL_TIME,
    :INFO_LOG_BUFFER,
    :INFO_LOG_BUFFER_SIZE_BYTES,
    :ERROR_LOG_BUFFER,
    :ERROR_LOG_BUFFER_SIZE_BYTES,
    :OPTIMIZATION_LEVEL,
    :TARGET_FROM_CUCONTEXT,
    :TARGET,
    :FALLBACK_STRATEGY,
)
CUJitFallBack =
enum(
    :PREFER_PTX, 0,
    :PREFER_BINARY,
)
CUJitTarget =
enum(
    :COMPUTE_10, 0,
    :COMPUTE_11,
    :COMPUTE_12,
    :COMPUTE_13,
    :COMPUTE_20,
    :COMPUTE_21,
)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.read_cuarrayObject



299
# File 'lib/cuda/driver/ffi-cu.rb', line 299

def read_pointer(ptr); ptr.read_pointer; end

.read_cucontextObject



296
# File 'lib/cuda/driver/ffi-cu.rb', line 296

def read_pointer(ptr); ptr.read_pointer; end

.read_cudeviceObject



294
# File 'lib/cuda/driver/ffi-cu.rb', line 294

def read_int(ptr); ptr.read_int; end

.read_cudeviceptrObject



295
# File 'lib/cuda/driver/ffi-cu.rb', line 295

def read_ulong_long(ptr); ptr.read_ulong_long; end

.read_cueventObject



302
# File 'lib/cuda/driver/ffi-cu.rb', line 302

def read_pointer(ptr); ptr.read_pointer; end

.read_cufunctionObject



298
# File 'lib/cuda/driver/ffi-cu.rb', line 298

def read_pointer(ptr); ptr.read_pointer; end

.read_cumoduleObject



297
# File 'lib/cuda/driver/ffi-cu.rb', line 297

def read_pointer(ptr); ptr.read_pointer; end

.read_custreamObject



303
# File 'lib/cuda/driver/ffi-cu.rb', line 303

def read_pointer(ptr); ptr.read_pointer; end

.read_cusurfrefObject



301
# File 'lib/cuda/driver/ffi-cu.rb', line 301

def read_pointer(ptr); ptr.read_pointer; end

.read_cutexrefObject



300
# File 'lib/cuda/driver/ffi-cu.rb', line 300

def read_pointer(ptr); ptr.read_pointer; end

.read_enumObject



293
# File 'lib/cuda/driver/ffi-cu.rb', line 293

def read_int(ptr); ptr.read_int; end

.read_size_tObject



292
# File 'lib/cuda/driver/ffi-cu.rb', line 292

def read_long(ptr); ptr.read_long; end

.write_cuarrayObject



312
# File 'lib/cuda/driver/ffi-cu.rb', line 312

def write_pointer(ptr, value); ptr.write_long(value.to_i); end

.write_cucontextObject



309
# File 'lib/cuda/driver/ffi-cu.rb', line 309

def write_pointer(ptr, value); ptr.write_long(value.to_i); end

.write_cudeviceObject



307
# File 'lib/cuda/driver/ffi-cu.rb', line 307

def write_int(ptr, value); ptr.write_int(value); end

.write_cudeviceptrObject



308
# File 'lib/cuda/driver/ffi-cu.rb', line 308

def write_ulong_long(ptr, value); ptr.write_ulong_long(value); end

.write_cueventObject



315
# File 'lib/cuda/driver/ffi-cu.rb', line 315

def write_pointer(ptr, value); ptr.write_long(value.to_i); end

.write_cufunctionObject



311
# File 'lib/cuda/driver/ffi-cu.rb', line 311

def write_pointer(ptr, value); ptr.write_long(value.to_i); end

.write_cumoduleObject



310
# File 'lib/cuda/driver/ffi-cu.rb', line 310

def write_pointer(ptr, value); ptr.write_long(value.to_i); end

.write_custreamObject



316
# File 'lib/cuda/driver/ffi-cu.rb', line 316

def write_pointer(ptr, value); ptr.write_long(value.to_i); end

.write_cusurfrefObject



314
# File 'lib/cuda/driver/ffi-cu.rb', line 314

def write_pointer(ptr, value); ptr.write_long(value.to_i); end

.write_cutexrefObject



313
# File 'lib/cuda/driver/ffi-cu.rb', line 313

def write_pointer(ptr, value); ptr.write_long(value.to_i); end

.write_enumObject



306
# File 'lib/cuda/driver/ffi-cu.rb', line 306

def write_int(ptr, value); ptr.write_int(value); end

.write_size_tObject



305
# File 'lib/cuda/driver/ffi-cu.rb', line 305

def write_long(ptr, value); ptr.write_long(value); end

Instance Method Details

#read_int(ptr) ⇒ Object Also known as: read_enum, read_cudevice



282
# File 'lib/cuda/driver/ffi-cu.rb', line 282

def read_int(ptr); ptr.read_int; end

#read_long(ptr) ⇒ Object Also known as: read_size_t



283
# File 'lib/cuda/driver/ffi-cu.rb', line 283

def read_long(ptr); ptr.read_long; end

#read_pointer(ptr) ⇒ Object Also known as: read_cucontext, read_cumodule, read_cufunction, read_cuarray, read_cutexref, read_cusurfref, read_cuevent, read_custream



285
# File 'lib/cuda/driver/ffi-cu.rb', line 285

def read_pointer(ptr); ptr.read_pointer; end

#read_ulong_long(ptr) ⇒ Object Also known as: read_cudeviceptr



284
# File 'lib/cuda/driver/ffi-cu.rb', line 284

def read_ulong_long(ptr); ptr.read_ulong_long; end

#write_int(ptr, value) ⇒ Object Also known as: write_enum, write_cudevice



287
# File 'lib/cuda/driver/ffi-cu.rb', line 287

def write_int(ptr, value); ptr.write_int(value); end

#write_long(ptr, value) ⇒ Object Also known as: write_size_t



288
# File 'lib/cuda/driver/ffi-cu.rb', line 288

def write_long(ptr, value); ptr.write_long(value); end

#write_pointer(ptr, value) ⇒ Object Also known as: write_cucontext, write_cumodule, write_cufunction, write_cuarray, write_cutexref, write_cusurfref, write_cuevent, write_custream



290
# File 'lib/cuda/driver/ffi-cu.rb', line 290

def write_pointer(ptr, value); ptr.write_long(value.to_i); end

#write_ulong_long(ptr, value) ⇒ Object Also known as: write_cudeviceptr



289
# File 'lib/cuda/driver/ffi-cu.rb', line 289

def write_ulong_long(ptr, value); ptr.write_ulong_long(value); end