batmat develop
Batched linear algebra routines
Loading...
Searching...
No Matches
batmat Namespace Reference

Namespaces

namespace  types
namespace  linalg
namespace  matrix
namespace  ops
namespace  datapar
namespace  detail

Classes

class  thread_pool
struct  DefaultTimings
 Measures the number of invocations of a specific piece of code and its run time. More...

Typedefs

template<index_t I>
using index_constant = std::integral_constant<index_t, I>

Enumerations

enum class  LoopDir { LoopDir::Forward , LoopDir::Backward }

Functions

void foreach_chunked (index_t i_begin, index_t i_end, auto chunk_size, auto func_chunk, auto func_rem, LoopDir dir=LoopDir::Forward)
 Iterate over the range [i_begin, i_end) in chunks of size chunk_size, calling func_chunk for each full chunk and func_rem for the remaining elements (if any).
void foreach_chunked_merged (index_t i_begin, index_t i_end, auto chunk_size, auto func_chunk, LoopDir dir=LoopDir::Forward)
 Iterate over the range [i_begin, i_end) in chunks of size chunk_size, calling func_chunk for each chunk (including the last chunk, which may be smaller than chunk_size).
void foreach_chunked_merged_parallel (index_t i_begin, index_t i_end, auto chunk_size, auto func_chunk, LoopDir dir=LoopDir::Forward)
void foreach_thread (auto &&func)
void foreach_thread (index_t num_threads, auto &&func)
template<int R, int C, class F>
consteval auto make_2d_lut (F f)
 Returns a 2D array of the form:
template<int N, class F>
consteval auto make_1d_lut (F f)
 Returns an array of the form:
void pool_set_num_threads (size_t num_threads)
 Set the number of threads in the global thread pool.
template<class I = size_t, class F>
void pool_sync_run_all (F &&f)
 Run a function on all threads in the global thread pool, synchronously waiting for all threads.
template<class I = size_t, class F>
void pool_sync_run_n (I n, F &&f)
 Run a function on the first n threads in the global thread pool, synchronously waiting for those threads.
std::ostream & operator<< (std::ostream &, DefaultTimings)
decltype(auto) timed (T &time, F &&func, Args &&...args)

Class Documentation

◆ batmat::DefaultTimings

struct batmat::DefaultTimings
Class Members
int64_t num_invocations {}
nanoseconds wall_time {}

Typedef Documentation

◆ index_constant

template<index_t I>
using batmat::index_constant = std::integral_constant<index_t, I>

Definition at line 10 of file lut.hpp.

Function Documentation

◆ foreach_chunked_merged_parallel()

void batmat::foreach_chunked_merged_parallel ( index_t i_begin,
index_t i_end,
auto chunk_size,
auto func_chunk,
LoopDir dir = LoopDir::Forward )
inline

Definition at line 65 of file loop.hpp.

◆ foreach_thread() [1/2]

void batmat::foreach_thread ( auto && func)
inline

Definition at line 93 of file loop.hpp.

◆ foreach_thread() [2/2]

void batmat::foreach_thread ( index_t num_threads,
auto && func )
inline

Definition at line 111 of file loop.hpp.

◆ operator<<()

std::ostream & batmat::operator<< ( std::ostream & os,
DefaultTimings t )

Definition at line 8 of file timing.cpp.

◆ timed()

decltype(auto) guanaqo::timed ( T & time,
F && func,
Args &&... args )