mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-05-10 04:00:53 +00:00
Add OpenMP support in CMakeList (#939)
Useful for CPU based inference, but also for Cublas lowvram inference (TG)
This commit is contained in:
parent
fdca385cd9
commit
f7a0d252e6
1 changed files with 13 additions and 0 deletions
|
|
@ -51,6 +51,8 @@ set(LLAMA_CUDA_PEER_MAX_BATCH_SIZE "128" CACHE STRING
|
|||
"llama: max. batch size for using peer access")
|
||||
option(LLAMA_HIPBLAS "llama: use hipBLAS" OFF)
|
||||
|
||||
# Other
|
||||
option(LLAMA_OPENMP "llama: use OpenMP" OFF)
|
||||
|
||||
#
|
||||
# Compile flags
|
||||
|
|
@ -286,6 +288,17 @@ if (LLAMA_LTO)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if (LLAMA_OPENMP)
|
||||
find_package(OpenMP)
|
||||
if (OpenMP_FOUND)
|
||||
message(STATUS "OpenMP found")
|
||||
add_compile_definitions(GGML_USE_OPENMP)
|
||||
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} OpenMP::OpenMP_C OpenMP::OpenMP_CXX)
|
||||
else()
|
||||
message(WARNING "OpenMP not found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# this version of Apple ld64 is buggy
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_EXE_LINKER_FLAGS} -Wl,-v
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue