Files
Smyth, Edward b5c66a9d8c Implement bli_thread_reset (#32)
BLIS-specific setting of threading takes precedence over OpenMP
thread count ICV values, and if the BLIS-specific threading APIs
are used, there was no way for the program to revert to OpenMP
settings. This patch implements a function bli_thread_reset() to
do this. This is similar to that implemented in upstream BLIS in
commit 6dcf7666ef

More specifically, it reverts the internal threading data to that
which existed when the program was launched, subject where appropriate
to any changes in the OpenMP ICVs. In other words:
- It will undo changes to threading set by previous calls to
  bli_thread_set_num_threads or bli_thread_set_ways.
- If the environment variable BLIS_NUM_THREADS was used, this will
  NOT be cleared, as the initial state of the program is restored.
- Changes to OpenMP ICVs from previous calls to omp_set_num_threads()
  will still be in effect, but can be overridden by further calls to
  omp_set_num_threads().

Note: the internal BLIS data structure updated by the threading APIs,
including bli_thread_reset(), is thread-local to each user
(e.g. application) thread.

Example usage:
omp_set_num_threads(4);
bli_thread_set_num_threads(7);
dgemm(...); // 7 threads will be used
bli_thread_reset();
dgemm(...); // 4 threads will be used
2025-06-17 10:40:10 +01:00
..
2025-06-10 11:33:33 +05:30
2025-06-10 11:33:33 +05:30
2025-06-10 11:33:33 +05:30
2025-06-10 11:33:33 +05:30
2025-03-06 06:03:39 -05:00
2025-06-17 10:40:10 +01:00
2025-06-17 10:40:10 +01:00
2025-06-10 11:33:33 +05:30
2024-08-05 15:35:08 -04:00