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
f9caac99
Commit
f9caac99
authored
Mar 05, 2019
by
Robert Kimball
Committed by
Scott Cyphers
Mar 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address klocwork issues (#2555)
parent
ca5476b3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
7 deletions
+17
-7
compiler.cpp
src/ngraph/codegen/compiler.cpp
+2
-2
log.cpp
src/ngraph/log.cpp
+6
-3
cpu_rnn_fusion.cpp
src/ngraph/runtime/cpu/pass/cpu_rnn_fusion.cpp
+2
-2
hybrid_util.cpp
src/ngraph/runtime/hybrid/hybrid_util.cpp
+4
-0
cpu_test.cpp
test/cpu_test.cpp
+3
-0
No files found.
src/ngraph/codegen/compiler.cpp
View file @
f9caac99
...
...
@@ -615,7 +615,7 @@ int codegen::CompilerCore::full_version_number(const std::string& path, const st
}
// create full version number and return
std
::
string
full_version
=
{}
;
std
::
string
full_version
=
"0"
;
// Assume versioning like X.Y.Z
int
padding
=
3
-
tokens
.
size
();
for
(
std
::
string
s
:
tokens
)
...
...
@@ -633,7 +633,7 @@ std::string codegen::CompilerCore::find_header_version(const std::string& path)
{
// Step 1: find highest g++ version
std
::
string
gpp_prefix
=
file_util
::
path_join
(
path
,
"bin/g++-"
);
std
::
string
gpp_ver
=
{}
;
std
::
string
gpp_ver
=
"0"
;
for
(
auto
i
:
{
"8"
,
"7"
,
"6"
,
"5"
,
"4.9"
,
"4.8"
})
{
if
(
file_util
::
exists
(
gpp_prefix
+
i
))
...
...
src/ngraph/log.cpp
View file @
f9caac99
...
...
@@ -84,10 +84,13 @@ std::string ngraph::get_timestamp()
auto
timer
=
std
::
chrono
::
system_clock
::
to_time_t
(
now
);
// convert to broken time
std
::
tm
*
bt
=
std
::
localtime
(
&
timer
);
char
buffer
[
256
];
strftime
(
buffer
,
sizeof
(
buffer
),
"%H:%M:%S"
,
bt
);
buffer
[
0
]
=
0
;
std
::
tm
*
bt
=
std
::
localtime
(
&
timer
);
if
(
bt
)
{
strftime
(
buffer
,
sizeof
(
buffer
),
"%H:%M:%S"
,
bt
);
}
std
::
ostringstream
timestamp
;
timestamp
<<
buffer
;
...
...
src/ngraph/runtime/cpu/pass/cpu_rnn_fusion.cpp
View file @
f9caac99
...
...
@@ -804,8 +804,8 @@ void ngraph::runtime::cpu::pass::BiDirectionalRnn::construct_bidirectional_rnn()
rnn_right_to_left
](
pattern
::
Matcher
&
m
)
{
auto
pattern_map
=
m
.
get_pattern_map
();
auto
rnn_ltor_node
=
std
::
dynam
ic_pointer_cast
<
op
::
Rnn
>
(
pattern_map
[
rnn_left_to_right
]);
auto
rnn_rtol_node
=
std
::
dynam
ic_pointer_cast
<
op
::
Rnn
>
(
pattern_map
[
rnn_right_to_left
]);
auto
rnn_ltor_node
=
std
::
stat
ic_pointer_cast
<
op
::
Rnn
>
(
pattern_map
[
rnn_left_to_right
]);
auto
rnn_rtol_node
=
std
::
stat
ic_pointer_cast
<
op
::
Rnn
>
(
pattern_map
[
rnn_right_to_left
]);
if
(
rnn_ltor_node
->
get_src_sequence_length
()
!=
rnn_rtol_node
->
get_src_sequence_length
())
{
...
...
src/ngraph/runtime/hybrid/hybrid_util.cpp
View file @
f9caac99
...
...
@@ -161,6 +161,10 @@ void runtime::hybrid::rewrite_function(const shared_ptr<Function>& f,
if
(
cluster
.
size
()
>
0
)
{
shared_ptr
<
Node
>
tmp_node
=
*
cluster
.
begin
();
if
(
tmp_node
==
nullptr
)
{
throw
runtime_error
(
"cluster contains nullptr instead of nodes"
);
}
auto
placement
=
tmp_node
->
get_placement_index
();
if
(
placement
!=
0
)
{
...
...
test/cpu_test.cpp
View file @
f9caac99
...
...
@@ -775,6 +775,7 @@ TEST(cpu_test, memory_reuse_destructive_oi_relu)
shared_ptr
<
runtime
::
Executable
>
handle
=
backend
->
compile
(
f
);
handle
->
call_with_validate
({
result
},
{
a
,
b
,
c
});
ASSERT_NE
(
handle
,
nullptr
);
EXPECT_EQ
(
read_vector
<
float
>
(
result
),
expected
);
}
...
...
@@ -802,6 +803,7 @@ TEST(cpu_test, memory_reuse_cacheable_no_destructive_oi_relu)
vector
<
float
>
expected
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
shared_ptr
<
runtime
::
Executable
>
handle
=
backend
->
compile
(
f
);
ASSERT_NE
(
handle
,
nullptr
);
handle
->
call_with_validate
({
result
},
{
a
,
b
,
c
});
EXPECT_EQ
(
read_vector
<
float
>
(
result
),
expected
);
...
...
@@ -864,6 +866,7 @@ TEST(cpu_test, memory_reuse_in_place_slice_after_in_place_concat)
auto
result
=
backend
->
create_tensor
(
element
::
f32
,
shape_r
);
shared_ptr
<
runtime
::
Executable
>
handle
=
backend
->
compile
(
f
);
ASSERT_NE
(
handle
,
nullptr
);
handle
->
call_with_validate
({
result
},
{
a
,
b
,
c
,
d
});
EXPECT_EQ
((
vector
<
float
>
{
3
,
7
}),
read_vector
<
float
>
(
result
));
}
...
...
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