Struct thrust::mr::pool_options
A type used for configuring pooling resource adaptors, to fine-tune their behavior and parameters.
#include <thrust/mr/pool_options.h>
struct thrust::mr::pool_options { public: std::size_t min_blocks_per_chunk;
std::size_t min_bytes_per_chunk;
std::size_t max_blocks_per_chunk;
std::size_t max_bytes_per_chunk;
std::size_t smallest_block_size;
std::size_t largest_block_size;
std::size_t alignment;
bool cache_oversized;
std::size_t cached_size_cutoff_factor;
std::size_t cached_alignment_cutoff_factor;
bool validate() const; };
Member Variables
Variable thrust::mr::pool_options::min_blocks_per_chunk
std::size_t min_blocks_per_chunk;
The minimal number of blocks, i.e. pieces of memory handed off to the user from a pool of a given size, in a single chunk allocated from upstream.
Variable thrust::mr::pool_options::min_bytes_per_chunk
std::size_t min_bytes_per_chunk;
The minimal number of bytes in a single chunk allocated from upstream.
Variable thrust::mr::pool_options::max_blocks_per_chunk
std::size_t max_blocks_per_chunk;
The maximal number of blocks, i.e. pieces of memory handed off to the user from a pool of a given size, in a single chunk allocated from upstream.
Variable thrust::mr::pool_options::max_bytes_per_chunk
std::size_t max_bytes_per_chunk;
The maximal number of bytes in a single chunk allocated from upstream.
Variable thrust::mr::pool_options::smallest_block_size
std::size_t smallest_block_size;
The size of blocks in the smallest pool covered by the pool resource. All allocation requests below this size will be rounded up to this size.
Variable thrust::mr::pool_options::largest_block_size
std::size_t largest_block_size;
The size of blocks in the largest pool covered by the pool resource. All allocation requests above this size will be considered oversized, allocated directly from upstream (and not from a pool), and cached only of cache_oversized
is true.
Variable thrust::mr::pool_options::alignment
std::size_t alignment;
The alignment of all blocks in internal pools of the pool resource. All allocation requests above this alignment will be considered oversized, allocated directly from upstream (and not from a pool), and cached only of cache_oversized
is true.
Variable thrust::mr::pool_options::cache_oversized
bool cache_oversized;
Decides whether oversized and overaligned blocks are cached for later use, or immediately return it to the upstream resource.
Variable thrust::mr::pool_options::cached_size_cutoff_factor
std::size_t cached_size_cutoff_factor;
The size factor at which a cached allocation is considered too ridiculously oversized to use to fulfill an allocation request. For instance: the user requests an allocation of size 1024 bytes. A block of size 32 * 1024 bytes is cached. If cached_size_cutoff_factor
is 32 or less, this block will be considered too big for that allocation request.
Variable thrust::mr::pool_options::cached_alignment_cutoff_factor
std::size_t cached_alignment_cutoff_factor;
The alignment factor at which a cached allocation is considered too ridiculously overaligned to use to fulfill an allocation request. For instance: the user requests an allocation aligned to 32 bytes. A block aligned to 1024 bytes is cached. If cached_size_cutoff_factor
is 32 or less, this block will be considered too overaligned for that allocation request.
Member Functions
Function thrust::mr::pool_options::validate
bool validate() const;
Checks if the options are self-consistent.
/returns true if the options are self-consitent, false otherwise.