mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-10-27 08:21:30 +00:00
Introduce C-style API (#370)
* Major refactoring - introduce C-style API * Clean up * Add <cassert> * Add <iterator> * Add <algorithm> .... * Fix timing reporting and accumulation * Measure eval time only for single-token calls * Change llama_tokenize return meaning
This commit is contained in:
@@ -207,15 +207,10 @@ else()
|
||||
message(STATUS "Unknown architecture")
|
||||
endif()
|
||||
|
||||
|
||||
#
|
||||
# Build library
|
||||
# Build libraries
|
||||
#
|
||||
|
||||
add_executable(llama main.cpp)
|
||||
|
||||
add_executable(quantize quantize.cpp)
|
||||
|
||||
add_library(utils OBJECT
|
||||
utils.cpp
|
||||
utils.h)
|
||||
@@ -229,14 +224,24 @@ add_library(ggml OBJECT
|
||||
|
||||
target_include_directories(ggml PUBLIC .)
|
||||
target_compile_features(ggml PUBLIC c_std_11) # don't bump
|
||||
|
||||
#
|
||||
# Linking
|
||||
#
|
||||
|
||||
target_link_libraries(ggml PRIVATE Threads::Threads ${LLAMA_EXTRA_LIBS})
|
||||
target_link_libraries(llama PRIVATE ggml utils)
|
||||
target_link_libraries(quantize PRIVATE ggml utils)
|
||||
|
||||
add_library(llama OBJECT
|
||||
llama.cpp
|
||||
llama.h)
|
||||
|
||||
target_include_directories(llama PUBLIC .)
|
||||
target_compile_features(llama PUBLIC cxx_std_11) # don't bump
|
||||
|
||||
#
|
||||
# Executables
|
||||
#
|
||||
|
||||
add_executable(main main.cpp)
|
||||
target_link_libraries(main PRIVATE llama ggml utils)
|
||||
|
||||
add_executable(quantize quantize.cpp)
|
||||
target_link_libraries(quantize PRIVATE llama ggml utils)
|
||||
|
||||
#
|
||||
# programs, examples and tests
|
||||
|
||||
Reference in New Issue
Block a user