MADNESS 0.10.1
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
madness::ThreadBinder Class Reference

#include <thread.h>

Public Member Functions

 ThreadBinder (bool print=false)
 
void bind ()
 
const size_t * get_cpus () const
 
const size_t get_ncpu () const
 
void set_do_bind (bool value)
 

Private Attributes

size_t cpus [maxncpu]
 
bool do_bind = true
 
size_t ncpu = 0
 
std::atomic< size_t > nextcpu = 0
 
bool print
 

Static Private Attributes

static thread_local bool bound = false
 
static const size_t maxncpu = 1024
 

Constructor & Destructor Documentation

◆ ThreadBinder()

madness::ThreadBinder::ThreadBinder ( bool  print = false)
inline

Member Function Documentation

◆ bind()

void madness::ThreadBinder::bind ( )
inline

◆ get_cpus()

const size_t * madness::ThreadBinder::get_cpus ( ) const
inline

References cpus.

Referenced by ThreadBinder().

◆ get_ncpu()

const size_t madness::ThreadBinder::get_ncpu ( ) const
inline

References ncpu.

Referenced by ThreadBinder().

◆ set_do_bind()

void madness::ThreadBinder::set_do_bind ( bool  value)
inline

References do_bind.

Member Data Documentation

◆ bound

thread_local bool madness::ThreadBinder::bound = false
staticprivate

Referenced by bind().

◆ cpus

size_t madness::ThreadBinder::cpus[maxncpu]
private

Referenced by ThreadBinder(), bind(), and get_cpus().

◆ do_bind

bool madness::ThreadBinder::do_bind = true
private

Referenced by bind(), and set_do_bind().

◆ maxncpu

const size_t madness::ThreadBinder::maxncpu = 1024
staticprivate

Referenced by ThreadBinder().

◆ ncpu

size_t madness::ThreadBinder::ncpu = 0
private

Referenced by ThreadBinder(), bind(), and get_ncpu().

◆ nextcpu

std::atomic<size_t> madness::ThreadBinder::nextcpu = 0
private

Referenced by ThreadBinder(), and bind().

◆ print

bool madness::ThreadBinder::print
private

Referenced by ThreadBinder(), and bind().


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