/external/pthreadpool/src/ |
D | pthreads.c | 80 static void checkin_worker_thread(struct pthreadpool* threadpool) { in checkin_worker_thread() argument 82 if (pthreadpool_decrement_fetch_relaxed_size_t(&threadpool->active_threads) == 0) { in checkin_worker_thread() 83 pthreadpool_store_release_uint32_t(&threadpool->has_active_threads, 0); in checkin_worker_thread() 84 futex_wake_all(&threadpool->has_active_threads); in checkin_worker_thread() 87 pthread_mutex_lock(&threadpool->completion_mutex); in checkin_worker_thread() 88 if (pthreadpool_decrement_fetch_release_size_t(&threadpool->active_threads) == 0) { in checkin_worker_thread() 89 pthread_cond_signal(&threadpool->completion_condvar); in checkin_worker_thread() 91 pthread_mutex_unlock(&threadpool->completion_mutex); in checkin_worker_thread() 95 static void wait_worker_threads(struct pthreadpool* threadpool) { in wait_worker_threads() argument 98 uint32_t has_active_threads = pthreadpool_load_acquire_uint32_t(&threadpool->has_active_threads); in wait_worker_threads() [all …]
|
D | windows.c | 23 static void checkin_worker_thread(struct pthreadpool* threadpool, uint32_t event_index) { in checkin_worker_thread() argument 24 if (pthreadpool_decrement_fetch_release_size_t(&threadpool->active_threads) == 0) { in checkin_worker_thread() 25 SetEvent(threadpool->completion_event[event_index]); in checkin_worker_thread() 29 static void wait_worker_threads(struct pthreadpool* threadpool, uint32_t event_index) { in wait_worker_threads() argument 31 size_t active_threads = pthreadpool_load_acquire_size_t(&threadpool->active_threads); in wait_worker_threads() 40 active_threads = pthreadpool_load_acquire_size_t(&threadpool->active_threads); in wait_worker_threads() 47 const DWORD wait_status = WaitForSingleObject(threadpool->completion_event[event_index], INFINITE); in wait_worker_threads() 49 assert(pthreadpool_load_relaxed_size_t(&threadpool->active_threads) == 0); in wait_worker_threads() 53 struct pthreadpool* threadpool, in wait_for_new_command() argument 57 uint32_t command = pthreadpool_load_acquire_uint32_t(&threadpool->command); in wait_for_new_command() [all …]
|
D | fastpath.c | 26 struct pthreadpool* threadpool, in pthreadpool_thread_parallelize_1d_fastpath() argument 29 assert(threadpool != NULL); in pthreadpool_thread_parallelize_1d_fastpath() 32 …adpool_task_1d_t task = (pthreadpool_task_1d_t) pthreadpool_load_relaxed_void_p(&threadpool->task); in pthreadpool_thread_parallelize_1d_fastpath() 33 void *const argument = pthreadpool_load_relaxed_void_p(&threadpool->argument); in pthreadpool_thread_parallelize_1d_fastpath() 35 const size_t threads_count = threadpool->threads_count.value; in pthreadpool_thread_parallelize_1d_fastpath() 50 struct thread_info* other_thread = &threadpool->threads[tid]; in pthreadpool_thread_parallelize_1d_fastpath() 62 struct pthreadpool* threadpool, in pthreadpool_thread_parallelize_1d_with_uarch_fastpath() argument 65 assert(threadpool != NULL); in pthreadpool_thread_parallelize_1d_with_uarch_fastpath() 68 …ith_id_t task = (pthreadpool_task_1d_with_id_t) pthreadpool_load_relaxed_void_p(&threadpool->task); in pthreadpool_thread_parallelize_1d_with_uarch_fastpath() 69 void *const argument = pthreadpool_load_relaxed_void_p(&threadpool->argument); in pthreadpool_thread_parallelize_1d_with_uarch_fastpath() [all …]
|
D | gcd.c | 25 struct pthreadpool* threadpool = (struct pthreadpool*) arg; in thread_main() local 26 struct thread_info* thread = &threadpool->threads[thread_index]; in thread_main() 28 const uint32_t flags = pthreadpool_load_relaxed_uint32_t(&threadpool->flags); in thread_main() 30 (thread_function_t) pthreadpool_load_relaxed_void_p(&threadpool->thread_function); in thread_main() 38 thread_function(threadpool, thread); in thread_main() 60 struct pthreadpool* threadpool = pthreadpool_allocate(threads_count); in pthreadpool_create() local 61 if (threadpool == NULL) { in pthreadpool_create() 64 threadpool->threads_count = fxdiv_init_size_t(threads_count); in pthreadpool_create() 66 threadpool->threads[tid].thread_number = tid; in pthreadpool_create() 71 threadpool->execution_semaphore = dispatch_semaphore_create(1); in pthreadpool_create() [all …]
|
D | portable-api.c | 24 size_t pthreadpool_get_threads_count(struct pthreadpool* threadpool) { in pthreadpool_get_threads_count() argument 25 if (threadpool == NULL) { in pthreadpool_get_threads_count() 29 return threadpool->threads_count.value; in pthreadpool_get_threads_count() 32 static void thread_parallelize_1d(struct pthreadpool* threadpool, struct thread_info* thread) { in thread_parallelize_1d() argument 33 assert(threadpool != NULL); in thread_parallelize_1d() 36 …adpool_task_1d_t task = (pthreadpool_task_1d_t) pthreadpool_load_relaxed_void_p(&threadpool->task); in thread_parallelize_1d() 37 void *const argument = pthreadpool_load_relaxed_void_p(&threadpool->argument); in thread_parallelize_1d() 47 const size_t threads_count = threadpool->threads_count.value; in thread_parallelize_1d() 52 struct thread_info* other_thread = &threadpool->threads[tid]; in thread_parallelize_1d() 63 static void thread_parallelize_1d_with_uarch(struct pthreadpool* threadpool, struct thread_info* th… in thread_parallelize_1d_with_uarch() argument [all …]
|
D | memory.c | 28 struct pthreadpool* threadpool = NULL; in pthreadpool_allocate() local 34 threadpool = memalign(PTHREADPOOL_CACHELINE_SIZE, threadpool_size); in pthreadpool_allocate() 35 if (threadpool == NULL) { in pthreadpool_allocate() 39 threadpool = _aligned_malloc(threadpool_size, PTHREADPOOL_CACHELINE_SIZE); in pthreadpool_allocate() 40 if (threadpool == NULL) { in pthreadpool_allocate() 44 if (posix_memalign((void**) &threadpool, PTHREADPOOL_CACHELINE_SIZE, threadpool_size) != 0) { in pthreadpool_allocate() 48 memset(threadpool, 0, threadpool_size); in pthreadpool_allocate() 49 return threadpool; in pthreadpool_allocate() 54 struct pthreadpool* threadpool) in pthreadpool_deallocate() argument 56 assert(threadpool != NULL); in pthreadpool_deallocate() [all …]
|
D | threadpool-object.h | 66 struct pthreadpool* threadpool; member 716 struct pthreadpool* threadpool); 718 typedef void (*thread_function_t)(struct pthreadpool* threadpool, struct thread_info* thread); 721 struct pthreadpool* threadpool, 731 struct pthreadpool* threadpool, 735 struct pthreadpool* threadpool, 739 struct pthreadpool* threadpool, 743 struct pthreadpool* threadpool, 747 struct pthreadpool* threadpool, 751 struct pthreadpool* threadpool, [all …]
|
D | shim.c | 25 size_t pthreadpool_get_threads_count(struct pthreadpool* threadpool) { in pthreadpool_get_threads_count() argument 30 struct pthreadpool* threadpool, in pthreadpool_parallelize_1d() argument 42 pthreadpool_t threadpool, in pthreadpool_parallelize_1d_with_uarch() argument 56 pthreadpool_t threadpool, in pthreadpool_parallelize_1d_tile_1d() argument 69 struct pthreadpool* threadpool, in pthreadpool_parallelize_2d() argument 84 pthreadpool_t threadpool, in pthreadpool_parallelize_2d_tile_1d() argument 100 pthreadpool_t threadpool, in pthreadpool_parallelize_2d_tile_2d() argument 117 pthreadpool_t threadpool, in pthreadpool_parallelize_2d_tile_2d_with_uarch() argument 137 pthreadpool_t threadpool, in pthreadpool_parallelize_3d() argument 155 pthreadpool_t threadpool, in pthreadpool_parallelize_3d_tile_1d() argument [all …]
|
D | legacy-api.c | 15 pthreadpool_t threadpool, in pthreadpool_compute_1d() argument 20 pthreadpool_parallelize_1d(threadpool, in pthreadpool_compute_1d() 26 pthreadpool_t threadpool, in pthreadpool_compute_1d_tiled() argument 32 pthreadpool_parallelize_1d_tile_1d(threadpool, in pthreadpool_compute_1d_tiled() 38 pthreadpool_t threadpool, in pthreadpool_compute_2d() argument 44 pthreadpool_parallelize_2d(threadpool, in pthreadpool_compute_2d() 50 pthreadpool_t threadpool, in pthreadpool_compute_2d_tiled() argument 58 pthreadpool_parallelize_2d_tile_2d(threadpool, in pthreadpool_compute_2d_tiled() 94 pthreadpool_t threadpool, in pthreadpool_compute_3d_tiled() argument 104 if (pthreadpool_get_threads_count(threadpool) <= 1) { in pthreadpool_compute_3d_tiled() [all …]
|
/external/pthreadpool/bench/ |
D | throughput.cc | 10 pthreadpool_t threadpool = pthreadpool_create(2); in pthreadpool_parallelize_1d() local 11 const size_t threads = pthreadpool_get_threads_count(threadpool); in pthreadpool_parallelize_1d() 15 threadpool, in pthreadpool_parallelize_1d() 21 pthreadpool_destroy(threadpool); in pthreadpool_parallelize_1d() 33 pthreadpool_t threadpool = pthreadpool_create(2); in pthreadpool_parallelize_1d_tile_1d() local 34 const size_t threads = pthreadpool_get_threads_count(threadpool); in pthreadpool_parallelize_1d_tile_1d() 38 threadpool, in pthreadpool_parallelize_1d_tile_1d() 44 pthreadpool_destroy(threadpool); in pthreadpool_parallelize_1d_tile_1d() 56 pthreadpool_t threadpool = pthreadpool_create(2); in pthreadpool_parallelize_2d() local 57 const size_t threads = pthreadpool_get_threads_count(threadpool); in pthreadpool_parallelize_2d() [all …]
|
D | latency.cc | 20 pthreadpool_t threadpool = pthreadpool_create(threads); in pthreadpool_parallelize_1d() local 23 threadpool, in pthreadpool_parallelize_1d() 29 pthreadpool_destroy(threadpool); in pthreadpool_parallelize_1d() 39 pthreadpool_t threadpool = pthreadpool_create(threads); in pthreadpool_parallelize_1d_tile_1d() local 42 threadpool, in pthreadpool_parallelize_1d_tile_1d() 48 pthreadpool_destroy(threadpool); in pthreadpool_parallelize_1d_tile_1d() 58 pthreadpool_t threadpool = pthreadpool_create(threads); in pthreadpool_parallelize_2d() local 61 threadpool, in pthreadpool_parallelize_2d() 67 pthreadpool_destroy(threadpool); in pthreadpool_parallelize_2d() 77 pthreadpool_t threadpool = pthreadpool_create(threads); in pthreadpool_parallelize_2d_tile_2d() local [all …]
|
/external/pthreadpool/test/ |
D | pthreadpool.cc | 102 pthreadpool* threadpool = nullptr; in TEST() local 103 pthreadpool_destroy(threadpool); in TEST() 107 pthreadpool* threadpool = pthreadpool_create(1); in TEST() local 108 ASSERT_TRUE(threadpool); in TEST() 109 pthreadpool_destroy(threadpool); in TEST() 113 pthreadpool* threadpool = pthreadpool_create(0); in TEST() local 114 ASSERT_TRUE(threadpool); in TEST() 115 pthreadpool_destroy(threadpool); in TEST() 122 auto_pthreadpool_t threadpool(pthreadpool_create(1), pthreadpool_destroy); in TEST() local 123 ASSERT_TRUE(threadpool.get()); in TEST() [all …]
|
/external/XNNPACK/models/ |
D | models.h | 16 typedef ExecutionPlan (*ExecutionPlanFactory)(pthreadpool_t threadpool); 18 ExecutionPlan FP32MobileNetV1(pthreadpool_t threadpool); 19 ExecutionPlan FP32MobileNetV2(pthreadpool_t threadpool); 20 ExecutionPlan FP32MobileNetV3Large(pthreadpool_t threadpool); 21 ExecutionPlan FP32MobileNetV3Small(pthreadpool_t threadpool); 23 ExecutionPlan FP32SparseMobileNetV1(float sparsity, pthreadpool_t threadpool); 24 ExecutionPlan FP32SparseMobileNetV2(float sparsity, pthreadpool_t threadpool); 25 ExecutionPlan FP32SparseMobileNetV3Large(float sparsity, pthreadpool_t threadpool); 26 ExecutionPlan FP32SparseMobileNetV3Small(float sparsity, pthreadpool_t threadpool); 28 ExecutionPlan FP16MobileNetV1(pthreadpool_t threadpool); [all …]
|
D | fp32-mobilenet-v3-small.cc | 19 ExecutionPlan FP32MobileNetV3Small(pthreadpool_t threadpool) { in FP32MobileNetV3Small() argument 2182 threadpool /* threadpool */); in FP32MobileNetV3Small() 2192 threadpool /* threadpool */); in FP32MobileNetV3Small() 2202 threadpool /* threadpool */); in FP32MobileNetV3Small() 2212 threadpool /* threadpool */); in FP32MobileNetV3Small() 2222 threadpool /* threadpool */); in FP32MobileNetV3Small() 2232 threadpool /* threadpool */); in FP32MobileNetV3Small() 2245 threadpool /* threadpool */); in FP32MobileNetV3Small() 2256 threadpool /* threadpool */); in FP32MobileNetV3Small() 2266 threadpool /* threadpool */); in FP32MobileNetV3Small() [all …]
|
D | fp32-mobilenet-v3-large.cc | 19 ExecutionPlan FP32MobileNetV3Large(pthreadpool_t threadpool) { in FP32MobileNetV3Large() argument 2517 threadpool /* threadpool */); in FP32MobileNetV3Large() 2527 threadpool /* threadpool */); in FP32MobileNetV3Large() 2537 threadpool /* threadpool */); in FP32MobileNetV3Large() 2547 threadpool /* threadpool */); in FP32MobileNetV3Large() 2560 threadpool /* threadpool */); in FP32MobileNetV3Large() 2571 threadpool /* threadpool */); in FP32MobileNetV3Large() 2581 threadpool /* threadpool */); in FP32MobileNetV3Large() 2591 threadpool /* threadpool */); in FP32MobileNetV3Large() 2601 threadpool /* threadpool */); in FP32MobileNetV3Large() [all …]
|
D | fp16-mobilenet-v3-small.cc | 21 ExecutionPlan FP16MobileNetV3Small(pthreadpool_t threadpool) { in FP16MobileNetV3Small() argument 2185 threadpool /* threadpool */); in FP16MobileNetV3Small() 2195 threadpool /* threadpool */); in FP16MobileNetV3Small() 2205 threadpool /* threadpool */); in FP16MobileNetV3Small() 2215 threadpool /* threadpool */); in FP16MobileNetV3Small() 2225 threadpool /* threadpool */); in FP16MobileNetV3Small() 2235 threadpool /* threadpool */); in FP16MobileNetV3Small() 2248 threadpool /* threadpool */); in FP16MobileNetV3Small() 2259 threadpool /* threadpool */); in FP16MobileNetV3Small() 2269 threadpool /* threadpool */); in FP16MobileNetV3Small() [all …]
|
D | fp16-mobilenet-v3-large.cc | 21 ExecutionPlan FP16MobileNetV3Large(pthreadpool_t threadpool) { in FP16MobileNetV3Large() argument 2520 threadpool /* threadpool */); in FP16MobileNetV3Large() 2530 threadpool /* threadpool */); in FP16MobileNetV3Large() 2540 threadpool /* threadpool */); in FP16MobileNetV3Large() 2550 threadpool /* threadpool */); in FP16MobileNetV3Large() 2563 threadpool /* threadpool */); in FP16MobileNetV3Large() 2574 threadpool /* threadpool */); in FP16MobileNetV3Large() 2584 threadpool /* threadpool */); in FP16MobileNetV3Large() 2594 threadpool /* threadpool */); in FP16MobileNetV3Large() 2604 threadpool /* threadpool */); in FP16MobileNetV3Large() [all …]
|
D | fp32-sparse-mobilenet-v3-large.cc | 19 ExecutionPlan FP32SparseMobileNetV3Large(float sparsity, pthreadpool_t threadpool) { in FP32SparseMobileNetV3Large() argument 2609 threadpool /* threadpool */); in FP32SparseMobileNetV3Large() 2619 threadpool /* threadpool */); in FP32SparseMobileNetV3Large() 2629 threadpool /* threadpool */); in FP32SparseMobileNetV3Large() 2639 threadpool /* threadpool */); in FP32SparseMobileNetV3Large() 2652 threadpool /* threadpool */); in FP32SparseMobileNetV3Large() 2663 threadpool /* threadpool */); in FP32SparseMobileNetV3Large() 2673 threadpool /* threadpool */); in FP32SparseMobileNetV3Large() 2683 threadpool /* threadpool */); in FP32SparseMobileNetV3Large() 2693 threadpool /* threadpool */); in FP32SparseMobileNetV3Large() [all …]
|
D | fp32-sparse-mobilenet-v3-small.cc | 19 ExecutionPlan FP32SparseMobileNetV3Small(float sparsity, pthreadpool_t threadpool) { in FP32SparseMobileNetV3Small() argument 2264 threadpool /* threadpool */); in FP32SparseMobileNetV3Small() 2274 threadpool /* threadpool */); in FP32SparseMobileNetV3Small() 2284 threadpool /* threadpool */); in FP32SparseMobileNetV3Small() 2294 threadpool /* threadpool */); in FP32SparseMobileNetV3Small() 2304 threadpool /* threadpool */); in FP32SparseMobileNetV3Small() 2314 threadpool /* threadpool */); in FP32SparseMobileNetV3Small() 2327 threadpool /* threadpool */); in FP32SparseMobileNetV3Small() 2338 threadpool /* threadpool */); in FP32SparseMobileNetV3Small() 2348 threadpool /* threadpool */); in FP32SparseMobileNetV3Small() [all …]
|
/external/pthreadpool/include/ |
D | pthreadpool.h | 86 size_t pthreadpool_get_threads_count(pthreadpool_t threadpool); 112 pthreadpool_t threadpool, 156 pthreadpool_t threadpool, 189 pthreadpool_t threadpool, 223 pthreadpool_t threadpool, 260 pthreadpool_t threadpool, 301 pthreadpool_t threadpool, 359 pthreadpool_t threadpool, 400 pthreadpool_t threadpool, 441 pthreadpool_t threadpool, [all …]
|
/external/XNNPACK/include/ |
D | xnnpack.h | 1149 pthreadpool_t threadpool, 1190 pthreadpool_t threadpool); 1209 pthreadpool_t threadpool); 1226 pthreadpool_t threadpool); 1249 pthreadpool_t threadpool); 1275 pthreadpool_t threadpool); 1289 pthreadpool_t threadpool); 1303 pthreadpool_t threadpool); 1319 pthreadpool_t threadpool); 1351 pthreadpool_t threadpool); [all …]
|
/external/XNNPACK/src/operators/ |
D | unary-elementwise-nc.c | 751 pthreadpool_t threadpool) in xnn_setup_abs_nc_f32() argument 767 pthreadpool_get_threads_count(threadpool)); in xnn_setup_abs_nc_f32() 775 pthreadpool_t threadpool) in xnn_setup_bankers_rounding_nc_f32() argument 791 pthreadpool_get_threads_count(threadpool)); in xnn_setup_bankers_rounding_nc_f32() 799 pthreadpool_t threadpool) in xnn_setup_ceiling_nc_f32() argument 815 pthreadpool_get_threads_count(threadpool)); in xnn_setup_ceiling_nc_f32() 823 pthreadpool_t threadpool) in xnn_setup_clamp_nc_s8() argument 839 pthreadpool_get_threads_count(threadpool)); in xnn_setup_clamp_nc_s8() 847 pthreadpool_t threadpool) in xnn_setup_clamp_nc_u8() argument 863 pthreadpool_get_threads_count(threadpool)); in xnn_setup_clamp_nc_u8() [all …]
|
/external/pthreadpool/examples/ |
D | addition.c | 24 pthreadpool_t threadpool = pthreadpool_create(0); in main() local 25 assert(threadpool != NULL); in main() 27 const size_t threads_count = pthreadpool_get_threads_count(threadpool); in main() 31 pthreadpool_parallelize_1d(threadpool, in main() 37 pthreadpool_destroy(threadpool); in main() 38 threadpool = NULL; in main()
|
/external/XNNPACK/bench/ |
D | end2end.cc | 30 std::unique_ptr<pthreadpool, decltype(&pthreadpool_destroy)> threadpool( in End2EndBenchmark() local 33 auto execution_plan = model_factory(threadpool.get()); in End2EndBenchmark() 41 xnn_status status = xnn_run_operator(op.get(), threadpool.get()); in End2EndBenchmark() 72 End2EndBenchmark(state, [](pthreadpool_t threadpool) { in FP32Sparse80MobileNetV1() argument 73 return models::FP32SparseMobileNetV1(0.8f, threadpool); in FP32Sparse80MobileNetV1() 78 End2EndBenchmark(state, [](pthreadpool_t threadpool) { in FP32Sparse80MobileNetV2() argument 79 return models::FP32SparseMobileNetV2(0.8f, threadpool); in FP32Sparse80MobileNetV2() 84 End2EndBenchmark(state, [](pthreadpool_t threadpool) { in FP32Sparse80MobileNetV3Large() argument 85 return models::FP32SparseMobileNetV3Large(0.8f, threadpool); in FP32Sparse80MobileNetV3Large() 90 End2EndBenchmark(state, [](pthreadpool_t threadpool) { in FP32Sparse80MobileNetV3Small() argument [all …]
|
/external/mesa3d/src/gallium/frontends/nine/ |
D | threadpool.h | 33 struct threadpool { struct 53 struct threadpool *_mesa_threadpool_create(struct NineSwapChain9 *swapchain); argument 54 void _mesa_threadpool_destroy(struct NineSwapChain9 *swapchain, struct threadpool *pool); 55 struct threadpool_task *_mesa_threadpool_queue_task(struct threadpool *pool, 58 void _mesa_threadpool_wait_for_task(struct threadpool *pool,
|