Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions frame/thread/bli_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@

#include "blis.h"

// OpenMP 2.0 compatibility: Provide fallbacks for OpenMP 3.0 functions
// Some compilers (e.g., MSVC, older GCC) only support OpenMP 2.0 which lacks:
// - omp_get_active_level() (OpenMP 3.0)
// - omp_get_max_active_levels() (OpenMP 3.0)
// The _OPENMP macro is set to version-specific values by OpenMP-compliant compilers:
// 200203 = OpenMP 2.0, 200811 = OpenMP 3.0, 201107 = OpenMP 3.1, etc.
// Note: omp.h is already included by blis.h when BLIS_ENABLE_OPENMP is defined
#if defined(BLIS_ENABLE_OPENMP) && defined(_OPENMP) && _OPENMP < 200811
static inline int omp_get_active_level(void) {
return 0; // Always assume top-level (no nested parallelism support)
}
static inline int omp_get_max_active_levels(void) {
return 1; // OpenMP 2.0 doesn't support nested parallelism
}
#endif

thrinfo_t BLIS_PACKM_SINGLE_THREADED = {};
thrinfo_t BLIS_GEMM_SINGLE_THREADED = {};
thrcomm_t BLIS_SINGLE_COMM = {};
Expand Down