diff options
author | Stephan Walter <stephan@walter.name> | 2023-03-31 19:19:16 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-31 19:19:16 +0000 |
commit | 3525899277d2e2bdc8ec3f0e6e40c47251608700 (patch) | |
tree | 8ffe72bfa836d37ee28ee43a729de8938c3668f7 | |
parent | 1d08882afa647c44195f4f6495a68ea455650cae (diff) |
Enable -std= for cmake builds, fix warnings (#598)
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | ggml.c | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 37f2270..1a434f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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); } @@ -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); } |