5#ifndef NUMERICAL_MEMORY_HPP
6#define NUMERICAL_MEMORY_HPP
12#elif defined(__APPLE__)
13# include <malloc/malloc.h>
46 if (
pool !=
nullptr) {
50 kept_huge_blocks::shared().clear();
57#elif defined(__APPLE__)
numerical::buffer, the storage of the library's vectors, matrices and tensors: a std::vector whose el...
static kept_blocks & shared()
The process's blocks, never destroyed: a buffer of static storage may be freed after any destructor.
void clear() noexcept
Frees every block kept (numerical::release_memory).
The threads every kernel shares, started once: a parallel_for costs a wake-up, not a thread start.
static thread_pool * started() noexcept
The pool if shared has started it, else nullptr (asking starts nothing).
void release_thread_memory()
Empties every workspace the calling thread keeps between calls: its thread_releases,...
void release_memory_on(thread_pool *pool)
numerical::release_memory with pool's workers, none where it is nullptr (a pool never started holds n...
void release_and_trim()
release_thread_memory, then the allocator's free pages to the system, on the calling thread: glibc ke...
The NumericAL public API.
void release_memory()
Frees the workspaces NumericAL keeps between calls, as oneMKL's mkl_free_buffers: each thread keeps t...
A minimal std::thread parallel-for for the hot kernels.