diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ae457a215ef5..5355adaa4416b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -301,9 +301,7 @@ if (LLAMA_OPENMP) if(OpenMP_FOUND) message(STATUS "OpenMP found") add_compile_definitions(GGML_USE_OPENMP) - - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") + set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} OpenMP::OpenMP_C OpenMP::OpenMP_CXX) else() message(WARNING "OpenMP not found") endif() diff --git a/ggml.c b/ggml.c index eb894a21f7827..f07b6b83f1d90 100644 --- a/ggml.c +++ b/ggml.c @@ -19733,7 +19733,6 @@ enum ggml_status ggml_graph_compute(struct ggml_cgraph * cgraph, struct ggml_cpl #if defined(GGML_USE_OPENMP) n_threads = MIN(n_threads, omp_get_max_threads()); - n_threads = MIN(n_threads, omp_get_thread_limit()); #endif struct ggml_compute_state_shared state_shared = {