mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-25 19:04:35 +00:00
common: compile shared lib, and export some c functions
This commit is contained in:
parent
0fff7fd798
commit
f9e9792f1d
@ -50,7 +50,7 @@ endif()
|
|||||||
|
|
||||||
set(TARGET common)
|
set(TARGET common)
|
||||||
|
|
||||||
add_library(${TARGET} STATIC
|
add_library(${TARGET}
|
||||||
arg.cpp
|
arg.cpp
|
||||||
arg.h
|
arg.h
|
||||||
base64.hpp
|
base64.hpp
|
||||||
@ -70,6 +70,8 @@ add_library(${TARGET} STATIC
|
|||||||
|
|
||||||
if (BUILD_SHARED_LIBS)
|
if (BUILD_SHARED_LIBS)
|
||||||
set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||||
|
target_compile_definitions(${TARGET} PRIVATE LLAMA_BUILD)
|
||||||
|
target_compile_definitions(${TARGET} PUBLIC LLAMA_SHARED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(LLAMA_COMMON_EXTRA_LIBS build_info)
|
set(LLAMA_COMMON_EXTRA_LIBS build_info)
|
||||||
|
@ -41,6 +41,10 @@ extern char const * LLAMA_BUILD_TARGET;
|
|||||||
|
|
||||||
struct common_control_vector_load_info;
|
struct common_control_vector_load_info;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// CPU utils
|
// CPU utils
|
||||||
//
|
//
|
||||||
@ -54,8 +58,12 @@ struct cpu_params {
|
|||||||
uint32_t poll = 50; // Polling (busywait) level (0 - no polling, 100 - mostly polling)
|
uint32_t poll = 50; // Polling (busywait) level (0 - no polling, 100 - mostly polling)
|
||||||
};
|
};
|
||||||
|
|
||||||
int32_t cpu_get_num_physical_cores();
|
LLAMA_API int32_t cpu_get_num_physical_cores();
|
||||||
int32_t cpu_get_num_math();
|
LLAMA_API int32_t cpu_get_num_math();
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// Common params
|
// Common params
|
||||||
|
Loading…
Reference in New Issue
Block a user