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
8855c723
Unverified
Commit
8855c723
authored
Oct 23, 2018
by
Robert Kimball
Committed by
GitHub
Oct 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix compiler warnings (#1891)
parent
b3b5b9fd
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
35 additions
and
23 deletions
+35
-23
clang_4_0_flags.cmake
cmake/clang_4_0_flags.cmake
+3
-0
batch_norm.cpp
src/ngraph/op/batch_norm.cpp
+0
-2
cpu_external_function.cpp
src/ngraph/runtime/cpu/cpu_external_function.cpp
+4
-4
cpu_external_function.hpp
src/ngraph/runtime/cpu/cpu_external_function.hpp
+4
-3
halide_op.cpp
src/ngraph/runtime/cpu/op/halide_op.cpp
+5
-5
halide_op.hpp
src/ngraph/runtime/cpu/op/halide_op.hpp
+4
-4
bfloat16.cpp
src/ngraph/type/bfloat16.cpp
+13
-5
bfloat16.hpp
src/ngraph/type/bfloat16.hpp
+2
-0
No files found.
cmake/clang_4_0_flags.cmake
View file @
8855c723
...
...
@@ -43,3 +43,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-padded")
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-sign-compare"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-unused-parameter"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-conversion"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-double-promotion"
)
src/ngraph/op/batch_norm.cpp
View file @
8855c723
...
...
@@ -72,7 +72,6 @@ void ngraph::op::BatchNormInference::validate_and_infer_types()
auto
bn_input_shape
=
get_input_shape
(
INPUT
);
BatchNormBase
::
validate_and_infer_types
();
auto
in_size
=
get_input_size
();
auto
&
et
=
get_input_element_type
(
INPUT
);
set_output_size
(
1
);
set_output_type
(
0
,
et
,
bn_input_shape
);
...
...
@@ -87,7 +86,6 @@ void ngraph::op::BatchNormTraining::validate_and_infer_types()
auto
bn_input_shape
=
get_input_shape
(
INPUT
);
BatchNormBase
::
validate_and_infer_types
();
auto
in_size
=
get_input_size
();
auto
&
et
=
get_input_element_type
(
INPUT
);
Shape
channel_shape
{
bn_input_shape
[
1
]};
set_output_size
(
3
);
...
...
src/ngraph/runtime/cpu/cpu_external_function.cpp
View file @
8855c723
...
...
@@ -182,17 +182,17 @@ runtime::cpu::CPU_ExternalFunction::CPU_ExternalFunction(
const
shared_ptr
<
ngraph
::
Function
>&
function
,
bool
release_function
)
:
m_function
(
function
)
,
m_release_function
(
release_function
)
,
m_use_tbb
(
std
::
getenv
(
"NGRAPH_CPU_USE_TBB"
)
!=
nullptr
)
,
m_compiled_function
(
nullptr
)
,
m_emit_timing
(
false
)
,
m_function_name
(
function
->
get_name
())
,
m_is_built
(
false
)
,
m_use_tbb
(
std
::
getenv
(
"NGRAPH_CPU_USE_TBB"
)
!=
nullptr
)
#if !defined(NGRAPH_DEX_ONLY)
,
m_is_compiled
(
false
)
,
m_direct_execution
(
!
std
::
getenv
(
"NGRAPH_CODEGEN"
))
#else
,
m_direct_execution
(
true
)
#endif
,
m_compiled_function
(
nullptr
)
,
m_function_name
(
function
->
get_name
())
,
m_is_built
(
false
)
{
}
...
...
src/ngraph/runtime/cpu/cpu_external_function.hpp
View file @
8855c723
...
...
@@ -212,7 +212,6 @@ namespace ngraph
std
::
string
emit_op_as_function
(
const
Node
&
,
const
std
::
string
&
function_name
);
std
::
string
strip_comments
(
const
std
::
string
&
);
bool
m_is_compiled
;
std
::
unique_ptr
<
codegen
::
Compiler
>
m_compiler
;
std
::
unique_ptr
<
codegen
::
ExecutionEngine
>
m_execution_engine
;
...
...
@@ -229,7 +228,10 @@ namespace ngraph
bool
m_emit_timing
;
bool
m_use_tbb
;
#if !defined(NGRAPH_DEX_ONLY)
bool
m_is_compiled
;
bool
m_direct_execution
;
#endif
EntryPoint
m_compiled_function
;
std
::
unordered_map
<
std
::
string
,
std
::
string
>
m_variable_name_map
;
...
...
@@ -260,7 +262,6 @@ namespace ngraph
std
::
list
<
std
::
pair
<
std
::
reference_wrapper
<
void
*>
,
size_t
>>
function_output_index
;
std
::
unordered_map
<
std
::
string
,
std
::
shared_ptr
<
CPU_ExternalFunction
>>
callees
;
bool
m_is_built
;
bool
m_direct_execution
;
std
::
vector
<
runtime
::
PerformanceCounter
>
m_perf_counters
;
#if defined(NGRAPH_HALIDE)
...
...
src/ngraph/runtime/cpu/op/halide_op.cpp
View file @
8855c723
...
...
@@ -21,7 +21,7 @@ using namespace ngraph;
shared_ptr
<
Node
>
runtime
::
cpu
::
op
::
HalideOp
::
copy_with_new_args
(
const
NodeVector
&
new_args
)
const
{
return
make_shared
<
HalideOp
>
(
new_args
,
ops
,
output_type
,
output_shape
);
return
make_shared
<
HalideOp
>
(
new_args
,
m_ops
,
m_output_type
,
m_
output_shape
);
}
runtime
::
cpu
::
op
::
HalideOp
::
HalideOp
(
const
NodeVector
&
args
,
...
...
@@ -29,14 +29,14 @@ runtime::cpu::op::HalideOp::HalideOp(const NodeVector& args,
const
element
::
Type
&
out_type
,
const
Shape
&
out_shape
)
:
Op
(
"HalideOp"
,
check_single_output_args
(
args
))
,
ops
(
ops
)
,
output_type
(
out_type
)
,
output_shape
(
out_shape
)
,
m_
ops
(
ops
)
,
m_
output_type
(
out_type
)
,
m_
output_shape
(
out_shape
)
{
constructor_validate_and_infer_types
();
}
void
runtime
::
cpu
::
op
::
HalideOp
::
validate_and_infer_types
()
{
set_output_type
(
0
,
output_type
,
output_shape
);
set_output_type
(
0
,
m_output_type
,
m_
output_shape
);
}
src/ngraph/runtime/cpu/op/halide_op.hpp
View file @
8855c723
...
...
@@ -42,11 +42,11 @@ namespace ngraph
virtual
std
::
shared_ptr
<
Node
>
copy_with_new_args
(
const
NodeVector
&
new_args
)
const
override
;
const
std
::
list
<
std
::
shared_ptr
<
Node
>>&
get_ops
()
const
{
return
ops
;
}
const
std
::
list
<
std
::
shared_ptr
<
Node
>>&
get_ops
()
const
{
return
m_
ops
;
}
private
:
std
::
list
<
std
::
shared_ptr
<
Node
>>
ops
;
element
::
Type
output_type
;
Shape
output_shape
;
std
::
list
<
std
::
shared_ptr
<
Node
>>
m_
ops
;
element
::
Type
m_
output_type
;
Shape
m_
output_shape
;
};
}
}
...
...
src/ngraph/type/bfloat16.cpp
View file @
8855c723
...
...
@@ -102,7 +102,10 @@ size_t bfloat16::size() const
bool
bfloat16
::
operator
==
(
const
bfloat16
&
other
)
const
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wfloat-equal"
return
(
static_cast
<
float
>
(
*
this
)
==
static_cast
<
float
>
(
other
));
#pragma clang diagnostic pop
}
bool
bfloat16
::
operator
<
(
const
bfloat16
&
other
)
const
...
...
@@ -127,12 +130,17 @@ bool bfloat16::operator>=(const bfloat16& other) const
bfloat16
::
operator
float
()
const
{
float
result
=
0
;
uint16_t
*
u16_ptr
=
reinterpret_cast
<
uint16_t
*>
(
&
result
);
//
float result = 0;
//
uint16_t* u16_ptr = reinterpret_cast<uint16_t*>(&result);
// Treat the system as little endian (Intel x86 family)
u16_ptr
[
1
]
=
m_value
;
return
result
;
// // Treat the system as little endian (Intel x86 family)
// u16_ptr[1] = m_value;
return
static_cast
<
float
>
(
static_cast
<
uint32_t
>
(
m_value
)
<<
16
);
}
bfloat16
::
operator
double
()
const
{
return
static_cast
<
float
>
(
m_value
);
}
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
bfloat16
&
obj
)
...
...
src/ngraph/type/bfloat16.hpp
View file @
8855c723
...
...
@@ -32,6 +32,7 @@ namespace ngraph
public
:
bfloat16
()
{}
bfloat16
(
float
value
,
bool
rounding
=
false
);
bfloat16
(
const
bfloat16
&
)
=
default
;
bfloat16
&
operator
=
(
const
bfloat16
&
)
=
default
;
virtual
~
bfloat16
()
{}
std
::
string
to_string
()
const
;
...
...
@@ -43,6 +44,7 @@ namespace ngraph
bool
operator
>
(
const
bfloat16
&
other
)
const
;
bool
operator
>=
(
const
bfloat16
&
other
)
const
;
operator
float
()
const
;
operator
double
()
const
;
static
std
::
vector
<
float
>
to_float_vector
(
const
std
::
vector
<
bfloat16
>&
);
static
std
::
vector
<
bfloat16
>
from_float_vector
(
const
std
::
vector
<
float
>&
);
...
...
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