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
c748bda4
Unverified
Commit
c748bda4
authored
Jan 14, 2020
by
Robert Kimball
Committed by
GitHub
Jan 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Remove conditional compile (#4106)" (#4178)
This reverts commit
1e58565a
.
parent
cd21bddc
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
100 additions
and
7 deletions
+100
-7
ng_dialect_builder.cpp
src/contrib/mlir/core/pass/ng_dialect_builder.cpp
+4
-0
make_constant.hpp
src/ngraph/builder/make_constant.hpp
+4
-0
mlsl.hpp
src/ngraph/distributed/mlsl.hpp
+4
-0
open_mpi.hpp
src/ngraph/distributed/open_mpi.hpp
+8
-0
constant.cpp
src/ngraph/op/constant.cpp
+12
-0
constant.hpp
src/ngraph/op/constant.hpp
+4
-0
range.cpp
src/ngraph/op/experimental/range.cpp
+4
-0
non_max_suppression.cpp
src/ngraph/op/non_max_suppression.cpp
+7
-3
topk.cpp
src/ngraph/op/topk.cpp
+7
-3
constant_folding_convert.cpp
src/ngraph/pass/constant_folding_convert.cpp
+8
-0
constant_folding_reverse.cpp
src/ngraph/pass/constant_folding_reverse.cpp
+4
-0
dyn_elimination.cpp
src/ngraph/pass/dyn_elimination.cpp
+4
-0
random_uniform.cpp
src/ngraph/runtime/cpu/builder/random_uniform.cpp
+4
-0
gcpu_executable.cpp
src/ngraph/runtime/gcpu/gcpu_executable.cpp
+4
-0
int_executable.hpp
src/ngraph/runtime/interpreter/int_executable.hpp
+4
-1
serializer.cpp
src/ngraph/serializer.cpp
+10
-0
benchmark_utils.cpp
src/tools/nbench/benchmark_utils.cpp
+4
-0
distributed.in.cpp
test/backend/distributed.in.cpp
+4
-0
No files found.
src/contrib/mlir/core/pass/ng_dialect_builder.cpp
View file @
c748bda4
...
...
@@ -232,9 +232,11 @@ mlir::Type NgDialectConversionPass::getMlirType(const descriptor::Tensor* tensor
// Converts an nGraph element type into an MLIR type.
mlir
::
Type
NgDialectConversionPass
::
getMlirType
(
const
element
::
Type
&
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
(
type
)
{
...
...
@@ -259,7 +261,9 @@ mlir::Type NgDialectConversionPass::getMlirType(const element::Type& type)
NGRAPH_CHECK
(
false
,
"Unreachable"
);
return
mlir
::
Type
();
#if defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic pop
#endif
}
mlir
::
Type
NgDialectConversionPass
::
getMlirType
(
const
ngraph
::
Node
*
node
)
...
...
src/ngraph/builder/make_constant.hpp
View file @
c748bda4
...
...
@@ -31,9 +31,11 @@ namespace ngraph
{
std
::
shared_ptr
<
Node
>
val
=
nullptr
;
#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
(
type
)
{
case
element
:
:
Type_t
::
f32
:
...
...
@@ -97,7 +99,9 @@ namespace ngraph
case
element
:
:
Type_t
::
undefined
:
throw
ngraph_error
(
"make_constant: Unsupported element type 'undefined'"
);
}
#if defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic pop
#endif
if
(
shape
.
size
()
>
0
)
{
...
...
src/ngraph/distributed/mlsl.hpp
View file @
c748bda4
...
...
@@ -87,9 +87,11 @@ namespace ngraph
}
decltype
(
MLSL
::
RT_SUM
)
mlsl_reduce_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
(
reduce_type
)
{
case
reduction
:
:
Type
::
SUM
:
mlsl_reduce_type
=
MLSL
::
RT_SUM
;
break
;
...
...
@@ -99,7 +101,9 @@ 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)
#pragma GCC diagnostic pop
#endif
MLSL
::
Environment
&
env
=
MLSL
::
Environment
::
GetEnv
();
MLSL
::
Distribution
*
distribution
=
env
.
CreateDistribution
(
env
.
GetProcessCount
(),
1
);
...
...
src/ngraph/distributed/open_mpi.hpp
View file @
c748bda4
...
...
@@ -99,9 +99,11 @@ namespace ngraph
}
decltype
(
MPI_SUM
)
mpi_reduce_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
(
reduce_type
)
{
case
reduction
:
:
Type
::
SUM
:
mpi_reduce_type
=
MPI_SUM
;
break
;
...
...
@@ -109,7 +111,9 @@ 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)
#pragma GCC diagnostic pop
#endif
MPI_Allreduce
(
in
,
out
,
count
,
data_type
,
mpi_reduce_type
,
MPI_COMM_WORLD
);
}
...
...
@@ -172,9 +176,11 @@ 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)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
#endif
switch
(
n_type
)
{
case
element
:
:
Type_t
::
boolean
:
m_type
=
MPI_BYTE
;
break
;
...
...
@@ -194,7 +200,9 @@ 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)
#pragma GCC diagnostic pop
#endif
return
m_type
;
}
...
...
src/ngraph/op/constant.cpp
View file @
c748bda4
...
...
@@ -120,9 +120,11 @@ op::Constant::~Constant()
string
op
::
Constant
::
convert_value_to_string
(
size_t
index
)
const
{
string
rc
;
#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
())
{
case
element
:
:
Type_t
::
boolean
:
rc
=
to_string
(
get_vector
<
char
>
()[
index
]);
break
;
...
...
@@ -148,7 +150,9 @@ 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)
#pragma GCC diagnostic pop
#endif
return
rc
;
}
...
...
@@ -156,9 +160,11 @@ vector<string> op::Constant::get_value_strings() const
{
vector
<
string
>
rc
;
#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
())
{
case
element
:
:
Type_t
::
boolean
:
...
...
@@ -243,7 +249,9 @@ 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)
#pragma GCC diagnostic pop
#endif
return
rc
;
}
...
...
@@ -349,9 +357,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
())
{
case
element
:
:
Type_t
::
boolean
:
...
...
@@ -387,7 +397,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 @
c748bda4
...
...
@@ -318,9 +318,11 @@ namespace ngraph
{
throw
std
::
runtime_error
(
"Constant initializer does not match shape"
);
}
#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
(
target_type
)
{
case
element
:
:
Type_t
::
boolean
:
...
...
@@ -366,7 +368,9 @@ 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)
#pragma GCC diagnostic pop
#endif
}
static
constexpr
size_t
host_alignment
()
{
return
64
;
}
...
...
src/ngraph/op/experimental/range.cpp
View file @
c748bda4
...
...
@@ -210,9 +210,11 @@ void op::Range::validate_and_infer_types()
PartialShape
result_shape
;
#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
(
result_et
)
{
case
element
:
:
Type_t
::
bf16
:
result_shape
=
infer_output_shape
<
bfloat16
>
(
this
,
result_et
);
break
;
...
...
@@ -235,7 +237,9 @@ 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)
#pragma GCC diagnostic pop
#endif
set_output_type
(
0
,
result_et
,
result_shape
);
}
...
...
src/ngraph/op/non_max_suppression.cpp
View file @
c748bda4
...
...
@@ -154,8 +154,10 @@ int64_t op::v1::NonMaxSuppression::max_boxes_output_from_input() const
const
auto
max_output_boxes_input
=
as_type_ptr
<
op
::
Constant
>
(
input_value
(
2
).
get_node_shared_ptr
());
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wswitch-enum"
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wswitch-enum"
#endif
switch
(
static_cast
<
element
::
Type_t
>
(
max_output_boxes_input
->
get_element_type
()))
{
case
element
:
:
Type_t
::
i8
:
...
...
@@ -180,7 +182,9 @@ int64_t op::v1::NonMaxSuppression::max_boxes_output_from_input() const
}
default
:
break
;
}
#pragma GCC diagnostic pop
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
return
max_output_boxes
;
}
src/ngraph/op/topk.cpp
View file @
c748bda4
...
...
@@ -313,8 +313,10 @@ size_t op::v1::TopK::read_k_from_constant_node(const shared_ptr<Node>& node,
size_t
k
=
0
;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wswitch-enum"
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wswitch-enum"
#endif
switch
(
static_cast
<
element
::
Type_t
>
(
k_element_type
))
{
case
element
:
:
Type_t
::
i8
:
k
=
validate_and_get_k
<
int8_t
>
(
k_constant
);
break
;
...
...
@@ -322,7 +324,9 @@ size_t op::v1::TopK::read_k_from_constant_node(const shared_ptr<Node>& node,
case
element
:
:
Type_t
::
i64
:
k
=
validate_and_get_k
<
int64_t
>
(
k_constant
);
break
;
default
:
break
;
}
#pragma GCC diagnostic pop
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
return
k
;
}
...
...
src/ngraph/pass/constant_folding_convert.cpp
View file @
c748bda4
...
...
@@ -45,9 +45,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
)
{
case
element
:
:
Type_t
::
undefined
:
...
...
@@ -88,7 +90,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
,
...
...
@@ -101,9 +105,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
)
{
case
element
:
:
Type_t
::
undefined
:
...
...
@@ -144,7 +150,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
()
...
...
src/ngraph/pass/constant_folding_reverse.cpp
View file @
c748bda4
...
...
@@ -40,9 +40,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
)
{
case
element
:
:
Type_t
::
undefined
:
...
...
@@ -80,7 +82,9 @@ 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 @
c748bda4
...
...
@@ -385,9 +385,11 @@ void pass::DynElimination::construct_range()
std
::
shared_ptr
<
op
::
Constant
>
replacement
;
#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
(
et
)
{
case
element
:
:
Type_t
::
bf16
:
...
...
@@ -433,7 +435,9 @@ void pass::DynElimination::construct_range()
NGRAPH_CHECK
(
false
,
"Internal nGraph error: unsupported element type: "
,
et
);
break
;
}
#if defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic pop
#endif
replace_node
(
range_node
,
replacement
);
return
true
;
...
...
src/ngraph/runtime/cpu/builder/random_uniform.cpp
View file @
c748bda4
...
...
@@ -97,9 +97,11 @@ namespace ngraph
throw
ngraph_error
(
"Unsupported index 2 element type"
);
}
auto
element_type
=
args
[
0
].
get_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
(
element_type
)
{
case
element
:
:
Type_t
::
undefined
:
...
...
@@ -155,7 +157,9 @@ namespace ngraph
NGRAPH_UNREACHABLE
(
"Unexpected switch case"
);
}
#if defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic pop
#endif
functors
.
emplace_back
(
functor
);
}
...
...
src/ngraph/runtime/gcpu/gcpu_executable.cpp
View file @
c748bda4
...
...
@@ -127,8 +127,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
ngraph
:
:
runtime
::
interpreter
::
OP_TYPEID
::
Convert
:
...
...
@@ -154,7 +156,9 @@ bool runtime::gcpu::GCPUExecutable::call(const vector<shared_ptr<runtime::Tensor
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 @
c748bda4
...
...
@@ -204,10 +204,11 @@ protected:
// 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)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
// #pragma GCC diagnostic error "-Wcovered-switch-default"
#endif
switch
(
get_typeid
(
node
))
{
case
OP_TYPEID
:
:
Abs
:
...
...
@@ -1889,7 +1890,9 @@ protected:
case
OP_TYPEID
:
:
TensorIterator
:
case
OP_TYPEID
:
:
UnknownOp
:
throw
unsupported_op
(
"Unsupported op '"
+
node
.
description
()
+
"'"
);
#if defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic pop
#endif
}
}
};
src/ngraph/serializer.cpp
View file @
c748bda4
...
...
@@ -780,9 +780,12 @@ shared_ptr<Node> JSONDeserializer::deserialize_node(json node_js)
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)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
// #pragma GCC diagnostic error "-Wimplicit-fallthrough"
#endif
switch
(
get_typeid
(
type_info
))
{
...
...
@@ -3012,7 +3015,9 @@ shared_ptr<Node> JSONDeserializer::deserialize_node(json node_js)
throw
runtime_error
(
ss
.
str
());
}
}
#if defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic pop
#endif
for
(
auto
&
control_dep
:
control_deps_inputs
)
{
...
...
@@ -3152,9 +3157,12 @@ json JSONSerializer::serialize_node(const Node& n)
node
[
"provenance_tags"
]
=
provenance_tags
;
}
#if !(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8))
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
// #pragma GCC diagnostic error "-Wimplicit-fallthrough"
#endif
switch
(
get_typeid
(
type_info
))
{
case
OP_TYPEID
:
:
Abs
:
{
break
;
...
...
@@ -4661,6 +4669,8 @@ json JSONSerializer::serialize_node(const Node& n)
case
OP_TYPEID
:
:
UnknownOp
:
{
break
;
}
}
#if !(defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 8))
#pragma GCC diagnostic pop
#endif
return
node
;
}
src/tools/nbench/benchmark_utils.cpp
View file @
c748bda4
...
...
@@ -80,9 +80,11 @@ 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)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
#endif
switch
(
et
)
{
case
element
:
:
Type_t
::
boolean
:
init_int_tensor
<
char
>
(
tensor
,
0
,
1
);
break
;
...
...
@@ -103,7 +105,9 @@ 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)
#pragma GCC diagnostic pop
#endif
}
default_random_engine
&
get_random_engine
()
...
...
test/backend/distributed.in.cpp
View file @
c748bda4
...
...
@@ -48,9 +48,11 @@ 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)
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#pragma GCC diagnostic error "-Wswitch-enum"
#endif
switch
(
reduce_type
)
{
case
reduction
:
:
Type
::
SUM
:
...
...
@@ -81,7 +83,9 @@ static void test_allreduce_common(reduction::Type reduce_type)
v
[
i
]
=
i
+
2
;
}
}
#if defined(__GNUC__) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 8)
#pragma GCC diagnostic pop
#endif
auto
handle
=
backend
->
compile
(
f
);
handle
->
call_with_validate
({
result
},
{
a
});
...
...
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