Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
5c298a4a
Unverified
Commit
5c298a4a
authored
Aug 02, 2019
by
Scott Cyphers
Committed by
GitHub
Aug 02, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3354 from NervanaSystems/silee2/pragma
Improve pragma usage.
parents
c0ab7d42
18708e0c
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
111 additions
and
38 deletions
+111
-38
compiler.cpp
src/contrib/mlir/compiler.cpp
+2
-2
distributed.cpp
src/ngraph/distributed.cpp
+2
-2
mlsl.hpp
src/ngraph/distributed/mlsl.hpp
+2
-2
open_mpi.hpp
src/ngraph/distributed/open_mpi.hpp
+4
-4
log.cpp
src/ngraph/log.cpp
+4
-0
constant.cpp
src/ngraph/op/constant.cpp
+8
-4
constant.hpp
src/ngraph/op/constant.hpp
+2
-2
range.cpp
src/ngraph/op/experimental/range.cpp
+2
-2
constant_folding.cpp
src/ngraph/pass/constant_folding.cpp
+25
-0
dyn_elimination.cpp
src/ngraph/pass/dyn_elimination.cpp
+2
-2
batch_norm.cpp
src/ngraph/runtime/cpu/builder/batch_norm.cpp
+14
-6
cpu_fusion.cpp
src/ngraph/runtime/cpu/pass/cpu_fusion.cpp
+4
-0
gcpu_executable.cpp
src/ngraph/runtime/generic_cpu/gcpu_executable.cpp
+4
-0
gcpu_executable.hpp
src/ngraph/runtime/generic_cpu/gcpu_executable.hpp
+2
-2
intelgpu_backend.cpp
src/ngraph/runtime/intelgpu/intelgpu_backend.cpp
+2
-2
int_executable.cpp
src/ngraph/runtime/interpreter/int_executable.cpp
+4
-0
int_executable.hpp
src/ngraph/runtime/interpreter/int_executable.hpp
+2
-2
equal.hpp
src/ngraph/runtime/reference/equal.hpp
+4
-0
not_equal.hpp
src/ngraph/runtime/reference/not_equal.hpp
+4
-0
topk.hpp
src/ngraph/runtime/reference/topk.hpp
+4
-0
serializer.cpp
src/ngraph/serializer.cpp
+2
-2
bfloat16.cpp
src/ngraph/type/bfloat16.cpp
+4
-0
float16.cpp
src/ngraph/type/float16.cpp
+4
-0
benchmark_utils.cpp
src/tools/nbench/benchmark_utils.cpp
+2
-2
distributed.in.cpp
test/backend/distributed.in.cpp
+2
-2
No files found.
src/contrib/mlir/compiler.cpp
View file @
5c298a4a
...
...
@@ -187,7 +187,7 @@ mlir::Type MLIRCompiler::get_mlir_type(const descriptor::Tensor* tensor)
// Converts an nGraph element type into an MLIR type.
mlir
::
Type
MLIRCompiler
::
get_mlir_type
(
const
element
::
Type
&
type
)
{
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
...
...
@@ -215,7 +215,7 @@ mlir::Type MLIRCompiler::get_mlir_type(const element::Type& type)
NGRAPH_CHECK
(
false
,
"Unreachable"
);
return
mlir
::
Type
();
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic pop
#endif
}
...
...
src/ngraph/distributed.cpp
View file @
5c298a4a
...
...
@@ -24,7 +24,7 @@ using namespace ngraph;
std
::
ostream
&
reduction
::
operator
<<
(
std
::
ostream
&
out
,
const
reduction
::
Type
&
obj
)
{
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
...
...
@@ -36,7 +36,7 @@ std::ostream& reduction::operator<<(std::ostream& out, const reduction::Type& ob
case
reduction
:
:
Type
::
MIN
:
out
<<
"MIN"
;
break
;
case
reduction
:
:
Type
::
MAX
:
out
<<
"MAX"
;
break
;
}
#if
!(defined(__GNUC__) &&
__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#if
defined(__GNUC__) && !(
__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic pop
#endif
return
out
;
...
...
src/ngraph/distributed/mlsl.hpp
View file @
5c298a4a
...
...
@@ -87,7 +87,7 @@ namespace ngraph
}
decltype
(
MLSL
::
RT_SUM
)
mlsl_reduce_type
;
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
...
...
@@ -101,7 +101,7 @@ namespace ngraph
case
reduction
:
:
Type
::
MIN
:
mlsl_reduce_type
=
MLSL
::
RT_MIN
;
break
;
case
reduction
:
:
Type
::
MAX
:
mlsl_reduce_type
=
MLSL
::
RT_MAX
;
break
;
}
#if
!(defined(__GNUC__) &&
__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#if
defined(__GNUC__) && !(
__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic pop
#endif
...
...
src/ngraph/distributed/open_mpi.hpp
View file @
5c298a4a
...
...
@@ -99,7 +99,7 @@ namespace ngraph
}
decltype
(
MPI_SUM
)
mpi_reduce_type
;
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
...
...
@@ -111,7 +111,7 @@ namespace ngraph
case
reduction
:
:
Type
::
MIN
:
mpi_reduce_type
=
MPI_MIN
;
break
;
case
reduction
:
:
Type
::
MAX
:
mpi_reduce_type
=
MPI_MAX
;
break
;
}
#if
!(defined(__GNUC__) &&
__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#if
defined(__GNUC__) && !(
__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic pop
#endif
...
...
@@ -176,7 +176,7 @@ namespace ngraph
MPI_Datatype
ngraph_type_to_mpi_type
(
element
::
Type_t
&
n_type
)
{
MPI_Datatype
m_type
=
MPI_FLOAT
;
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
...
...
@@ -199,7 +199,7 @@ namespace ngraph
case
element
:
:
Type_t
::
undefined
:
case
element
:
:
Type_t
::
dynamic
:
throw
std
::
runtime_error
(
"unsupported type"
);
}
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic pop
#endif
return
m_type
;
...
...
src/ngraph/log.cpp
View file @
5c298a4a
...
...
@@ -105,12 +105,16 @@ void ngraph::LogPrintf(const char* fmt, ...)
va_start
(
args1
,
fmt
);
va_list
args2
;
va_copy
(
args2
,
args1
);
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
#endif
std
::
vector
<
char
>
buf
(
1
+
std
::
vsnprintf
(
nullptr
,
0
,
fmt
,
args1
));
va_end
(
args1
);
std
::
vsnprintf
(
buf
.
data
(),
buf
.
size
(),
fmt
,
args2
);
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
va_end
(
args2
);
get_distributed_interface
()
->
log_print
(
get_timestamp
(),
buf
);
}
...
...
src/ngraph/op/constant.cpp
View file @
5c298a4a
...
...
@@ -54,7 +54,7 @@ op::Constant::~Constant()
string
op
::
Constant
::
convert_value_to_string
(
size_t
index
)
const
{
string
rc
;
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
...
...
@@ -81,7 +81,7 @@ string op::Constant::convert_value_to_string(size_t index) const
case
element
:
:
Type_t
::
undefined
:
throw
runtime_error
(
"unsupported type"
);
case
element
:
:
Type_t
::
dynamic
:
throw
runtime_error
(
"unsupported type"
);
}
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic pop
#endif
return
rc
;
...
...
@@ -91,7 +91,7 @@ vector<string> op::Constant::get_value_strings() const
{
vector
<
string
>
rc
;
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
...
...
@@ -179,7 +179,7 @@ vector<string> op::Constant::get_value_strings() const
case
element
:
:
Type_t
::
undefined
:
throw
runtime_error
(
"unsupported type"
);
case
element
:
:
Type_t
::
dynamic
:
throw
runtime_error
(
"unsupported type"
);
}
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic pop
#endif
...
...
@@ -287,9 +287,11 @@ static bool test_bitwise_identical(const op::Constant* constant)
bool
op
::
Constant
::
are_all_data_elements_bitwise_identical
()
const
{
bool
rc
=
false
;
#if defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
#endif
switch
(
get_element_type
().
get_type_enum
())
{
case
element
:
:
Type_t
::
boolean
:
...
...
@@ -324,7 +326,9 @@ bool op::Constant::are_all_data_elements_bitwise_identical() const
case
element
:
:
Type_t
::
undefined
:
case
element
:
:
Type_t
::
dynamic
:
break
;
}
#if defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic pop
#endif
return
rc
;
}
...
...
src/ngraph/op/constant.hpp
View file @
5c298a4a
...
...
@@ -284,7 +284,7 @@ namespace ngraph
{
throw
std
::
runtime_error
(
"Constant initializer does not match shape"
);
}
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
...
...
@@ -333,7 +333,7 @@ namespace ngraph
case
element
:
:
Type_t
::
undefined
:
throw
std
::
runtime_error
(
"unsupported type"
);
case
element
:
:
Type_t
::
dynamic
:
throw
std
::
runtime_error
(
"unsupported type"
);
}
#if
!(defined(__GNUC__) &&
__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#if
defined(__GNUC__) && !(
__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic pop
#endif
}
...
...
src/ngraph/op/experimental/range.cpp
View file @
5c298a4a
...
...
@@ -214,7 +214,7 @@ void op::Range::validate_and_infer_types()
PartialShape
result_shape
;
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
...
...
@@ -240,7 +240,7 @@ void op::Range::validate_and_infer_types()
this
,
false
,
"Internal nGraph error: unsupported element type: "
,
result_et
);
break
;
}
#if
!(defined(__GNUC__) &&
__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#if
defined(__GNUC__) && !(
__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic pop
#endif
...
...
src/ngraph/pass/constant_folding.cpp
View file @
5c298a4a
...
...
@@ -1509,6 +1509,11 @@ template <typename TI>
shared_ptr
<
op
::
Constant
>
fold_constant_convert_helper0
(
shared_ptr
<
op
::
Constant
>
constant
,
const
element
::
Type
&
output_element_type
)
{
#if defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
#endif
switch
(
output_element_type
.
get_type_enum
())
{
case
element
:
:
Type_t
::
undefined
:
...
...
@@ -1546,6 +1551,9 @@ shared_ptr<op::Constant> fold_constant_convert_helper0(shared_ptr<op::Constant>
}
NGRAPH_UNREACHABLE
(
"Unexpected switch case"
);
#if defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic pop
#endif
}
static
shared_ptr
<
op
::
Constant
>
fold_constant_convert
(
shared_ptr
<
op
::
Constant
>
constant
,
...
...
@@ -1558,6 +1566,11 @@ static shared_ptr<op::Constant> fold_constant_convert(shared_ptr<op::Constant> c
return
constant
;
}
#if defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
#endif
switch
(
input_element_type
.
get_type_enum
())
{
case
element
:
:
Type_t
::
undefined
:
...
...
@@ -1595,6 +1608,9 @@ static shared_ptr<op::Constant> fold_constant_convert(shared_ptr<op::Constant> c
}
NGRAPH_UNREACHABLE
(
"Unexpected switch case"
);
#if defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic pop
#endif
}
void
pass
::
ConstantFolding
::
construct_constant_convert
()
...
...
@@ -1677,6 +1693,11 @@ static shared_ptr<op::Constant> fold_constant_reverse(shared_ptr<op::Constant> c
{
auto
&
input_element_type
=
constant
->
get_output_element_type
(
0
);
#if defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
#endif
switch
(
input_element_type
.
get_type_enum
())
{
case
element
:
:
Type_t
::
undefined
:
...
...
@@ -1710,6 +1731,10 @@ static shared_ptr<op::Constant> fold_constant_reverse(shared_ptr<op::Constant> c
}
NGRAPH_UNREACHABLE
(
"Unexpected switch case"
);
#if defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic pop
#endif
}
void
pass
::
ConstantFolding
::
construct_constant_reverse
()
...
...
src/ngraph/pass/dyn_elimination.cpp
View file @
5c298a4a
...
...
@@ -385,7 +385,7 @@ void pass::DynElimination::construct_range()
std
::
shared_ptr
<
op
::
Constant
>
replacement
;
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
...
...
@@ -434,7 +434,7 @@ void pass::DynElimination::construct_range()
NGRAPH_CHECK
(
false
,
"Internal nGraph error: unsupported element type: "
,
et
);
break
;
}
#if
!(defined(__GNUC__) &&
__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#if
defined(__GNUC__) && !(
__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic pop
#endif
...
...
src/ngraph/runtime/cpu/builder/batch_norm.cpp
View file @
5c298a4a
...
...
@@ -49,14 +49,18 @@ namespace ngraph
auto
out0_buffer_index
=
external_function
->
get_buffer_index
(
out
[
0
].
get_name
());
// Kill clang diagnostics bug
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-braces"
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmissing-braces"
#endif
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 GCC diagnostic pop
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
shared_ptr
<
uint8_t
>
stacked_weights
(
new
uint8_t
[
weight_sizes
[
0
]
+
weight_sizes
[
1
]],
std
::
default_delete
<
uint8_t
[]
>
());
...
...
@@ -396,14 +400,18 @@ namespace ngraph
auto
out2_buffer_index
=
external_function
->
get_buffer_index
(
out
[
2
].
get_name
());
// Kill clang diagnostics bug
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-braces"
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmissing-braces"
#endif
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 GCC diagnostic pop
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
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
]],
...
...
src/ngraph/runtime/cpu/pass/cpu_fusion.cpp
View file @
5c298a4a
...
...
@@ -1348,14 +1348,18 @@ void ngraph::runtime::cpu::pass::CPUFusion::construct_leaky_relu()
auto
alpha_vec
=
alpha_const_op
->
get_vector
<
float
>
();
for
(
auto
val
:
alpha_vec
)
{
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
#endif
if
(
val
!=
alpha_vec
[
0
])
{
NGRAPH_DEBUG
<<
"alpha is not a singular constant"
;
return
false
;
}
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
}
if
(
alpha_vec
[
0
]
<
0
)
...
...
src/ngraph/runtime/generic_cpu/gcpu_executable.cpp
View file @
5c298a4a
...
...
@@ -160,8 +160,10 @@ bool runtime::gcpu::GCPUExecutable::call(const vector<shared_ptr<runtime::Tensor
// get op type
element
::
Type
type
;
#if defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wswitch-enum"
#endif
switch
(
type_id
)
{
case
OP_TYPEID
:
:
Convert
:
...
...
@@ -183,7 +185,9 @@ bool runtime::gcpu::GCPUExecutable::call(const vector<shared_ptr<runtime::Tensor
case
OP_TYPEID
:
:
TopK
:
type
=
op
->
get_output_element_type
(
1
);
break
;
default
:
type
=
op
->
get_output_element_type
(
0
);
break
;
}
#if defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic pop
#endif
if
(
m_performance_counters_enabled
)
{
...
...
src/ngraph/runtime/generic_cpu/gcpu_executable.hpp
View file @
5c298a4a
...
...
@@ -217,7 +217,7 @@ private:
// We want to check that every OP_TYPEID enumeration is included in the list.
// These GCC flags enable compile-time checking so that if an enumeration
// is not in the list an error is generated.
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
...
...
@@ -1613,7 +1613,7 @@ private:
case
OP_TYPEID
:
:
Tile
:
case
OP_TYPEID
:
:
DynReplaceSlice
:
throw
unsupported_op
(
"Unsupported op '"
+
node
.
description
()
+
"'"
);
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic pop
#endif
}
...
...
src/ngraph/runtime/intelgpu/intelgpu_backend.cpp
View file @
5c298a4a
...
...
@@ -464,7 +464,7 @@ shared_ptr<runtime::Executable>
// We want to check that every OP_TYPEID enumeration is included in the list.
// These GCC flags enable compile-time checking so that if an enumeration
// is not in the list an error is generated.
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
...
...
@@ -2111,7 +2111,7 @@ shared_ptr<runtime::Executable>
throw
unsupported_op
(
"Unsupported op '"
+
op
->
description
()
+
"' in IntelGPU back end."
);
}
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic pop
#endif
}
...
...
src/ngraph/runtime/interpreter/int_executable.cpp
View file @
5c298a4a
...
...
@@ -164,8 +164,10 @@ bool runtime::interpreter::INTExecutable::call(const vector<shared_ptr<runtime::
// get op type
element
::
Type
type
;
#if defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wswitch-enum"
#endif
switch
(
type_id
)
{
case
OP_TYPEID
:
:
Convert
:
...
...
@@ -187,7 +189,9 @@ bool runtime::interpreter::INTExecutable::call(const vector<shared_ptr<runtime::
case
OP_TYPEID
:
:
TopK
:
type
=
op
->
get_output_element_type
(
1
);
break
;
default
:
type
=
op
->
get_output_element_type
(
0
);
break
;
}
#if defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic pop
#endif
if
(
m_performance_counters_enabled
)
{
...
...
src/ngraph/runtime/interpreter/int_executable.hpp
View file @
5c298a4a
...
...
@@ -229,7 +229,7 @@ private:
// We want to check that every OP_TYPEID enumeration is included in the list.
// These GCC flags enable compile-time checking so that if an enumeration
// is not in the list an error is generated.
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
...
...
@@ -1622,7 +1622,7 @@ private:
case
OP_TYPEID
:
:
Tile
:
case
OP_TYPEID
:
:
DynReplaceSlice
:
throw
unsupported_op
(
"Unsupported op '"
+
node
.
description
()
+
"'"
);
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic pop
#endif
}
...
...
src/ngraph/runtime/reference/equal.hpp
View file @
5c298a4a
...
...
@@ -16,8 +16,10 @@
#pragma once
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
#endif
#include <cstddef>
...
...
@@ -42,4 +44,6 @@ namespace ngraph
}
}
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
src/ngraph/runtime/reference/not_equal.hpp
View file @
5c298a4a
...
...
@@ -16,8 +16,10 @@
#pragma once
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
#endif
#include <cstddef>
...
...
@@ -42,4 +44,6 @@ namespace ngraph
}
}
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
src/ngraph/runtime/reference/topk.hpp
View file @
5c298a4a
...
...
@@ -35,13 +35,17 @@ namespace ngraph
{
// this is intentional to be able to compare floats directly
// without using relative or absolute tolerance
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
#endif
if
(
std
::
get
<
0
>
(
a
)
==
std
::
get
<
0
>
(
b
))
{
return
std
::
get
<
1
>
(
a
)
<
std
::
get
<
1
>
(
b
);
}
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
return
a
>
b
;
}
...
...
src/ngraph/serializer.cpp
View file @
5c298a4a
...
...
@@ -723,7 +723,7 @@ shared_ptr<Node> JSONDeserializer::deserialize_node(json node_js)
vector
<
json
>
control_deps_inputs
=
get_value
<
vector
<
json
>>
(
node_js
,
"control_deps"
);
vector
<
string
>
node_outputs
=
get_value
<
vector
<
string
>>
(
node_js
,
"outputs"
);
OutputVectorHelper
args
(
deserialize_output_vector
(
node_js
[
"inputs"
]));
#if
!(defined(__GNUC__) &&
__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#if
defined(__GNUC__) && !(
__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
...
...
@@ -1927,7 +1927,7 @@ shared_ptr<Node> JSONDeserializer::deserialize_node(json node_js)
throw
runtime_error
(
ss
.
str
());
}
}
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic pop
#endif
...
...
src/ngraph/type/bfloat16.cpp
View file @
5c298a4a
...
...
@@ -75,10 +75,14 @@ size_t bfloat16::size() const
bool
bfloat16
::
operator
==
(
const
bfloat16
&
other
)
const
{
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
#endif
return
(
static_cast
<
float
>
(
*
this
)
==
static_cast
<
float
>
(
other
));
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
}
bool
bfloat16
::
operator
<
(
const
bfloat16
&
other
)
const
...
...
src/ngraph/type/float16.cpp
View file @
5c298a4a
...
...
@@ -97,10 +97,14 @@ size_t float16::size() const
bool
float16
::
operator
==
(
const
float16
&
other
)
const
{
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
#endif
return
(
static_cast
<
float
>
(
*
this
)
==
static_cast
<
float
>
(
other
));
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
}
bool
float16
::
operator
<
(
const
float16
&
other
)
const
...
...
src/tools/nbench/benchmark_utils.cpp
View file @
5c298a4a
...
...
@@ -80,7 +80,7 @@ void set_denormals_flush_to_zero()
void
random_init
(
shared_ptr
<
runtime
::
Tensor
>
tensor
)
{
element
::
Type
et
=
tensor
->
get_element_type
();
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
...
...
@@ -104,7 +104,7 @@ void random_init(shared_ptr<runtime::Tensor> tensor)
case
element
:
:
Type_t
::
f16
:
default
:
throw
runtime_error
(
"unsupported type"
);
}
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic pop
#endif
}
...
...
test/backend/distributed.in.cpp
View file @
5c298a4a
...
...
@@ -48,7 +48,7 @@ static void test_allreduce_common(reduction::Type reduce_type)
auto
a
=
backend
->
create_tensor
(
element
::
f32
,
shape
);
auto
result
=
backend
->
create_tensor
(
element
::
f32
,
shape
);
#if
!(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
)
#if
defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8
)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
...
...
@@ -84,7 +84,7 @@ static void test_allreduce_common(reduction::Type reduce_type)
v
[
i
]
=
i
+
2
;
}
}
#if
!(defined(__GNUC__) &&
__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#if
defined(__GNUC__) && !(
__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic pop
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment