Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] Warning Suppression PR #3: Eliminate warnings from third-party headers #4920

Merged
merged 6 commits into from
May 7, 2022
Next Next commit
[build] Warning Suppression PR #1: Turned on -Wno-ignored-attributes …
…& Removed unused functions
jim19930609 committed May 6, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 0091a0a6d6e2faf20f1e269789baca13a2cede77
4 changes: 4 additions & 0 deletions cmake/TaichiCXXFlags.cmake
Original file line number Diff line number Diff line change
@@ -46,7 +46,11 @@ else()
message("Invalid compiler ${CMAKE_CXX_COMPILER_ID} detected.")
message(FATAL_ERROR "clang and MSVC are the only supported compilers for Taichi compiler development. Consider using 'cmake -DCMAKE_CXX_COMPILER=clang' if you are on Linux.")
endif()

# [Global] CXX compilation option to enable all warnings
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall ")
# [Global] CXX compilation option to suppress warnings when compiler ignores an attribute.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-ignored-attributes ")
endif ()

message("Building for processor ${CMAKE_SYSTEM_PROCESSOR}")
7 changes: 7 additions & 0 deletions taichi/backends/metal/shaders/atomic_stubs.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "taichi/backends/metal/shaders/atomic_stubs.h"

namespace metal {

memory_order memory_order_relaxed = false;

} // namespace metal
4 changes: 3 additions & 1 deletion taichi/backends/metal/shaders/atomic_stubs.h
Original file line number Diff line number Diff line change
@@ -9,7 +9,9 @@ struct _atomic {};
namespace metal {

using memory_order = bool;
memory_order memory_order_relaxed = false;

// Defined in atomic_stub.cpp
extern memory_order memory_order_relaxed;

} // namespace metal

26 changes: 1 addition & 25 deletions taichi/backends/vulkan/vulkan_utils.cpp
Original file line number Diff line number Diff line change
@@ -5,31 +5,7 @@
namespace taichi {
namespace lang {
namespace vulkan {
namespace {

std::vector<VkExtensionProperties> GetInstanceExtensionProperties() {
constexpr char *kNoLayerName = nullptr;
uint32_t count = 0;
vkEnumerateInstanceExtensionProperties(kNoLayerName, &count, nullptr);
std::vector<VkExtensionProperties> extensions(count);
vkEnumerateInstanceExtensionProperties(kNoLayerName, &count,
extensions.data());
return extensions;
}

std::vector<VkExtensionProperties> GetDeviceExtensionProperties(
VkPhysicalDevice physicalDevice) {
constexpr char *kNoLayerName = nullptr;
uint32_t count = 0;
vkEnumerateDeviceExtensionProperties(physicalDevice, kNoLayerName, &count,
nullptr);
std::vector<VkExtensionProperties> extensions(count);
vkEnumerateDeviceExtensionProperties(physicalDevice, kNoLayerName, &count,
extensions.data());
return extensions;
}

} // namespace
namespace {} // namespace

} // namespace vulkan
} // namespace lang