Skip to content

Commit

Permalink
cmake : link math library to test + remove ci for code cov
Browse files Browse the repository at this point in the history
ggml-ci
  • Loading branch information
ggerganov committed Jun 25, 2024
1 parent 6b202fd commit 7e44e1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 33 deletions.
36 changes: 3 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- name: Configure CMake
working-directory: ./build
run: cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DGGML_TEST_COVERAGE=ON -DGGML_CLBLAST=ON ..
run: cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DGGML_CLBLAST=ON ..

- name: Build
working-directory: ./build
Expand All @@ -39,13 +39,6 @@ jobs:
working-directory: ./build
run: ctest --verbose --timeout 900

- name: Test Coverage
working-directory: ./build
run: |
llvm-profdata merge -sparse tests/*.profraw -o ggml.profdata
llvm-cov report ./bin/test-grad0 -instr-profile=ggml.profdata
llvm-cov report ./bin/test-opt -instr-profile=ggml.profdata
test-macos-metal:
runs-on: macos-13
env:
Expand All @@ -61,7 +54,7 @@ jobs:

- name: Configure CMake
working-directory: ./build
run: cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DGGML_TEST_COVERAGE=ON -DGGML_METAL=OFF ..
run: cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DGGML_METAL=OFF ..

- name: Build
working-directory: ./build
Expand All @@ -71,13 +64,6 @@ jobs:
working-directory: ./build
run: ctest --verbose --timeout 900

- name: Test Coverage
working-directory: ./build
run: |
xcrun llvm-profdata merge -sparse tests/*.profraw -o ggml.profdata
xcrun llvm-cov report ./bin/test-grad0 -instr-profile=ggml.profdata
xcrun llvm-cov report ./bin/test-opt -instr-profile=ggml.profdata
build:

strategy:
Expand Down Expand Up @@ -112,7 +98,7 @@ jobs:

- name: Configure CMake
working-directory: ./build
run: cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DGGML_TEST_COVERAGE=ON -DGGML_METAL=OFF ..
run: cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DGGML_METAL=OFF ..

- name: Build
working-directory: ./build
Expand All @@ -121,19 +107,3 @@ jobs:
- name: Test
working-directory: ./build
run: ctest --verbose --timeout 900

- name: Test Coverage for Ubuntu
if: matrix.os == 'ubuntu-latest'
working-directory: ./build
run: |
llvm-profdata merge -sparse tests/*.profraw -o ggml.profdata
llvm-cov report ./bin/test-grad0 -instr-profile=ggml.profdata
llvm-cov report ./bin/test-opt -instr-profile=ggml.profdata
- name: Test Coverage for MacOS
if: matrix.os == 'macos-latest'
working-directory: ./build
run: |
xcrun llvm-profdata merge -sparse tests/*.profraw -o ggml.profdata
xcrun llvm-cov report ./bin/test-grad0 -instr-profile=ggml.profdata
xcrun llvm-cov report ./bin/test-opt -instr-profile=ggml.profdata
6 changes: 6 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
find_library(MATH_LIBRARY m)

# check systems
if (NOT UNAME_S)
execute_process(COMMAND uname -s OUTPUT_VARIABLE UNAME_S)
Expand Down Expand Up @@ -253,6 +255,10 @@ target_link_libraries(${TEST_TARGET} PRIVATE ggml)
add_test(NAME ${TEST_TARGET} COMMAND $<TARGET_FILE:${TEST_TARGET}>)
set_property(TEST ${TEST_TARGET} PROPERTY ENVIRONMENT "LLVM_PROFILE_FILE=${TEST_TARGET}.profraw")

if (MATH_LIBRARY)
target_link_libraries(test-mul-mat2 PRIVATE ${MATH_LIBRARY})
endif()

#
# test0

Expand Down

0 comments on commit 7e44e1f

Please sign in to comment.