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
Quick Links¶
Core Modules¶
- Accelerator: Device detection and management
- UnifiedBuffer: Host-device memory abstraction
- MemoryPool: Buffer pooling and reuse
- ComputeOrchestrator: Computation coordination
Ring Kernels¶
- RingKernelRuntime: Main runtime coordinator
- Message: Message types and serialization
- MessageQueue: Priority message queues
- Lifecycle: Kernel state management
- Telemetry: Performance monitoring
Backends¶
- Backend Interface: Abstract backend API
- CPUBackend: CPU simulation backend
- CUDABackend: NVIDIA GPU backend
- MetalBackend: Apple Silicon GPU backend (macOS)
Decorators¶
- @kernel: Low-level kernel decorator
- @ring_kernel: Actor decorator
- Validators: Type validation utilities
Exceptions¶
- Exceptions: Complete exception hierarchy
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: