YAKL
Public Member Functions | List of all members
yakl::InitConfig Class Reference

An object of this class can optionally be passed to yakl::init() to configure the initialization. IMPORTANT: Creating an InitConfig object pings environment variables, making it quite expensive to create. Please do not create a lot of these. More...

#include <YAKL_InitConfig.h>

Public Member Functions

 InitConfig ()
 Creating an InitConfig() controls the memory pool parameters, timer function overrides, and device allocation and deallocation overrides. IMPORTANT: Creating an InitConfig object pings environment variables, making it quite expensive to create. Please do not create a lot of these. More...
 
std::function< void *(size_t, char const *)> get_device_allocator () const
 Get the device allocator function. Returns an empty std::function if the user has not set one. More...
 
std::function< void(void *, char const *)> get_device_deallocator () const
 Get the device deallocator function. Returns an empty std::function if the user has not set one. More...
 
size_t get_pool_block_bytes () const
 Determine how many bytes this config will request the pool to use for block size. More...
 
bool get_pool_enabled () const
 Determine whether this config object will enable the device memory pool. More...
 
size_t get_pool_grow_mb () const
 Determine how many MB this config will request the pool to use for additional pools. More...
 
size_t get_pool_initial_mb () const
 Determine how many MB this config will request the pool to use for the initial device memory pool. More...
 
std::function< void()> get_timer_finalize () const
 Get the timer finalize function. Returns an empty std::function if the user has not set one. More...
 
std::function< void()> get_timer_init () const
 Get the timer init function. Returns an empty std::function if the user has not set one. More...
 
std::function< void(char const *)> get_timer_start () const
 Get the timer start function. Returns an empty std::function if the user has not set one. More...
 
std::function< void(char const *)> get_timer_stop () const
 Get the timer stop function. Returns an empty std::function if the user has not set one. More...
 
InitConfig set_device_allocator (std::function< void *(size_t)> func)
 Pass the device allocator function you wish to use to override YAKL's default (NO LABEL) More...
 
InitConfig set_device_allocator (std::function< void *(size_t, char const *)> func)
 Pass the device allocator function you wish to use to override YAKL's default (LABEL) More...
 
InitConfig set_device_deallocator (std::function< void(void *)> func)
 Pass the device deallocator function you wish to use to override YAKL's default (NO LABEL) More...
 
InitConfig set_device_deallocator (std::function< void(void *, char const *)> func)
 Pass the device deallocator function you wish to use to override YAKL's default (LABEL) More...
 
InitConfig set_pool_block_bytes (size_t block_bytes)
 Tell YAKL how big each additional pool should be in MB. More...
 
InitConfig set_pool_enabled (bool enabled)
 Tell YAKL whether to enable the pool or not. More...
 
InitConfig set_pool_grow_mb (size_t grow_mb)
 Tell YAKL how big each additional pool should be in MB. More...
 
InitConfig set_pool_initial_mb (size_t initial_mb)
 Tell YAKL how big the initial pool should be in MB. More...
 
InitConfig set_timer_finalize (std::function< void()> func)
 Pass the timer finalize function you wish to use to override YAKL's default. More...
 
InitConfig set_timer_init (std::function< void()> func)
 Pass the timer init function you wish to use to override YAKL's default. More...
 
InitConfig set_timer_start (std::function< void(char const *)> func)
 Pass the timer start function you wish to use to override YAKL's default. More...
 
InitConfig set_timer_stop (std::function< void(char const *)> func)
 Pass the timer stop function you wish to use to override YAKL's default. More...
 

Detailed Description

An object of this class can optionally be passed to yakl::init() to configure the initialization. IMPORTANT: Creating an InitConfig object pings environment variables, making it quite expensive to create. Please do not create a lot of these.

This allows the user to override timer, allocation, and deallocation routines.

All set_ functions return the InitConfig object they were called on. Therefore, the user can code, e.g., yakl::init(yakl::InitConfig().set_device_allocator(myalloc).set_device_deallocator(myfree));

Constructor & Destructor Documentation

◆ InitConfig()

yakl::InitConfig::InitConfig ( )
inline

Creating an InitConfig() controls the memory pool parameters, timer function overrides, and device allocation and deallocation overrides. IMPORTANT: Creating an InitConfig object pings environment variables, making it quite expensive to create. Please do not create a lot of these.

Member Function Documentation

◆ get_device_allocator()

std::function<void *( size_t , char const *)> yakl::InitConfig::get_device_allocator ( ) const
inline

Get the device allocator function. Returns an empty std::function if the user has not set one.

◆ get_device_deallocator()

std::function<void ( void * , char const *)> yakl::InitConfig::get_device_deallocator ( ) const
inline

Get the device deallocator function. Returns an empty std::function if the user has not set one.

◆ get_pool_block_bytes()

size_t yakl::InitConfig::get_pool_block_bytes ( ) const
inline

Determine how many bytes this config will request the pool to use for block size.

◆ get_pool_enabled()

bool yakl::InitConfig::get_pool_enabled ( ) const
inline

Determine whether this config object will enable the device memory pool.

◆ get_pool_grow_mb()

size_t yakl::InitConfig::get_pool_grow_mb ( ) const
inline

Determine how many MB this config will request the pool to use for additional pools.

◆ get_pool_initial_mb()

size_t yakl::InitConfig::get_pool_initial_mb ( ) const
inline

Determine how many MB this config will request the pool to use for the initial device memory pool.

◆ get_timer_finalize()

std::function<void ()> yakl::InitConfig::get_timer_finalize ( ) const
inline

Get the timer finalize function. Returns an empty std::function if the user has not set one.

◆ get_timer_init()

std::function<void ()> yakl::InitConfig::get_timer_init ( ) const
inline

Get the timer init function. Returns an empty std::function if the user has not set one.

◆ get_timer_start()

std::function<void (char const *)> yakl::InitConfig::get_timer_start ( ) const
inline

Get the timer start function. Returns an empty std::function if the user has not set one.

◆ get_timer_stop()

std::function<void (char const *)> yakl::InitConfig::get_timer_stop ( ) const
inline

Get the timer stop function. Returns an empty std::function if the user has not set one.

◆ set_device_allocator() [1/2]

InitConfig yakl::InitConfig::set_device_allocator ( std::function< void *(size_t)>  func)
inline

Pass the device allocator function you wish to use to override YAKL's default (NO LABEL)

◆ set_device_allocator() [2/2]

InitConfig yakl::InitConfig::set_device_allocator ( std::function< void *(size_t, char const *)>  func)
inline

Pass the device allocator function you wish to use to override YAKL's default (LABEL)

◆ set_device_deallocator() [1/2]

InitConfig yakl::InitConfig::set_device_deallocator ( std::function< void(void *)>  func)
inline

Pass the device deallocator function you wish to use to override YAKL's default (NO LABEL)

◆ set_device_deallocator() [2/2]

InitConfig yakl::InitConfig::set_device_deallocator ( std::function< void(void *, char const *)>  func)
inline

Pass the device deallocator function you wish to use to override YAKL's default (LABEL)

◆ set_pool_block_bytes()

InitConfig yakl::InitConfig::set_pool_block_bytes ( size_t  block_bytes)
inline

Tell YAKL how big each additional pool should be in MB.

◆ set_pool_enabled()

InitConfig yakl::InitConfig::set_pool_enabled ( bool  enabled)
inline

Tell YAKL whether to enable the pool or not.

◆ set_pool_grow_mb()

InitConfig yakl::InitConfig::set_pool_grow_mb ( size_t  grow_mb)
inline

Tell YAKL how big each additional pool should be in MB.

◆ set_pool_initial_mb()

InitConfig yakl::InitConfig::set_pool_initial_mb ( size_t  initial_mb)
inline

Tell YAKL how big the initial pool should be in MB.

◆ set_timer_finalize()

InitConfig yakl::InitConfig::set_timer_finalize ( std::function< void()>  func)
inline

Pass the timer finalize function you wish to use to override YAKL's default.

◆ set_timer_init()

InitConfig yakl::InitConfig::set_timer_init ( std::function< void()>  func)
inline

Pass the timer init function you wish to use to override YAKL's default.

◆ set_timer_start()

InitConfig yakl::InitConfig::set_timer_start ( std::function< void(char const *)>  func)
inline

Pass the timer start function you wish to use to override YAKL's default.

◆ set_timer_stop()

InitConfig yakl::InitConfig::set_timer_stop ( std::function< void(char const *)>  func)
inline

Pass the timer stop function you wish to use to override YAKL's default.


The documentation for this class was generated from the following file: