Loom C API
Public Loom compiler C API
Loading...
Searching...
No Matches
task_pool.h File Reference

Optional adapters between Loom task pools and IREE task executors. More...

Go to the source code of this file.

Functions

loomc_status_t loomc_task_pool_allocate_from_iree_executor (iree_task_executor_t *executor, loomc_allocator_t allocator, loomc_task_pool_t **out_pool)
 Allocates a Loom task pool retaining an existing IREE task executor.
iree_task_executor_t * iree_task_executor_from_loomc_task_pool (const loomc_task_pool_t *pool)
 Returns the borrowed IREE task executor owned by pool.

Detailed Description

Optional adapters between Loom task pools and IREE task executors.

IREE-hosted applications use these adapters to share one worker executor between Loom task queues, HAL materializers, and application-owned cooperative processes. Core LoomC headers remain independent from IREE task types.

Function Documentation

◆ iree_task_executor_from_loomc_task_pool()

iree_task_executor_t * iree_task_executor_from_loomc_task_pool ( const loomc_task_pool_t * pool)

Returns the borrowed IREE task executor owned by pool.

Parameters
poolPool to query, or NULL.
Returns
Borrowed executor, or NULL for a NULL pool.

A consumer that may outlive pool retains the returned executor before the pool is freed. Cooperative processes attached to the executor own their process state and teardown independently from Loom task queues.

◆ loomc_task_pool_allocate_from_iree_executor()

loomc_status_t loomc_task_pool_allocate_from_iree_executor ( iree_task_executor_t * executor,
loomc_allocator_t allocator,
loomc_task_pool_t ** out_pool )

Allocates a Loom task pool retaining an existing IREE task executor.

Parameters
executorExecutor to retain for the returned pool.
allocatorHost allocator used for pool storage.
out_poolReceives the allocated pool on success.
Returns
OK after retaining executor and allocating the pool.
Ownership
The caller retains its existing executor reference. The returned pool owns one additional reference released by loomc_task_pool_free.