Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,13 @@ endif()
# --- #pragma omp simd flags (used for reference kernels only) ---
if(PRAGMA_OMP_SIMD)
if(WIN32)
set(COMPSIMDFLAGS /openmp:experimental)
# Check if using Clang with GNU-like command-line (not MSVC/Clang-CL)
if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND
CMAKE_C_COMPILER_FRONTEND_VARIANT STREQUAL "GNU")
set(COMPSIMDFLAGS -fopenmp-simd)
else()
set(COMPSIMDFLAGS /openmp:experimental)
endif()
else()
set(COMPSIMDFLAGS -fopenmp-simd)
endif()
Expand Down
12 changes: 12 additions & 0 deletions frame/thread/bli_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@

#include "blis.h"

// OpenMP 2.0 compatibility: Provide fallbacks for OpenMP 3.0 functions
// Microsoft Visual Studio's OpenMP only supports OpenMP 2.0
// Note: omp.h is already included by blis.h when BLIS_ENABLE_OPENMP is defined
#if defined(BLIS_ENABLE_OPENMP) && defined(_MSC_VER)
Comment thread
tony-davis marked this conversation as resolved.
Outdated
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
Loading