Skip to content

API Reference

Complete API documentation for PyDotCompute modules.

Package Structure

pydotcompute/
├── __init__.py          # Main exports
├── exceptions.py        # Exception hierarchy
├── core/                # Core abstractions
│   ├── accelerator.py   # Device management
│   ├── unified_buffer.py # Host-device memory
│   ├── memory_pool.py   # Memory pooling
│   └── orchestrator.py  # Compute coordination
├── ring_kernels/        # Actor model
│   ├── runtime.py       # Kernel runtime
│   ├── message.py       # Message types
│   ├── queue.py         # Message queues
│   ├── lifecycle.py     # Kernel lifecycle
│   └── telemetry.py     # Performance metrics
├── backends/            # Compute backends
│   ├── base.py          # Backend interface
│   ├── cpu.py           # CPU simulation
│   ├── cuda.py          # CUDA backend
│   └── metal.py         # Metal backend (macOS)
└── decorators/          # API decorators
    ├── kernel.py        # @kernel decorator
    ├── ring_kernel.py   # @ring_kernel decorator
    └── validators.py    # Type validation

Core Modules

Ring Kernels

Backends

Decorators

Exceptions

Main Exports

The main pydotcompute package exports the most commonly used classes:

from pydotcompute import (
    # Runtime
    RingKernelRuntime,

    # Decorators
    kernel,
    ring_kernel,
    message,

    # Core
    UnifiedBuffer,
    Accelerator,
    get_accelerator,

    # Types
    DeviceType,
    KernelState,
    BackpressureStrategy,
)

Type Hints

PyDotCompute is fully typed. Import types for IDE support:

from pydotcompute.ring_kernels.lifecycle import KernelContext
from pydotcompute.ring_kernels.message import RingKernelMessage
from pydotcompute.core.accelerator import DeviceInfo