pub struct CudaMemPoolBuilder { /* private fields */ }Expand description
Implementations§
Source§impl CudaMemPoolBuilder
impl CudaMemPoolBuilder
Sourcepub fn new(context: Arc<CudaContext>, reserve_size: usize) -> Self
pub fn new(context: Arc<CudaContext>, reserve_size: usize) -> Self
Create a new builder with the required reserve size.
§Arguments
context- CUDA context for the devicereserve_size- Number of bytes to pre-allocate to warm the pool
Sourcepub fn release_threshold(self, threshold: u64) -> Self
pub fn release_threshold(self, threshold: u64) -> Self
Set the release threshold for the pool.
Memory above this threshold is returned to the system when freed. If not set, no release threshold is configured (CUDA default behavior).
Sourcepub fn build(self) -> Result<CudaMemPool>
pub fn build(self) -> Result<CudaMemPool>
Build the CUDA memory pool.
This will:
- Create the pool
- Set the release threshold if configured
- Pre-allocate and free memory to warm the pool
Auto Trait Implementations§
impl Freeze for CudaMemPoolBuilder
impl RefUnwindSafe for CudaMemPoolBuilder
impl Send for CudaMemPoolBuilder
impl Sync for CudaMemPoolBuilder
impl Unpin for CudaMemPoolBuilder
impl UnsafeUnpin for CudaMemPoolBuilder
impl UnwindSafe for CudaMemPoolBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more