Library Management#

Library configuration and management functions for AOCL-DLP.

Threading Configuration#

Thread Count#

void dlp_thread_set_num_threads(md_t n_threads)#

Alias for dlp_thread_set_num_threads_local.

void dlp_thread_set_num_threads_library(md_t n_threads)#

Set library-global thread count.

Sets thread count-based parallelism for all DLP operations in this process. Note: Ways-based configuration (ic_ways, jc_ways) has HIGHER precedence.

Interaction with Ways:

  • Does NOT modify lib_packed_ways (ic/jc preserved)

  • If ways are set (ic>0 or jc>0), they take precedence over num_threads

  • Only effective when ways are unset (-1)

Note

Value -1 means “unset”

Note

Setting num_threads disables external threading control (OpenMP)

Parameters:

n_threads – Number of threads to use (> 0), or -1 to unset

void dlp_thread_set_num_threads_local(md_t n_threads)#

Set thread-local thread count.

Sets thread count-based parallelism for DLP operations ONLY in the calling thread. Has HIGHEST precedence - overrides library-global and environment settings. Note: Ways-based configuration still has higher precedence than this.

Note

Thread-local settings are NOT inherited by spawned threads

Note

Value -1 means “unset”

Parameters:

n_threads – Number of threads to use (> 0), or -1 to unset

md_t dlp_thread_get_num_threads_active(void)#

Get currently active thread count.

Returns:

Active num_threads value based on priority order, or -1 if unset

Thread Ways (2D Decomposition)#

void dlp_thread_set_ways(md_t jc, md_t ic)#

Alias for dlp_thread_set_ways_local.

void dlp_thread_set_ways_library(md_t jc, md_t ic)#

Set library-global threading ways (ic_ways, jc_ways).

Sets ways-based parallelism for all DLP operations in this process. This configuration has higher precedence than num_threads.

Atomicity Guarantee: Three atomic stores (ways, nt, ext_mt) execute independently but form logical transaction because all callers ALWAYS set: nt=-1, ext_mt=FALSE.

Note

Setting ways automatically unsets num_threads (mutually exclusive modes)

Note

Value -1 means “unset”

Parameters:
  • jc – JC loop parallelism (outer loop), must be > 0 or will be set to -1

  • ic – IC loop parallelism (inner loop), must be > 0 or will be set to -1

void dlp_thread_set_ways_local(md_t jc, md_t ic)#

Set thread-local threading ways (ic_ways, jc_ways).

Sets ways-based parallelism for DLP operations ONLY in the calling thread. Has HIGHEST precedence - overrides library-global and environment settings.

Note

Thread-local settings are NOT inherited by spawned threads

Note

Setting ways automatically unsets num_threads (mutually exclusive)

Note

Value -1 means “unset”

Parameters:
  • jc – JC loop parallelism (outer loop), must be > 0 or will be set to -1

  • ic – IC loop parallelism (inner loop), must be > 0 or will be set to -1

md_t dlp_thread_get_ic_ways_active(void)#

Get currently active IC ways parallelism count.

Returns:

Active ic_ways value based on priority order, or -1 if unset

md_t dlp_thread_get_jc_ways_active(void)#

Get currently active JC ways parallelism count.

Returns:

Active jc_ways value based on priority order, or -1 if unset

Hardware Query#

bool dlp_aocl_enable_instruction_query(void)#

Query whether AOCL_DLP_ENABLE_INSTRUCTIONS environment variable is set.

Returns:

true if the environment variable is set, false otherwise.

Version Query#

void dlp_version_query(int *major, int *minor, int *patch)#

Query AOCL-DLP library version.

Parameters:
  • major[out] Major version number (optional, pass NULL to skip)

  • minor[out] Minor version number (optional, pass NULL to skip)

  • patch[out] Patch version number (optional, pass NULL to skip)

See Also