From f60d2f57464d4c04b6672647f0ea5d91b1b0c8bc Mon Sep 17 00:00:00 2001 From: Nick Smith <127986401+nsmithtt@users.noreply.github.com> Date: Tue, 19 Nov 2024 08:19:28 -0800 Subject: [PATCH] Include metal headers as SYSTEM headers; remove ignored warnings (#1309) If we include metal headers as SYSTEM headers, the compiler will ignore warnings from these headers since they're explicitly marked out of tree. For more context see: https://github.com/tenstorrent/tt-mlir/pull/1295#discussion_r1844712059 --- runtime/include/tt/runtime/detail/ttmetal.h | 35 ------------------ runtime/include/tt/runtime/detail/ttnn.h | 40 --------------------- runtime/lib/common/CMakeLists.txt | 2 +- runtime/lib/common/system_desc.cpp | 20 ----------- runtime/lib/ttmetal/CMakeLists.txt | 2 +- runtime/lib/ttnn/CMakeLists.txt | 2 +- runtime/lib/ttnn/operations/CMakeLists.txt | 2 +- 7 files changed, 4 insertions(+), 99 deletions(-) diff --git a/runtime/include/tt/runtime/detail/ttmetal.h b/runtime/include/tt/runtime/detail/ttmetal.h index 3280d1eeb..7a68a7e94 100644 --- a/runtime/include/tt/runtime/detail/ttmetal.h +++ b/runtime/include/tt/runtime/detail/ttmetal.h @@ -5,46 +5,11 @@ #ifndef TT_RUNTIME_DETAIL_TTMETAL_H #define TT_RUNTIME_DETAIL_TTMETAL_H -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wcast-qual" -#pragma clang diagnostic ignored "-Wctad-maybe-unsupported" -#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -#pragma clang diagnostic ignored "-Wignored-qualifiers" -#pragma clang diagnostic ignored "-Wvla-extension" -#pragma clang diagnostic ignored "-Wcovered-switch-default" -#pragma clang diagnostic ignored "-Wsign-compare" -#pragma clang diagnostic ignored "-Wc++20-extensions" -#pragma clang diagnostic ignored "-Wc++20-designator" -#pragma clang diagnostic ignored "-Wnon-virtual-dtor" -#pragma clang diagnostic ignored "-Wunused-variable" -#pragma clang diagnostic ignored "-Wsuggest-override" -#pragma clang diagnostic ignored "-Wgnu-anonymous-struct" -#pragma clang diagnostic ignored "-Wnested-anon-types" -#pragma clang diagnostic ignored "-Wreorder-ctor" -#pragma clang diagnostic ignored "-Wmismatched-tags" -#pragma clang diagnostic ignored "-Wunused-lambda-capture" -#pragma clang diagnostic ignored "-Wmissing-field-initializers" -#pragma clang diagnostic ignored "-Wunused-private-field" -#pragma clang diagnostic ignored "-Wimplicit-fallthrough" -#pragma clang diagnostic ignored "-Wstring-conversion" -#pragma clang diagnostic ignored "-Wunneeded-internal-declaration" -#pragma clang diagnostic ignored "-Wunused-local-typedef" -#pragma clang diagnostic ignored "-Wunused-function" -#pragma clang diagnostic ignored "-Wpessimizing-move" -#pragma clang diagnostic ignored "-Wparentheses" -#pragma clang diagnostic ignored "-Wdeprecated-volatile" -#pragma clang diagnostic ignored "-Wdeprecated-this-capture" -#pragma clang diagnostic ignored "-Wc++23-extensions" -#pragma clang diagnostic ignored "-Wunused-but-set-variable" -#pragma clang diagnostic ignored "-Wlogical-op-parentheses" -#pragma clang diagnostic ignored "-Wundefined-inline" -#pragma clang diagnostic ignored "-Wzero-length-array" #define FMT_HEADER_ONLY #include "distributed/mesh_device.hpp" #include "impl/buffers/circular_buffer.hpp" #include "impl/event/event.hpp" #include "tt_metal/host_api.hpp" -#pragma clang diagnostic pop #include "tt/runtime/types.h" #include "tt/runtime/utils.h" diff --git a/runtime/include/tt/runtime/detail/ttnn.h b/runtime/include/tt/runtime/detail/ttnn.h index 147c5a71c..6c55ac1de 100644 --- a/runtime/include/tt/runtime/detail/ttnn.h +++ b/runtime/include/tt/runtime/detail/ttnn.h @@ -5,45 +5,6 @@ #ifndef TT_RUNTIME_DETAIL_TTNN_H #define TT_RUNTIME_DETAIL_TTNN_H -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wcast-qual" -#pragma clang diagnostic ignored "-Wctad-maybe-unsupported" -#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -#pragma clang diagnostic ignored "-Wignored-qualifiers" -#pragma clang diagnostic ignored "-Wvla-extension" -#pragma clang diagnostic ignored "-Wcovered-switch-default" -#pragma clang diagnostic ignored "-Wsign-compare" -#pragma clang diagnostic ignored "-Wc++20-extensions" -#pragma clang diagnostic ignored "-Wc++20-designator" -#pragma clang diagnostic ignored "-Wnon-virtual-dtor" -#pragma clang diagnostic ignored "-Wunused-variable" -#pragma clang diagnostic ignored "-Wunknown-warning-option" -#pragma clang diagnostic ignored "-Wsuggest-override" -#pragma clang diagnostic ignored "-Wgnu-anonymous-struct" -#pragma clang diagnostic ignored "-Wnested-anon-types" -#pragma clang diagnostic ignored "-Wreorder-ctor" -#pragma clang diagnostic ignored "-Wmismatched-tags" -#pragma clang diagnostic ignored "-Wunused-lambda-capture" -#pragma clang diagnostic ignored "-Wmissing-field-initializers" -#pragma clang diagnostic ignored "-Wunused-private-field" -#pragma clang diagnostic ignored "-Wimplicit-fallthrough" -#pragma clang diagnostic ignored "-Wstring-conversion" -#pragma clang diagnostic ignored "-Wunneeded-internal-declaration" -#pragma clang diagnostic ignored "-Wunused-local-typedef" -#pragma clang diagnostic ignored "-Wunused-function" -#pragma clang diagnostic ignored "-Wpessimizing-move" -#pragma clang diagnostic ignored "-Wparentheses" -#pragma clang diagnostic ignored "-Wdeprecated-volatile" -#pragma clang diagnostic ignored "-Wdeprecated-this-capture" -#pragma clang diagnostic ignored "-Wc++23-extensions" -#pragma clang diagnostic ignored "-Wunused-but-set-variable" -#pragma clang diagnostic ignored "-Wlogical-op-parentheses" -#pragma clang diagnostic ignored "-Wundefined-inline" -#pragma clang diagnostic ignored "-Wc99-extensions" -#pragma clang diagnostic ignored "-Wc++11-narrowing" -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#pragma clang diagnostic ignored "-Wzero-length-array" - #define FMT_HEADER_ONLY #include "distributed/mesh_device.hpp" #include "host_api.hpp" @@ -69,7 +30,6 @@ #include "ttnn/tensor/host_buffer/functions.hpp" #include "ttnn/tensor/tensor.hpp" #include "ttnn/tensor/types.hpp" -#pragma clang diagnostic pop #include "tt/runtime/types.h" #include "ttmlir/Target/TTNN/Target.h" diff --git a/runtime/lib/common/CMakeLists.txt b/runtime/lib/common/CMakeLists.txt index 1767122da..65dc04128 100644 --- a/runtime/lib/common/CMakeLists.txt +++ b/runtime/lib/common/CMakeLists.txt @@ -32,7 +32,7 @@ target_include_directories(TTRuntimeSysDesc ${PROJECT_SOURCE_DIR}/runtime/include ${PROJECT_BINARY_DIR}/include/ttmlir/Target/Common ) -target_include_directories(TTRuntimeSysDesc PUBLIC "$") +target_include_directories(TTRuntimeSysDesc SYSTEM PUBLIC "$") add_dependencies(TTRuntimeSysDesc tt-metal FBS_GENERATION) add_library(TTRuntimeDebug STATIC debug.cpp) diff --git a/runtime/lib/common/system_desc.cpp b/runtime/lib/common/system_desc.cpp index 0d1c620cc..f1210d00a 100644 --- a/runtime/lib/common/system_desc.cpp +++ b/runtime/lib/common/system_desc.cpp @@ -10,30 +10,10 @@ #include #include -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wctad-maybe-unsupported" -#pragma clang diagnostic ignored "-Wcovered-switch-default" -#pragma clang diagnostic ignored "-Wunused-variable" -#pragma clang diagnostic ignored "-Wignored-qualifiers" -#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -#pragma clang diagnostic ignored "-Wvla-extension" -#pragma clang diagnostic ignored "-Wsign-compare" -#pragma clang diagnostic ignored "-Wcast-qual" -#pragma clang diagnostic ignored "-Wdeprecated-this-capture" -#pragma clang diagnostic ignored "-Wnon-virtual-dtor" -#pragma clang diagnostic ignored "-Wsuggest-override" -#pragma clang diagnostic ignored "-Wgnu-anonymous-struct" -#pragma clang diagnostic ignored "-Wnested-anon-types" -#pragma clang diagnostic ignored "-Wreorder-ctor" -#pragma clang diagnostic ignored "-Wmismatched-tags" -#pragma clang diagnostic ignored "-Wunused-function" -#pragma clang diagnostic ignored "-Wunused-local-typedef" -#pragma clang diagnostic ignored "-Wzero-length-array" #define FMT_HEADER_ONLY #include "distributed/mesh_device.hpp" #include "host_api.hpp" #include "hostdevcommon/common_values.hpp" -#pragma clang diagnostic pop namespace tt::runtime::system_desc { static ::tt::target::Dim2d toFlatbuffer(const CoreCoord &coreCoord) { diff --git a/runtime/lib/ttmetal/CMakeLists.txt b/runtime/lib/ttmetal/CMakeLists.txt index 28c06a77f..3706d7433 100644 --- a/runtime/lib/ttmetal/CMakeLists.txt +++ b/runtime/lib/ttmetal/CMakeLists.txt @@ -9,7 +9,7 @@ target_include_directories(TTRuntimeTTMetal PUBLIC ${PROJECT_SOURCE_DIR}/runtime/include ${PROJECT_BINARY_DIR}/include/ttmlir/Target/Common ) -target_include_directories(TTRuntimeTTMetal PUBLIC "$") +target_include_directories(TTRuntimeTTMetal SYSTEM PUBLIC "$") target_link_libraries(TTRuntimeTTMetal PUBLIC TTMETAL_LIBRARY) add_dependencies(TTRuntimeTTMetal TTMETAL_LIBRARY tt-metal FBS_GENERATION) diff --git a/runtime/lib/ttnn/CMakeLists.txt b/runtime/lib/ttnn/CMakeLists.txt index 98aa7fc98..92581cf46 100644 --- a/runtime/lib/ttnn/CMakeLists.txt +++ b/runtime/lib/ttnn/CMakeLists.txt @@ -10,6 +10,6 @@ target_include_directories(TTRuntimeTTNN PUBLIC ${PROJECT_SOURCE_DIR}/runtime/include ${PROJECT_BINARY_DIR}/include/ttmlir/Target/Common ) -target_include_directories(TTRuntimeTTNN PUBLIC "$") +target_include_directories(TTRuntimeTTNN SYSTEM PUBLIC "$") target_link_libraries(TTRuntimeTTNN PUBLIC TTRuntimeTTNNOps) add_dependencies(TTRuntimeTTNN TTRuntimeTTNNOps) diff --git a/runtime/lib/ttnn/operations/CMakeLists.txt b/runtime/lib/ttnn/operations/CMakeLists.txt index ada65b427..4edc4780b 100644 --- a/runtime/lib/ttnn/operations/CMakeLists.txt +++ b/runtime/lib/ttnn/operations/CMakeLists.txt @@ -45,7 +45,7 @@ target_include_directories(TTRuntimeTTNNOps PUBLIC ${PROJECT_SOURCE_DIR}/runtime/lib/ttnn/operations/include ${PROJECT_BINARY_DIR}/include/ttmlir/Target/Common ) -target_include_directories(TTRuntimeTTNNOps PUBLIC "$") +target_include_directories(TTRuntimeTTNNOps SYSTEM PUBLIC "$") target_link_libraries(TTRuntimeTTNNOps PUBLIC TTNN_LIBRARY) if (TT_RUNTIME_ENABLE_PERF_TRACE)