This commit is contained in:
KenForever 2025-01-29 10:21:05 -05:00 committed by GitHub
commit a6ace0a0c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 3 deletions

View file

@ -52,7 +52,7 @@ endif()
set(TARGET common)
add_library(${TARGET} STATIC
add_library(${TARGET}
arg.cpp
arg.h
base64.hpp
@ -76,6 +76,8 @@ add_library(${TARGET} STATIC
if (BUILD_SHARED_LIBS)
set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_compile_definitions(${TARGET} PRIVATE LLAMA_BUILD)
target_compile_definitions(${TARGET} PUBLIC LLAMA_SHARED)
endif()
set(LLAMA_COMMON_EXTRA_LIBS build_info)

View file

@ -41,6 +41,10 @@ extern const char * LLAMA_BUILD_TARGET;
struct common_control_vector_load_info;
#ifdef __cplusplus
extern "C" {
#endif
//
// CPU utils
//
@ -54,8 +58,12 @@ struct cpu_params {
uint32_t poll = 50; // Polling (busywait) level (0 - no polling, 100 - mostly polling)
};
int32_t cpu_get_num_physical_cores();
int32_t cpu_get_num_math();
LLAMA_API int32_t cpu_get_num_physical_cores();
LLAMA_API int32_t cpu_get_num_math();
#ifdef __cplusplus
}
#endif
//
// Common params