Skip to content

Commit

Permalink
Enable -std= for cmake builds, fix warnings (ggerganov#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
sw authored Mar 31, 2023
1 parent 1d08882 commit 3525899
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ option(LLAMA_BUILD_EXAMPLES "llama: build examples" ${LLAMA_STANDALONE})
# Compile flags
#

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED true)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED true)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
Expand Down
8 changes: 4 additions & 4 deletions ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,8 @@ static void quantize_row_q4_0_reference(const float * restrict x, block_q4_0 * r
const uint8_t vi0 = (int8_t)roundf(v0) + 8;
const uint8_t vi1 = (int8_t)roundf(v1) + 8;

assert(vi0 >= 0 && vi0 < 16);
assert(vi1 >= 0 && vi1 < 16);
assert(vi0 < 16);
assert(vi1 < 16);

pp[l/2] = vi0 | (vi1 << 4);
}
Expand Down Expand Up @@ -837,8 +837,8 @@ static void quantize_row_q4_1_reference(const float * restrict x, void * restric
const uint8_t vi0 = roundf(v0);
const uint8_t vi1 = roundf(v1);

assert(vi0 >= 0 && vi0 < 16);
assert(vi1 >= 0 && vi1 < 16);
assert(vi0 < 16);
assert(vi1 < 16);

pp[l/2] = vi0 | (vi1 << 4);
}
Expand Down

0 comments on commit 3525899

Please sign in to comment.