-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
45 lines (33 loc) · 1.72 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
cmake_minimum_required(VERSION 3.12)
project(test_model_load)
include(CheckCXXCompilerFlag)
if(NOT MSVC)
check_cxx_compiler_flag("-std=c++17" SUPPORT_CXX17)
set(CMAKE_CXX_FLAGS "-std=c++17 ${CMAKE_CXX_FLAGS}")
set(CMAKE_CUDA_STANDARD 17)
else()
check_cxx_compiler_flag("/std:c++17" SUPPORT_CXX17)
set(CMAKE_CXX_FLAGS "/std:c++17 ${CMAKE_CXX_FLAGS}")
set(CMAKE_CUDA_STANDARD 17)
endif()
add_subdirectory(ggml ${CMAKE_CURRENT_BINARY_DIR}/ggml)
set(TOKENZIER_CPP_PATH tokenizers-cpp)
add_subdirectory(${TOKENZIER_CPP_PATH} tokenizers EXCLUDE_FROM_ALL)
include_directories(src)
include_directories(ggml/include)
include_directories(tokenizers-cpp/include)
add_executable(test_model_load test/test_model_load.cpp src/bert.cpp)
target_include_directories(test_model_load PRIVATE ${TOKENZIER_CPP_PATH}/include)
target_link_libraries(test_model_load ggml tokenizers_cpp)
add_executable(test_tokenizer test/test_tokenizer.cpp src/bert.cpp)
target_include_directories(test_tokenizer PRIVATE ${TOKENZIER_CPP_PATH}/include)
target_link_libraries(test_tokenizer ggml tokenizers_cpp)
add_executable(test_inference test/test_inference.cpp src/bert.cpp)
target_include_directories(test_inference PRIVATE ${TOKENZIER_CPP_PATH}/include)
target_link_libraries(test_inference ggml tokenizers_cpp)
add_executable(test_batch_tokenizer test/test_batch_tokenizer.cpp src/bert.cpp)
target_include_directories(test_batch_tokenizer PRIVATE ${TOKENZIER_CPP_PATH}/include)
target_link_libraries(test_batch_tokenizer ggml tokenizers_cpp)
add_executable(test_batch_inference test/test_batch_inference.cpp src/bert.cpp)
target_include_directories(test_batch_inference PRIVATE ${TOKENZIER_CPP_PATH}/include)
target_link_libraries(test_batch_inference ggml tokenizers_cpp)