Skip to content

Commit

Permalink
Fix warnings with gcc 4.8.5 (#2320)
Browse files Browse the repository at this point in the history
  • Loading branch information
bertmaher committed Jan 30, 2019
1 parent c56372e commit 8b38c39
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions cmake/modules/GlowDefaults.cmake
Expand Up @@ -30,8 +30,13 @@ if(MSVC OR CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_RELEASE} /fp:fast")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:4194304")
else()
include(CheckCXXCompilerFlag)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wnon-virtual-dtor -fno-exceptions -fno-rtti")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -O0")
CHECK_CXX_COMPILER_FLAG("-Wno-psabi" HAS_W_NO_PSABI)
if(HAS_W_NO_PSABI)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi")
endif()
if((CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL armv7)
AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffast-math")
Expand Down
2 changes: 1 addition & 1 deletion lib/Backends/CPU/libjit/libjit.cpp
Expand Up @@ -1546,7 +1546,7 @@ static void find_min_max_f(float *tensor, size_t size, float &min, float &max) {
}

static int check_all_zeros(float *arrayToCheck, size_t size) {
for (int i = 0; i < size; ++i) {
for (size_t i = 0; i < size; ++i) {
if (arrayToCheck[i] != 0) {
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Backends/CPU/libjit/libjit_matmul.cpp
Expand Up @@ -56,7 +56,7 @@ constexpr int nc = 4096;
/// Only pack matrices if dimension is above this threshold. Packing is
/// primarily helpful for avoiding TLB pressure and cache set conflicts, so this
/// can be fairly large.
constexpr size_t pack_threshold = 1024;
constexpr int pack_threshold = 1024;

/// Compute a RAxRB block of C using a vectorized dot product, where RA is the
/// number of registers to load from matrix A, and RB is the number of registers
Expand Down

0 comments on commit 8b38c39

Please sign in to comment.