Module memory

Module memory 

Source
Expand description

Memory Management Infrastructure

Provides GPU memory pooling, pressure handling, and analytics context management for high-performance kernel execution.

§Features

  • Memory Pools: Size-stratified pools for efficient GPU allocation
  • Pressure Handling: Automatic memory pressure detection and mitigation
  • Analytics Context: Reusable buffers for analytics workloads
  • Reduction Buffers: Cached buffers for GPU reduction operations
  • Multi-phase Reductions: Synchronization primitives for iterative algorithms

§Example

use rustkernel_core::memory::{KernelMemoryManager, MemoryConfig};

let config = MemoryConfig::production();
let manager = KernelMemoryManager::new(config);

// Allocate from pool
let buffer = manager.allocate(1024 * 1024)?; // 1MB

// Return to pool
manager.deallocate(buffer);

Re-exports§

pub use reduction::CooperativeBarrier;
pub use reduction::GlobalReduction;
pub use reduction::InterPhaseReduction;
pub use reduction::PhaseState;
pub use reduction::ReductionBuilder;
pub use reduction::ReductionConfig;
pub use reduction::ReductionError;
pub use reduction::ReductionOp;
pub use reduction::SyncMode;

Modules§

reduction
Reduction Primitives

Structs§

AnalyticsContext
Analytics context for reusable buffers
AnalyticsContextManager
Analytics context manager
BucketStats
Statistics for a size bucket
KernelMemoryManager
Kernel memory manager
MemoryBuffer
Memory buffer handle
MemoryConfig
Memory configuration
MemoryStats
Memory statistics
ReductionBuffer
Reduction buffer for GPU reduction operations
ReductionBufferCache
Reduction buffer cache
SizeBucket
Size bucket for memory pool

Enums§

MemoryError
Memory errors
PressureLevel
Memory pressure level

Type Aliases§

AllocResult
Memory allocation result