Expand description
Typed host buffer pooling for reusable tensor allocations.
§Examples
ⓘ
use tenferro_tensor::buffer_pool::{BufferPool, PoolScalar};
let mut pool = BufferPool::new();
let mut buf = unsafe { <f64 as PoolScalar>::pool_acquire(&mut pool, 4) };
buf.fill(1.0);
<f64 as PoolScalar>::pool_release(&mut pool, buf);
assert_eq!(pool.len(), 1);Structs§
- Buffer
Pool - Typed buffer pool keyed by element capacity and separated by scalar type.
Traits§
- Pool
Scalar - Scalar types supported by
BufferPool.