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
79415315
Unverified
Commit
79415315
authored
May 01, 2019
by
Scott Cyphers
Committed by
GitHub
May 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Klocwork issues. (#2847)
* Klocwork issues. * Revert to dynamic_pointer_cast
parent
6562c902
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
18 deletions
+21
-18
pass.hpp
src/ngraph/pass/pass.hpp
+1
-1
cpu_call_frame.hpp
src/ngraph/runtime/cpu/cpu_call_frame.hpp
+1
-1
cpu_fusion.cpp
src/ngraph/runtime/cpu/pass/cpu_fusion.cpp
+2
-1
cpio.cpp
test/cpio.cpp
+17
-15
No files found.
src/ngraph/pass/pass.hpp
View file @
79415315
...
@@ -73,7 +73,7 @@ protected:
...
@@ -73,7 +73,7 @@ protected:
private
:
private
:
PassPropertyMask
m_property
;
PassPropertyMask
m_property
;
ManagerState
*
m_state
;
ManagerState
*
m_state
{
0
}
;
};
};
class
ngraph
::
pass
::
ModulePass
:
public
PassBase
class
ngraph
::
pass
::
ModulePass
:
public
PassBase
...
...
src/ngraph/runtime/cpu/cpu_call_frame.hpp
View file @
79415315
...
@@ -89,7 +89,7 @@ namespace ngraph
...
@@ -89,7 +89,7 @@ namespace ngraph
std
::
mutex
m_mutex
;
std
::
mutex
m_mutex
;
std
::
condition_variable
m_cv
;
std
::
condition_variable
m_cv
;
size_t
m_num_ctx_available
=
0
;
volatile
size_t
m_num_ctx_available
=
0
;
size_t
m_prev_ctx
=
0
;
size_t
m_prev_ctx
=
0
;
size_t
m_num_ctx
=
1
;
size_t
m_num_ctx
=
1
;
std
::
unordered_map
<
size_t
,
bool
>
m_id_pool
;
std
::
unordered_map
<
size_t
,
bool
>
m_id_pool
;
...
...
src/ngraph/runtime/cpu/pass/cpu_fusion.cpp
View file @
79415315
...
@@ -1867,7 +1867,8 @@ void ngraph::runtime::cpu::pass::CPUFusion::construct_deconvolution_affine_foldi
...
@@ -1867,7 +1867,8 @@ void ngraph::runtime::cpu::pass::CPUFusion::construct_deconvolution_affine_foldi
<<
m
.
get_match_root
()
->
get_name
();
<<
m
.
get_match_root
()
->
get_name
();
auto
pattern_map
=
m
.
get_pattern_map
();
auto
pattern_map
=
m
.
get_pattern_map
();
auto
m_bn
=
std
::
dynamic_pointer_cast
<
op
::
BatchNormInference
>
(
m
.
get_match_root
());
// Matcher guarantees this is the right type
auto
m_bn
=
std
::
static_pointer_cast
<
op
::
BatchNormInference
>
(
m
.
get_match_root
());
auto
conv_m
=
auto
conv_m
=
std
::
static_pointer_cast
<
op
::
ConvolutionBackpropData
>
(
pattern_map
[
conv_label
]);
std
::
static_pointer_cast
<
op
::
ConvolutionBackpropData
>
(
pattern_map
[
conv_label
]);
...
...
test/cpio.cpp
View file @
79415315
...
@@ -14,6 +14,8 @@
...
@@ -14,6 +14,8 @@
// limitations under the License.
// limitations under the License.
//*****************************************************************************
//*****************************************************************************
#include <memory>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include "ngraph/cpio.hpp"
#include "ngraph/cpio.hpp"
...
@@ -40,25 +42,25 @@ TEST(cpio, read)
...
@@ -40,25 +42,25 @@ TEST(cpio, read)
{
{
int
index
=
0
;
int
index
=
0
;
char
*
data
=
static_cast
<
char
*>
(
malloc
(
file_info
[
index
].
get_size
())
);
auto
data
=
unique_ptr
<
char
>
(
new
char
[
file_info
[
index
].
get_size
()]
);
reader
.
read
(
file_info
[
index
].
get_name
(),
data
,
file_info
[
index
].
get_size
());
reader
.
read
(
file_info
[
index
].
get_name
(),
data
.
get
()
,
file_info
[
index
].
get_size
());
string
content
=
string
(
data
,
file_info
[
index
].
get_size
());
string
content
=
string
(
data
.
get
()
,
file_info
[
index
].
get_size
());
EXPECT_STREQ
(
content
.
c_str
(),
"12345"
);
EXPECT_STREQ
(
content
.
c_str
(),
"12345"
);
}
}
{
{
int
index
=
1
;
int
index
=
1
;
char
*
data
=
static_cast
<
char
*>
(
malloc
(
file_info
[
index
].
get_size
())
);
auto
data
=
unique_ptr
<
char
>
(
new
char
[
file_info
[
index
].
get_size
()]
);
reader
.
read
(
file_info
[
index
].
get_name
(),
data
,
file_info
[
index
].
get_size
());
reader
.
read
(
file_info
[
index
].
get_name
(),
data
.
get
()
,
file_info
[
index
].
get_size
());
string
content
=
string
(
data
,
file_info
[
index
].
get_size
());
string
content
=
string
(
data
.
get
()
,
file_info
[
index
].
get_size
());
EXPECT_STREQ
(
content
.
c_str
(),
"this is a test"
);
EXPECT_STREQ
(
content
.
c_str
(),
"this is a test"
);
}
}
{
{
int
index
=
2
;
int
index
=
2
;
char
*
data
=
static_cast
<
char
*>
(
malloc
(
file_info
[
index
].
get_size
())
);
auto
data
=
unique_ptr
<
char
>
(
new
char
[
file_info
[
index
].
get_size
()]
);
reader
.
read
(
file_info
[
index
].
get_name
(),
data
,
file_info
[
index
].
get_size
());
reader
.
read
(
file_info
[
index
].
get_name
(),
data
.
get
()
,
file_info
[
index
].
get_size
());
string
content
=
string
(
data
,
file_info
[
index
].
get_size
());
string
content
=
string
(
data
.
get
()
,
file_info
[
index
].
get_size
());
EXPECT_STREQ
(
content
.
c_str
(),
"the quick brown fox jumped over the lazy dog"
);
EXPECT_STREQ
(
content
.
c_str
(),
"the quick brown fox jumped over the lazy dog"
);
}
}
}
}
...
@@ -90,17 +92,17 @@ TEST(cpio, write)
...
@@ -90,17 +92,17 @@ TEST(cpio, write)
{
{
int
index
=
0
;
int
index
=
0
;
char
*
data
=
static_cast
<
char
*>
(
malloc
(
file_info
[
index
].
get_size
())
);
auto
data
=
unique_ptr
<
char
>
(
new
char
[
file_info
[
index
].
get_size
()]
);
reader
.
read
(
file_info
[
index
].
get_name
(),
data
,
file_info
[
index
].
get_size
());
reader
.
read
(
file_info
[
index
].
get_name
(),
data
.
get
()
,
file_info
[
index
].
get_size
());
string
content
=
string
(
data
,
file_info
[
index
].
get_size
());
string
content
=
string
(
data
.
get
()
,
file_info
[
index
].
get_size
());
EXPECT_STREQ
(
content
.
c_str
(),
s1
.
c_str
());
EXPECT_STREQ
(
content
.
c_str
(),
s1
.
c_str
());
}
}
{
{
int
index
=
1
;
int
index
=
1
;
char
*
data
=
static_cast
<
char
*>
(
malloc
(
file_info
[
index
].
get_size
())
);
auto
data
=
unique_ptr
<
char
>
(
new
char
[
file_info
[
index
].
get_size
()]
);
reader
.
read
(
file_info
[
index
].
get_name
(),
data
,
file_info
[
index
].
get_size
());
reader
.
read
(
file_info
[
index
].
get_name
(),
data
.
get
()
,
file_info
[
index
].
get_size
());
string
content
=
string
(
data
,
file_info
[
index
].
get_size
());
string
content
=
string
(
data
.
get
()
,
file_info
[
index
].
get_size
());
EXPECT_STREQ
(
content
.
c_str
(),
s2
.
c_str
());
EXPECT_STREQ
(
content
.
c_str
(),
s2
.
c_str
());
}
}
}
}
...
...
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