#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#if PTHREADPOOL_USE_CPUINFO
#include <cpuinfo.h>
#endif
#include <fxdiv.h>
#include <pthreadpool.h>
#include "threadpool-atomics.h"
#include "threadpool-object.h"
#include "threadpool-utils.h"
size_t pthreadpool_get_threads_count(struct pthreadpool* threadpool) { … }
static void thread_parallelize_1d(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_1d_with_thread(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_1d_with_uarch(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_1d_tile_1d(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_2d(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_2d_with_thread(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_2d_tile_1d(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_2d_tile_1d_with_uarch(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_2d_tile_1d_with_uarch_with_thread(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_2d_tile_2d(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_2d_tile_2d_with_uarch(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_3d(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_3d_tile_1d(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_3d_tile_1d_with_thread(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_3d_tile_1d_with_uarch(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_3d_tile_1d_with_uarch_with_thread(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_3d_tile_2d(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_3d_tile_2d_with_uarch(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_4d(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_4d_tile_1d(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_4d_tile_2d(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_4d_tile_2d_with_uarch(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_5d(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_5d_tile_1d(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_5d_tile_2d(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_6d(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_6d_tile_1d(struct pthreadpool* threadpool, struct thread_info* thread) { … }
static void thread_parallelize_6d_tile_2d(struct pthreadpool* threadpool, struct thread_info* thread) { … }
void pthreadpool_parallelize_1d(
struct pthreadpool* threadpool,
pthreadpool_task_1d_t task,
void* argument,
size_t range,
uint32_t flags)
{ … }
void pthreadpool_parallelize_1d_with_thread(
struct pthreadpool* threadpool,
pthreadpool_task_1d_with_thread_t task,
void* argument,
size_t range,
uint32_t flags)
{ … }
void pthreadpool_parallelize_1d_with_uarch(
pthreadpool_t threadpool,
pthreadpool_task_1d_with_id_t task,
void* argument,
uint32_t default_uarch_index,
uint32_t max_uarch_index,
size_t range,
uint32_t flags)
{ … }
void pthreadpool_parallelize_1d_tile_1d(
pthreadpool_t threadpool,
pthreadpool_task_1d_tile_1d_t task,
void* argument,
size_t range,
size_t tile,
uint32_t flags)
{ … }
void pthreadpool_parallelize_2d(
pthreadpool_t threadpool,
pthreadpool_task_2d_t task,
void* argument,
size_t range_i,
size_t range_j,
uint32_t flags)
{ … }
void pthreadpool_parallelize_2d_with_thread(
pthreadpool_t threadpool,
pthreadpool_task_2d_with_thread_t task,
void* argument,
size_t range_i,
size_t range_j,
uint32_t flags)
{ … }
void pthreadpool_parallelize_2d_tile_1d(
pthreadpool_t threadpool,
pthreadpool_task_2d_tile_1d_t task,
void* argument,
size_t range_i,
size_t range_j,
size_t tile_j,
uint32_t flags)
{ … }
void pthreadpool_parallelize_2d_tile_1d_with_uarch(
pthreadpool_t threadpool,
pthreadpool_task_2d_tile_1d_with_id_t task,
void* argument,
uint32_t default_uarch_index,
uint32_t max_uarch_index,
size_t range_i,
size_t range_j,
size_t tile_j,
uint32_t flags)
{ … }
void pthreadpool_parallelize_2d_tile_1d_with_uarch_with_thread(
pthreadpool_t threadpool,
pthreadpool_task_2d_tile_1d_with_id_with_thread_t task,
void* argument,
uint32_t default_uarch_index,
uint32_t max_uarch_index,
size_t range_i,
size_t range_j,
size_t tile_j,
uint32_t flags)
{ … }
void pthreadpool_parallelize_2d_tile_2d(
pthreadpool_t threadpool,
pthreadpool_task_2d_tile_2d_t task,
void* argument,
size_t range_i,
size_t range_j,
size_t tile_i,
size_t tile_j,
uint32_t flags)
{ … }
void pthreadpool_parallelize_2d_tile_2d_with_uarch(
pthreadpool_t threadpool,
pthreadpool_task_2d_tile_2d_with_id_t task,
void* argument,
uint32_t default_uarch_index,
uint32_t max_uarch_index,
size_t range_i,
size_t range_j,
size_t tile_i,
size_t tile_j,
uint32_t flags)
{ … }
void pthreadpool_parallelize_3d(
pthreadpool_t threadpool,
pthreadpool_task_3d_t task,
void* argument,
size_t range_i,
size_t range_j,
size_t range_k,
uint32_t flags)
{ … }
void pthreadpool_parallelize_3d_tile_1d(
pthreadpool_t threadpool,
pthreadpool_task_3d_tile_1d_t task,
void* argument,
size_t range_i,
size_t range_j,
size_t range_k,
size_t tile_k,
uint32_t flags)
{ … }
void pthreadpool_parallelize_3d_tile_1d_with_thread(
pthreadpool_t threadpool,
pthreadpool_task_3d_tile_1d_with_thread_t task,
void* argument,
size_t range_i,
size_t range_j,
size_t range_k,
size_t tile_k,
uint32_t flags)
{ … }
void pthreadpool_parallelize_3d_tile_1d_with_uarch(
pthreadpool_t threadpool,
pthreadpool_task_3d_tile_1d_with_id_t task,
void* argument,
uint32_t default_uarch_index,
uint32_t max_uarch_index,
size_t range_i,
size_t range_j,
size_t range_k,
size_t tile_k,
uint32_t flags)
{ … }
void pthreadpool_parallelize_3d_tile_1d_with_uarch_with_thread(
pthreadpool_t threadpool,
pthreadpool_task_3d_tile_1d_with_id_with_thread_t task,
void* argument,
uint32_t default_uarch_index,
uint32_t max_uarch_index,
size_t range_i,
size_t range_j,
size_t range_k,
size_t tile_k,
uint32_t flags)
{ … }
void pthreadpool_parallelize_3d_tile_2d(
pthreadpool_t threadpool,
pthreadpool_task_3d_tile_2d_t task,
void* argument,
size_t range_i,
size_t range_j,
size_t range_k,
size_t tile_j,
size_t tile_k,
uint32_t flags)
{ … }
void pthreadpool_parallelize_3d_tile_2d_with_uarch(
pthreadpool_t threadpool,
pthreadpool_task_3d_tile_2d_with_id_t task,
void* argument,
uint32_t default_uarch_index,
uint32_t max_uarch_index,
size_t range_i,
size_t range_j,
size_t range_k,
size_t tile_j,
size_t tile_k,
uint32_t flags)
{ … }
void pthreadpool_parallelize_4d(
pthreadpool_t threadpool,
pthreadpool_task_4d_t task,
void* argument,
size_t range_i,
size_t range_j,
size_t range_k,
size_t range_l,
uint32_t flags)
{ … }
void pthreadpool_parallelize_4d_tile_1d(
pthreadpool_t threadpool,
pthreadpool_task_4d_tile_1d_t task,
void* argument,
size_t range_i,
size_t range_j,
size_t range_k,
size_t range_l,
size_t tile_l,
uint32_t flags)
{ … }
void pthreadpool_parallelize_4d_tile_2d(
pthreadpool_t threadpool,
pthreadpool_task_4d_tile_2d_t task,
void* argument,
size_t range_i,
size_t range_j,
size_t range_k,
size_t range_l,
size_t tile_k,
size_t tile_l,
uint32_t flags)
{ … }
void pthreadpool_parallelize_4d_tile_2d_with_uarch(
pthreadpool_t threadpool,
pthreadpool_task_4d_tile_2d_with_id_t task,
void* argument,
uint32_t default_uarch_index,
uint32_t max_uarch_index,
size_t range_i,
size_t range_j,
size_t range_k,
size_t range_l,
size_t tile_k,
size_t tile_l,
uint32_t flags)
{ … }
void pthreadpool_parallelize_5d(
pthreadpool_t threadpool,
pthreadpool_task_5d_t task,
void* argument,
size_t range_i,
size_t range_j,
size_t range_k,
size_t range_l,
size_t range_m,
uint32_t flags)
{ … }
void pthreadpool_parallelize_5d_tile_1d(
pthreadpool_t threadpool,
pthreadpool_task_5d_tile_1d_t task,
void* argument,
size_t range_i,
size_t range_j,
size_t range_k,
size_t range_l,
size_t range_m,
size_t tile_m,
uint32_t flags)
{ … }
void pthreadpool_parallelize_5d_tile_2d(
pthreadpool_t threadpool,
pthreadpool_task_5d_tile_2d_t task,
void* argument,
size_t range_i,
size_t range_j,
size_t range_k,
size_t range_l,
size_t range_m,
size_t tile_l,
size_t tile_m,
uint32_t flags)
{ … }
void pthreadpool_parallelize_6d(
pthreadpool_t threadpool,
pthreadpool_task_6d_t task,
void* argument,
size_t range_i,
size_t range_j,
size_t range_k,
size_t range_l,
size_t range_m,
size_t range_n,
uint32_t flags)
{ … }
void pthreadpool_parallelize_6d_tile_1d(
pthreadpool_t threadpool,
pthreadpool_task_6d_tile_1d_t task,
void* argument,
size_t range_i,
size_t range_j,
size_t range_k,
size_t range_l,
size_t range_m,
size_t range_n,
size_t tile_n,
uint32_t flags)
{ … }
void pthreadpool_parallelize_6d_tile_2d(
pthreadpool_t threadpool,
pthreadpool_task_6d_tile_2d_t task,
void* argument,
size_t range_i,
size_t range_j,
size_t range_k,
size_t range_l,
size_t range_m,
size_t range_n,
size_t tile_m,
size_t tile_n,
uint32_t flags)
{ … }