forked from ggerganov/ggml
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCMakeLists.txt
34 lines (28 loc) · 988 Bytes
/
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
#
# gpt-2
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
set(TEST_TARGET gpt-2)
add_executable(${TEST_TARGET} main.cpp index.html)
target_link_libraries(${TEST_TARGET} PRIVATE ggml common)
if (DEFINED EMSCRIPTEN)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --shell-file ${CMAKE_CURRENT_SOURCE_DIR}/index.html")
set_target_properties(gpt-2 PROPERTIES
SUFFIX ".html"
LINK_FLAGS "-pthread -g4 --bind --use-preload-cache \
-s MINIFY_HTML=0 \
-s ASYNCIFY=1 \
-s USE_PTHREADS=1 \
-s PTHREAD_POOL_SIZE=5 \
-s PROXY_TO_PTHREAD=1 \
-s ASSERTIONS \
-s INITIAL_MEMORY=3GB \
-s NO_EXIT_RUNTIME=1 \
-s ALLOW_TABLE_GROWTH=1 \
--preload-file ${CMAKE_CURRENT_SOURCE_DIR}/models@models/"
)
endif (DEFINED EMSCRIPTEN)
#
# gpt-2-quantize
set(TEST_TARGET gpt-2-quantize)
add_executable(${TEST_TARGET} quantize.cpp)
target_link_libraries(${TEST_TARGET} PRIVATE ggml common common-ggml)