cuda.core API Reference#

This is the main API reference for cuda.core. The package has not yet reached version 1.0.0, and APIs may change between minor versions, possibly without deprecation warnings. Once version 1.0.0 is released, APIs will be considered stable and will follow semantic versioning with appropriate deprecation periods for breaking changes.

CUDA runtime#

Device([device_id])

Represent a GPU and act as an entry point for cuda.core features.

Graph()

Represents an executable graph.

GraphBuilder()

Represents a graph under construction.

launch(stream, LaunchConfig config, kernel, ...)

Launches a Kernel object with launch-time configuration.

Buffer(*args, **kwargs)

Represent a handle to allocated memory.

Stream(*args, **kwargs)

Represent a queue of GPU operations that are executed in a specific order.

Event(*args, **kwargs)

Represent a record at a specific point of execution within a CUDA stream.

MemoryResource

Abstract base class for memory resources that manage allocation and deallocation of buffers.

DeviceMemoryResource(device_id[, options])

A device memory resource managing a stream-ordered memory pool.

GraphMemoryResource(device_id)

A memory resource for memory related to graphs.

PinnedMemoryResource([options])

A host-pinned memory resource managing a stream-ordered memory pool.

ManagedMemoryResource([options])

A managed memory resource managing a stream-ordered memory pool.

LegacyPinnedMemoryResource

Create a pinned memory resource that uses legacy cuMemAllocHost/cudaMallocHost APIs.

VirtualMemoryResource(device_id[, config])

Create a device memory resource that uses the CUDA VMM APIs to allocate memory.

DeviceMemoryResourceOptions([ipc_enabled, ...])

Customizable DeviceMemoryResource options.

PinnedMemoryResourceOptions([ipc_enabled, ...])

Customizable PinnedMemoryResource options.

ManagedMemoryResourceOptions([...])

Customizable ManagedMemoryResource options.

EventOptions([enable_timing, ...])

Customizable Event options.

GraphCompleteOptions([auto_free_on_launch, ...])

Customizable options for _graph.GraphBuilder.complete()

GraphDebugPrintOptions([verbose, ...])

Customizable options for _graph.GraphBuilder.debug_dot_print()

StreamOptions([nonblocking, priority])

Customizable Stream options.

LaunchConfig([grid, cluster, block, ...])

Customizable launch options.

VirtualMemoryResourceOptions(...)

A configuration object for the VirtualMemoryResource

CUDA compilation toolchain#

Program(code, code_type[, options])

Represent a compilation machinery to process programs into ObjectCode.

Linker(*object_codes[, options])

Represent a linking machinery to link one or multiple object codes into ObjectCode with the specified options.

ObjectCode(*args, **kwargs)

Represent a compiled program to be loaded onto the device.

Kernel(*args, **kwargs)

Represent a compiled kernel that had been loaded onto the device.

ProgramOptions([name, arch, ...])

Customizable options for configuring Program.

LinkerOptions([name, arch, ...])

Customizable Linker options.

CUDA system information#

Utility functions#

args_viewable_as_strided_memory(...)

Decorator to create proxy objects to StridedMemoryView for the specified positional arguments.

StridedMemoryView(obj, int stream_ptr)

A class holding metadata of a strided dense array/tensor.