Loom C API
Public Loom compiler C API
Toggle main menu visibility
Loading...
Searching...
No Matches
task_pool.h
Go to the documentation of this file.
1
// Copyright 2026 The IREE Authors
2
//
3
// Licensed under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
7
#ifndef LOOMC_TASK_POOL_H_
8
#define LOOMC_TASK_POOL_H_
9
10
#include "
loomc/status.h
"
11
24
25
#ifdef __cplusplus
26
extern
"C"
{
27
#endif
28
30
typedef
struct
loomc_task_pool_t
loomc_task_pool_t
;
31
37
typedef
struct
loomc_task_pool_options_t
{
40
loomc_structure_type_t
type
;
41
43
loomc_host_size_t
structure_size
;
44
46
const
void
*
next
;
47
56
loomc_host_size_t
max_worker_count
;
57
64
loomc_host_size_t
worker_stack_size
;
65
}
loomc_task_pool_options_t
;
66
78
LOOMC_API_EXPORT
loomc_status_t
loomc_task_pool_allocate
(
79
const
loomc_task_pool_options_t
* options,
loomc_allocator_t
allocator,
80
loomc_task_pool_t
** out_pool);
81
86
LOOMC_API_EXPORT
loomc_host_size_t
87
loomc_task_pool_worker_count
(
const
loomc_task_pool_t
* pool);
88
96
LOOMC_API_EXPORT
void
loomc_task_pool_free
(
loomc_task_pool_t
* pool);
97
98
#ifdef __cplusplus
99
}
// extern "C"
100
#endif
101
102
#endif
// LOOMC_TASK_POOL_H_
LOOMC_API_EXPORT
#define LOOMC_API_EXPORT
Exports a public Loom C API symbol from a shared library build.
Definition
base.h:34
loomc_host_size_t
size_t loomc_host_size_t
Host allocation and container size type.
Definition
base.h:45
loomc_structure_type_t
loomc_structure_type_t
Structure type values used by extensible public descriptors.
Definition
base.h:181
loomc_status_t
struct iree_status_handle_t * loomc_status_t
Opaque status handle.
Definition
base.h:55
status.h
Status codes and rich infrastructure error reporting.
loomc_allocator_t
Host allocator used for persistent Loom object storage.
Definition
base.h:390
loomc_task_pool_options_t
Task-pool creation options.
Definition
task_pool.h:37
loomc_task_pool_options_t::next
const void * next
Extension chain for future task-pool options.
Definition
task_pool.h:46
loomc_task_pool_options_t::structure_size
loomc_host_size_t structure_size
Size of this structure in bytes.
Definition
task_pool.h:43
loomc_task_pool_options_t::type
loomc_structure_type_t type
Structure type.
Definition
task_pool.h:40
loomc_task_pool_options_t::worker_stack_size
loomc_host_size_t worker_stack_size
Minimum stack size in bytes for each worker, or zero for the default.
Definition
task_pool.h:64
loomc_task_pool_options_t::max_worker_count
loomc_host_size_t max_worker_count
Maximum physical-core workers to create, or zero for the default.
Definition
task_pool.h:56
loomc_task_pool_t
struct loomc_task_pool_t loomc_task_pool_t
Opaque standard task pool.
Definition
task_pool.h:30
loomc_task_pool_free
void loomc_task_pool_free(loomc_task_pool_t *pool)
Releases the pool's worker-executor reference and frees pool.
loomc_task_pool_allocate
loomc_status_t loomc_task_pool_allocate(const loomc_task_pool_options_t *options, loomc_allocator_t allocator, loomc_task_pool_t **out_pool)
Allocates a standard task pool and starts its worker population.
loomc_task_pool_worker_count
loomc_host_size_t loomc_task_pool_worker_count(const loomc_task_pool_t *pool)
Returns the number of worker threads represented by pool.
loomc
task_pool.h
Generated by
1.17.0