Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
29ee8a8e
Commit
29ee8a8e
authored
Apr 21, 2021
by
Paul
Browse files
Update cppcheck settings and rules
parent
28f5f835
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
3 deletions
+33
-3
CMakeLists.txt
CMakeLists.txt
+5
-1
cppcheck.rules
cppcheck.rules
+28
-1
src/py/migraphx_py.cpp
src/py/migraphx_py.cpp
+0
-1
No files found.
CMakeLists.txt
View file @
29ee8a8e
...
@@ -185,6 +185,8 @@ rocm_enable_cppcheck(
...
@@ -185,6 +185,8 @@ rocm_enable_cppcheck(
shadowVariable
shadowVariable
unsafeClassDivZero
unsafeClassDivZero
definePrefix:*test/include/test.hpp
definePrefix:*test/include/test.hpp
useSmartPointer:*src/api/api.cpp
useSmartPointer:*make_shared_array.hpp
FORCE
FORCE
INCONCLUSIVE
INCONCLUSIVE
RULE_FILE
RULE_FILE
...
@@ -195,7 +197,9 @@ rocm_enable_cppcheck(
...
@@ -195,7 +197,9 @@ rocm_enable_cppcheck(
INCLUDE
INCLUDE
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/include
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/include
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/targets/cpu/include
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/targets/cpu/include
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/targets/miopen/include
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/targets/gpu/include
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/targets/gpu/device/include
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/targets/gpu/kernels/include
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/include
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/include
DEFINE
DEFINE
CPPCHECK=1
CPPCHECK=1
...
...
cppcheck.rules
View file @
29ee8a8e
...
@@ -91,13 +91,40 @@
...
@@ -91,13 +91,40 @@
</rule>
</rule>
<rule>
<rule>
<tokenlist>
normal
</tokenlist>
<tokenlist>
normal
</tokenlist>
<pattern>
\\W(fclose|free|hipFree|hipHostFree|hipFreeArray|hipMemFree|hipStreamDestroy|hipEventDestroy|hipArrayDestroy|hipCtxDestroy|hipDestroyTextureObject|hipDestroySurfaceObject) \(
</pattern>
<pattern>
\\W(fclose|free|hipFree|hipHostFree|hipFreeArray|hipMemFree|hipStreamDestroy|hipEventDestroy|hipArrayDestroy|hipCtxDestroy|hipDestroyTextureObject|hipDestroySurfaceObject
|miirDestroyHandle
) \(
</pattern>
<message>
<message>
<id>
useManagePointer
</id>
<id>
useManagePointer
</id>
<severity>
style
</severity>
<severity>
style
</severity>
<summary>
Use manage pointer for resource management
</summary>
<summary>
Use manage pointer for resource management
</summary>
</message>
</message>
</rule>
</rule>
<rule>
<tokenlist>
normal
</tokenlist>
<pattern>
<![CDATA[new \w+]]>
</pattern>
<message>
<id>
useSmartPointer
</id>
<severity>
style
</severity>
<summary>
Use make_shared or make_unique instead of new
</summary>
</message>
</rule>
<!-- <rule>
<tokenlist>raw</tokenlist>
<pattern><![CDATA[ \|\| ]]></pattern>
<message>
<id>UseNamedLogicOperator</id>
<severity>style</severity>
<summary>Use 'or' instead of ||</summary>
</message>
</rule>
<rule>
<tokenlist>raw</tokenlist>
<pattern><![CDATA[ ! ]]></pattern>
<message>
<id>UseNamedLogicOperator</id>
<severity>style</severity>
<summary>Use 'not' instead of !</summary>
</message>
</rule> -->
<!-- <rule>
<!-- <rule>
<tokenlist>raw</tokenlist>
<tokenlist>raw</tokenlist>
<pattern><![CDATA[] (__device__ |__host__ )+(\(|{)]]></pattern>
<pattern><![CDATA[] (__device__ |__host__ )+(\(|{)]]></pattern>
...
...
src/py/migraphx_py.cpp
100644 → 100755
View file @
29ee8a8e
...
@@ -254,7 +254,6 @@ MIGRAPHX_PYBIND11_MODULE(migraphx, m)
...
@@ -254,7 +254,6 @@ MIGRAPHX_PYBIND11_MODULE(migraphx, m)
.
def
(
"__repr__"
,
[](
const
migraphx
::
module
&
mm
)
{
return
migraphx
::
to_string
(
mm
);
});
.
def
(
"__repr__"
,
[](
const
migraphx
::
module
&
mm
)
{
return
migraphx
::
to_string
(
mm
);
});
py
::
class_
<
migraphx
::
program
>
(
m
,
"program"
)
py
::
class_
<
migraphx
::
program
>
(
m
,
"program"
)
.
def
(
"clone"
,
[](
migraphx
::
program
&
p
)
{
return
*
(
new
migraphx
::
program
(
p
));
})
.
def
(
"get_parameter_names"
,
&
migraphx
::
program
::
get_parameter_names
)
.
def
(
"get_parameter_names"
,
&
migraphx
::
program
::
get_parameter_names
)
.
def
(
"get_parameter_shapes"
,
&
migraphx
::
program
::
get_parameter_shapes
)
.
def
(
"get_parameter_shapes"
,
&
migraphx
::
program
::
get_parameter_shapes
)
.
def
(
"get_output_shapes"
,
&
migraphx
::
program
::
get_output_shapes
)
.
def
(
"get_output_shapes"
,
&
migraphx
::
program
::
get_output_shapes
)
...
...
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