Commit 049a303f authored by Sang Ik Lee's avatar Sang Ik Lee Committed by Scott Cyphers

Use pragma clang only if compiler is Clang. (#2876)

* Use pragma clang only if compiler is Clang.

* Revert "Use pragma clang only if compiler is Clang."

This reverts commit f3deae9b59e950c9a282f9dac59e6c1a89c7c0f8.

* replace pragma clang with pragma GCC
parent 029db8df
......@@ -49,14 +49,14 @@ namespace ngraph
auto out0_buffer_index = external_function->get_buffer_index(out[0].get_name());
// Kill clang diagnostics bug
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmissing-braces"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-braces"
array<size_t, 2> weight_sizes{
args[0].get_size() * args[0].get_element_type().size(),
args[1].get_size() * args[1].get_element_type().size()};
#pragma clang diagnostic pop
#pragma GCC diagnostic pop
shared_ptr<uint8_t> stacked_weights(new uint8_t[weight_sizes[0] + weight_sizes[1]],
std::default_delete<uint8_t[]>());
......@@ -396,14 +396,14 @@ namespace ngraph
auto out2_buffer_index = external_function->get_buffer_index(out[2].get_name());
// Kill clang diagnostics bug
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmissing-braces"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-braces"
array<size_t, 2> weight_sizes{
args[0].get_size() * args[0].get_element_type().size(),
args[1].get_size() * args[1].get_element_type().size()};
#pragma clang diagnostic pop
#pragma GCC diagnostic pop
shared_ptr<uint8_t> stacked_weights(new uint8_t[weight_sizes[0] + weight_sizes[1]],
std::default_delete<uint8_t[]>());
shared_ptr<uint8_t> stacked_dweights(new uint8_t[weight_sizes[0] + weight_sizes[1]],
......
......@@ -1354,14 +1354,14 @@ void ngraph::runtime::cpu::pass::CPUFusion::construct_leaky_relu()
auto alpha_vec = alpha_const_op->get_vector<float>();
for (auto val : alpha_vec)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wfloat-equal"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
if (val != alpha_vec[0])
{
NGRAPH_DEBUG << "alpha is not a singular constant";
return false;
}
#pragma clang diagnostic pop
#pragma GCC diagnostic pop
}
if (alpha_vec[0] < 0)
......
......@@ -16,8 +16,8 @@
#pragma once
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wfloat-equal"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
#include <cstddef>
......@@ -42,4 +42,4 @@ namespace ngraph
}
}
#pragma clang diagnostic pop
#pragma GCC diagnostic pop
......@@ -16,8 +16,8 @@
#pragma once
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wfloat-equal"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
#include <cstddef>
......@@ -42,4 +42,4 @@ namespace ngraph
}
}
#pragma clang diagnostic pop
#pragma GCC diagnostic pop
......@@ -35,13 +35,13 @@ namespace ngraph
{
// this is intentional to be able to compare floats directly
// without using relative or absolute tolerance
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wfloat-equal"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
if (std::get<0>(a) == std::get<0>(b))
{
return std::get<1>(a) < std::get<1>(b);
}
#pragma clang diagnostic pop
#pragma GCC diagnostic pop
return a > b;
}
......
......@@ -75,10 +75,10 @@ size_t bfloat16::size() const
bool bfloat16::operator==(const bfloat16& other) const
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wfloat-equal"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
return (static_cast<float>(*this) == static_cast<float>(other));
#pragma clang diagnostic pop
#pragma GCC diagnostic pop
}
bool bfloat16::operator<(const bfloat16& other) const
......
......@@ -97,10 +97,10 @@ size_t float16::size() const
bool float16::operator==(const float16& other) const
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wfloat-equal"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
return (static_cast<float>(*this) == static_cast<float>(other));
#pragma clang diagnostic pop
#pragma GCC diagnostic pop
}
bool float16::operator<(const float16& other) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment