![]() |
batmat
0.0.17
Batched linear algebra routines
|
Various utilities.
Classes | |
| class | batmat::thread_pool |
Enumerations | |
| enum class | batmat::LoopDir { batmat::LoopDir::Forward , batmat::LoopDir::Backward } |
Functions | |
| void | batmat::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 | batmat::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). | |
| template<int R, int C, class F> | |
| consteval auto | batmat::make_2d_lut (F f) |
| Returns a 2D array of the form: | |
| template<int N, class F> | |
| consteval auto | batmat::make_1d_lut (F f) |
| Returns an array of the form: | |
| void | batmat::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 | batmat::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 | batmat::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. | |
|
strong |
|
inline |
#include <batmat/loop.hpp>
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).
|
inline |
#include <batmat/loop.hpp>
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).
|
consteval |
#include <batmat/lut.hpp>
Returns a 2D array of the form:
The argument f should be a function (or callable) that accepts two arguments of type index_constant.
|
consteval |
#include <batmat/lut.hpp>
Returns an array of the form:
The argument f should be a function (or callable) that accepts an argument of type index_constant.
| void batmat::pool_set_num_threads | ( | size_t | num_threads | ) |
#include <batmat/thread-pool.hpp>
Set the number of threads in the global thread pool.
Definition at line 11 of file thread-pool.cpp.
| void batmat::pool_sync_run_all | ( | F && | f | ) |
#include <batmat/thread-pool.hpp>
Run a function on all threads in the global thread pool, synchronously waiting for all threads.
Definition at line 117 of file thread-pool.hpp.
| void batmat::pool_sync_run_n | ( | I | n, |
| F && | f ) |
#include <batmat/thread-pool.hpp>
Run a function on the first n threads in the global thread pool, synchronously waiting for those threads.
If n is greater than the number of threads in the pool, the pool is expanded.
Definition at line 129 of file thread-pool.hpp.