From 5274c3c43f932ba2bddf0235efd7437daecd7b09 Mon Sep 17 00:00:00 2001 From: Awni Hannun Date: Mon, 17 Feb 2025 00:07:49 -0800 Subject: [PATCH] compiler warnings are errors (#1870) --- CMakeLists.txt | 2 +- mlx/backend/cpu/gemms/bnns.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 38913b0c1..17a832364 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,6 @@ endif() add_compile_definitions("MLX_VERSION=${MLX_VERSION}") # --------------------- Processor tests ------------------------- - message( STATUS "Building MLX for ${CMAKE_SYSTEM_PROCESSOR} processor on ${CMAKE_SYSTEM_NAME}" @@ -64,6 +63,7 @@ include(FetchContent) cmake_policy(SET CMP0135 NEW) add_library(mlx) +set_target_properties(mlx PROPERTIES COMPILE_WARNING_AS_ERROR ON) if(MLX_BUILD_METAL) set(METAL_LIB "-framework Metal") diff --git a/mlx/backend/cpu/gemms/bnns.cpp b/mlx/backend/cpu/gemms/bnns.cpp index cd517f825..a9d09380c 100644 --- a/mlx/backend/cpu/gemms/bnns.cpp +++ b/mlx/backend/cpu/gemms/bnns.cpp @@ -43,6 +43,8 @@ void matmul_bnns( BNNSDataType bnns_dtype = to_bnns_dtype(out.dtype()); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" const BNNSLayerParametersBroadcastMatMul gemm_params{ /* float alpha = */ alpha, /* float beta = */ beta, @@ -124,6 +126,7 @@ void matmul_bnns( } BNNSFilterDestroy(bnns_filter); +#pragma GCC diagnostic pop } template <>