Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ endif()

set(TARGET common)

add_library(${TARGET} STATIC
add_library(${TARGET}
arg.cpp
arg.h
base64.hpp
Expand All @@ -70,6 +70,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)
Expand Down
12 changes: 10 additions & 2 deletions common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ extern char const * LLAMA_BUILD_TARGET;

struct common_control_vector_load_info;

#ifdef __cplusplus
extern "C" {
#endif

//
// CPU utils
//
Expand All @@ -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
Expand Down