[Mlir-commits] [mlir] 408a67f - [MLIR][ROCm] Suppress warnings generated by HIP headers

Krzysztof Drewniak llvmlistbot at llvm.org
Tue Apr 5 09:49:42 PDT 2022


Author: Krzysztof Drewniak
Date: 2022-04-05T16:49:37Z
New Revision: 408a67ff49e0f4efc9203a9c9a5cc6548fd250ce

URL: https://github.com/llvm/llvm-project/commit/408a67ff49e0f4efc9203a9c9a5cc6548fd250ce
DIFF: https://github.com/llvm/llvm-project/commit/408a67ff49e0f4efc9203a9c9a5cc6548fd250ce.diff

LOG: [MLIR][ROCm] Suppress warnings generated by HIP headers

This removes tens of warnings from build logs that we can't do
anything about.

Reviewed By: pcf000

Differential Revision: https://reviews.llvm.org/D122927

Added: 
    

Modified: 
    mlir/lib/ExecutionEngine/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/mlir/lib/ExecutionEngine/CMakeLists.txt b/mlir/lib/ExecutionEngine/CMakeLists.txt
index ca5182e4f002b..8776d6f7e5d8f 100644
--- a/mlir/lib/ExecutionEngine/CMakeLists.txt
+++ b/mlir/lib/ExecutionEngine/CMakeLists.txt
@@ -204,6 +204,33 @@ if(MLIR_ENABLE_ROCM_RUNNER)
 
     EXCLUDE_FROM_LIBMLIR
   )
+
+  # Supress compiler warnings from HIP headers
+  check_cxx_compiler_flag(-Wno-c++98-compat-extra-semi
+    CXX_SUPPORTS_NO_CXX98_COMPAT_EXTRA_SEMI_FLAG)
+  if (CXX_SUPPORTS_CXX98_COMPAT_EXTRA_SEMI_FLAG)
+    target_compile_options(mlir_rocm_runtime PRIVATE
+      "-Wno-c++98-compat-extra-semi")
+  endif()
+  check_cxx_compiler_flag(-Wno-return-type-c-linkage
+      CXX_SUPPORTS_WNO_RETURN_TYPE_C_LINKAGE_FLAG)
+  if (CXX_SUPPORTS_WNO_RETURN_TYPE_C_LINKAGE_FLAG)
+    target_compile_options(mlir_rocm_runtime PRIVATE
+      "-Wno-return-type-c-linkage")
+  endif()
+  check_cxx_compiler_flag(-Wno-nested-anon-types
+    CXX_SUPPORTS_WNO_NESTED_ANON_TYPES_FLAG)
+  if (CXX_SUPPORTS_WNO_NESTED_ANON_TYPES_FLAG)
+    target_compile_options(mlir_rocm_runtime PRIVATE
+      "-Wno-nested-anon-types")
+  endif()
+  check_cxx_compiler_flag(-Wno-gnu-anonymous-struct
+    CXX_SUPPORTS_WNO_GNU_ANONYMOUS_STRUCT_FLAG)
+  if (CXX_SUPPORTS_WNO_GNU_ANONYMOUS_STRUCT_FLAG)
+    target_compile_options(mlir_rocm_runtime PRIVATE
+     "-Wno-gnu-anonymous-struct")
+  endif()
+
   target_compile_definitions(mlir_rocm_runtime
     PRIVATE
     __HIP_PLATFORM_HCC__


        


More information about the Mlir-commits mailing list