60 typedef uint16_t
id_t;
140 uintptr_t ids =
reinterpret_cast<std::uintptr_t
>(pthread_getspecific(
m_ptkey));
141 return ids >>
sizeof(
id_t)*8;
149 uintptr_t ids =
reinterpret_cast<std::uintptr_t
>(pthread_getspecific(
m_ptkey));
150 return ids & ((
static_cast<uintptr_t
>(1) <<
sizeof(
id_t)*8) - 1);
177 #endif // USE_PHTREAD
181 #endif // NUMA_NUMA_H
bool barrier(unsigned int numThreads)
asagi::Grid::Error setThreads(unsigned int threads)
Synchronizes a set of threads.
asagi::Grid::Error broadcast(T &data, unsigned int root=0) const
NumaComm * createComm() const
unsigned int totalDomains() const
unsigned int m_totalThreads
bool broadcast(T &data, unsigned int numThreads, unsigned int current, unsigned int root=0)
unsigned int threadId() const
threads::Sync m_syncThreads
Include file for C and C++ API.
threads::Sync m_syncDomains
std::map< int, unsigned int > m_domains
asagi::Grid::Error registerThread(bool &masterThread, bool detectNumaDomains=true)
Registers a thread and detects the NUMA domain for this thread.
unsigned int domainId() const
asagi::Grid::Error barrier() const
unsigned int totalThreads() const
std::vector< bool > m_masterThreads