2023-08-14 16:30:28 +00:00
|
|
|
function(llama_build_executable source)
|
|
|
|
get_filename_component(TEST_TARGET ${source} NAME_WE)
|
|
|
|
add_executable(${TEST_TARGET} ${source})
|
|
|
|
install(TARGETS ${TEST_TARGET} RUNTIME)
|
2023-08-18 13:22:48 +00:00
|
|
|
target_link_libraries(${TEST_TARGET} PRIVATE llama common)
|
2023-08-14 16:30:28 +00:00
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function(llama_test_executable name source)
|
|
|
|
get_filename_component(TEST_TARGET ${source} NAME_WE)
|
|
|
|
# add_executable(${TEST_TARGET} ${source})
|
|
|
|
# install(TARGETS ${TEST_TARGET} RUNTIME)
|
|
|
|
# target_link_libraries(${TEST_TARGET} PRIVATE llama)
|
|
|
|
add_test(NAME ${name} COMMAND $<TARGET_FILE:${TEST_TARGET}> ${ARGN})
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function(llama_build_and_test_executable source)
|
2023-03-22 17:29:06 +00:00
|
|
|
get_filename_component(TEST_TARGET ${source} NAME_WE)
|
|
|
|
add_executable(${TEST_TARGET} ${source})
|
2023-07-19 07:01:11 +00:00
|
|
|
install(TARGETS ${TEST_TARGET} RUNTIME)
|
2023-08-18 13:22:48 +00:00
|
|
|
target_link_libraries(${TEST_TARGET} PRIVATE llama common)
|
2023-03-22 17:29:06 +00:00
|
|
|
add_test(NAME ${TEST_TARGET} COMMAND $<TARGET_FILE:${TEST_TARGET}> ${ARGN})
|
|
|
|
endfunction()
|
|
|
|
|
2023-08-14 16:30:28 +00:00
|
|
|
# llama_build_and_test_executable(test-double-float.cpp) # SLOW
|
|
|
|
llama_build_and_test_executable(test-quantize-fns.cpp)
|
|
|
|
llama_build_and_test_executable(test-quantize-perf.cpp)
|
|
|
|
llama_build_and_test_executable(test-sampling.cpp)
|
|
|
|
llama_build_executable(test-tokenizer-0.cpp)
|
2023-08-18 13:22:48 +00:00
|
|
|
llama_test_executable (test-tokenizer-0.llama test-tokenizer-0.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-llama.gguf)
|
2023-08-14 16:30:28 +00:00
|
|
|
llama_build_executable(test-tokenizer-1.cpp)
|
2023-08-18 13:22:48 +00:00
|
|
|
llama_test_executable (test-tokenizer-1.llama test-tokenizer-1.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-llama.gguf)
|
2023-08-17 14:19:52 +00:00
|
|
|
#llama_test_executable(test-tokenizer-1.aquila test-tokenizer-1.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-aquila.gguf)
|
2023-08-18 13:22:48 +00:00
|
|
|
llama_build_and_test_executable(test-grammar-parser.cpp)
|
|
|
|
llama_build_and_test_executable(test-llama-grammar.cpp)
|
2023-08-14 16:30:28 +00:00
|
|
|
llama_build_and_test_executable(test-grad0.cpp) # SLOW
|
|
|
|
# llama_build_and_test_executable(test-opt.cpp) # SLOW
|