Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
946dc37a
"third_party/vscode:/vscode.git/clone" did not exist on "bc54ac8aa5e88bbbb32e948eccea6384b89c6768"
Commit
946dc37a
authored
Aug 21, 2018
by
Paul
Browse files
Fix clang tidy errors
parent
225c2d64
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
8 deletions
+11
-8
src/generate.cpp
src/generate.cpp
+1
-1
src/include/migraph/generate.hpp
src/include/migraph/generate.hpp
+1
-1
test/CMakeLists.txt
test/CMakeLists.txt
+4
-1
test/gpu/miopen.cpp
test/gpu/miopen.cpp
+3
-3
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+2
-2
No files found.
src/generate.cpp
View file @
946dc37a
...
@@ -27,7 +27,7 @@ literal generate_literal(shape s, unsigned long seed)
...
@@ -27,7 +27,7 @@ literal generate_literal(shape s, unsigned long seed)
// TODO: Move to literal.cpp
// TODO: Move to literal.cpp
literal
abs
(
literal
l
)
literal
abs
(
literal
l
)
{
{
return
transform
(
l
,
[](
auto
x
)
{
return
std
::
fabs
(
x
);
});
return
transform
(
std
::
move
(
l
)
,
[](
auto
x
)
{
return
std
::
fabs
(
x
);
});
}
}
}
// namespace migraph
}
// namespace migraph
src/include/migraph/generate.hpp
View file @
946dc37a
...
@@ -36,7 +36,7 @@ struct xorshf96_generator
...
@@ -36,7 +36,7 @@ struct xorshf96_generator
unsigned
long
seed
=
0
;
unsigned
long
seed
=
0
;
unsigned
long
x
=
123456789
;
unsigned
long
x
=
123456789
;
unsigned
long
y
=
362436069
;
unsigned
long
y
=
362436069
;
unsigned
long
z
=
521288629
^
seed
;
unsigned
long
z
=
521288629
ULL
^
seed
;
constexpr
T
operator
()()
noexcept
constexpr
T
operator
()()
noexcept
{
{
...
...
test/CMakeLists.txt
View file @
946dc37a
...
@@ -68,7 +68,6 @@ endfunction()
...
@@ -68,7 +68,6 @@ endfunction()
function
(
add_test_executable TEST_NAME
)
function
(
add_test_executable TEST_NAME
)
add_executable
(
${
TEST_NAME
}
EXCLUDE_FROM_ALL
${
ARGN
}
)
add_executable
(
${
TEST_NAME
}
EXCLUDE_FROM_ALL
${
ARGN
}
)
rocm_clang_tidy_check
(
${
TEST_NAME
}
)
target_link_libraries
(
${
TEST_NAME
}
${
CMAKE_THREAD_LIBS_INIT
}
)
target_link_libraries
(
${
TEST_NAME
}
${
CMAKE_THREAD_LIBS_INIT
}
)
# Cmake does not add flags correctly for gcc
# Cmake does not add flags correctly for gcc
if
(
CMAKE_CXX_COMPILER_ID MATCHES
"GNU"
)
if
(
CMAKE_CXX_COMPILER_ID MATCHES
"GNU"
)
...
@@ -93,6 +92,7 @@ file(GLOB TESTS *.cpp)
...
@@ -93,6 +92,7 @@ file(GLOB TESTS *.cpp)
foreach
(
TEST
${
TESTS
}
)
foreach
(
TEST
${
TESTS
}
)
get_filename_component
(
BASE_NAME
${
TEST
}
NAME_WE
)
get_filename_component
(
BASE_NAME
${
TEST
}
NAME_WE
)
add_test_executable
(
test_
${
BASE_NAME
}
${
TEST
}
)
add_test_executable
(
test_
${
BASE_NAME
}
${
TEST
}
)
rocm_clang_tidy_check
(
test_
${
BASE_NAME
}
)
endforeach
()
endforeach
()
if
(
MIGRAPH_ENABLE_GPU
)
if
(
MIGRAPH_ENABLE_GPU
)
...
@@ -102,12 +102,15 @@ if(MIGRAPH_ENABLE_GPU)
...
@@ -102,12 +102,15 @@ if(MIGRAPH_ENABLE_GPU)
foreach
(
TEST
${
GPU_TESTS
}
)
foreach
(
TEST
${
GPU_TESTS
}
)
get_filename_component
(
BASE_NAME
${
TEST
}
NAME_WE
)
get_filename_component
(
BASE_NAME
${
TEST
}
NAME_WE
)
add_test_executable
(
test_gpu_
${
BASE_NAME
}
${
TEST
}
)
add_test_executable
(
test_gpu_
${
BASE_NAME
}
${
TEST
}
)
rocm_clang_tidy_check
(
test_gpu_
${
BASE_NAME
}
)
set_tests_properties
(
test_gpu_
${
BASE_NAME
}
PROPERTIES COST 10
)
target_link_libraries
(
test_gpu_
${
BASE_NAME
}
migraph_gpu
)
target_link_libraries
(
test_gpu_
${
BASE_NAME
}
migraph_gpu
)
endforeach
()
endforeach
()
endif
()
endif
()
# Onnx test
# Onnx test
add_executable
(
test_onnx onnx/onnx_test.cpp
)
add_executable
(
test_onnx onnx/onnx_test.cpp
)
rocm_clang_tidy_check
(
test_onnx
)
target_link_libraries
(
test_onnx migraph_onnx
)
target_link_libraries
(
test_onnx migraph_onnx
)
target_include_directories
(
test_onnx PUBLIC include
)
target_include_directories
(
test_onnx PUBLIC include
)
add_test
(
NAME test_onnx COMMAND $<TARGET_FILE:test_onnx> WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
/onnx
)
add_test
(
NAME test_onnx COMMAND $<TARGET_FILE:test_onnx> WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
/onnx
)
...
...
test/gpu/miopen.cpp
View file @
946dc37a
...
@@ -37,7 +37,7 @@ std::future<typename std::result_of<Function()>::type> detach_async(Function&& f
...
@@ -37,7 +37,7 @@ std::future<typename std::result_of<Function()>::type> detach_async(Function&& f
}
}
else
else
{
{
return
std
::
async
(
std
::
launch
::
deferred
,
std
::
move
(
f
));
return
std
::
async
(
std
::
launch
::
deferred
,
std
::
forward
<
Function
>
(
f
));
}
}
}
}
...
@@ -58,12 +58,12 @@ struct auto_print
...
@@ -58,12 +58,12 @@ struct auto_print
};
};
std
::
array
<
std
::
function
<
void
()
>
,
2
>
auto_print
::
handlers
=
{};
std
::
array
<
std
::
function
<
void
()
>
,
2
>
auto_print
::
handlers
=
{};
void
compile_check
(
migraph
::
program
&
p
,
migraph
::
target
t
)
void
compile_check
(
migraph
::
program
&
p
,
const
migraph
::
target
&
t
)
{
{
auto
name
=
t
.
name
();
auto
name
=
t
.
name
();
auto
s
=
p
.
get_shape
();
auto
s
=
p
.
get_shape
();
std
::
stringstream
ss
;
std
::
stringstream
ss
;
p
.
compile
(
std
::
move
(
t
)
,
migraph
::
tracer
{
ss
});
p
.
compile
(
t
,
migraph
::
tracer
{
ss
});
if
(
p
.
get_shape
()
!=
s
)
if
(
p
.
get_shape
()
!=
s
)
{
{
std
::
cout
<<
ss
.
str
()
<<
std
::
endl
;
std
::
cout
<<
ss
.
str
()
<<
std
::
endl
;
...
...
test/onnx/onnx_test.cpp
View file @
946dc37a
...
@@ -61,7 +61,7 @@ void pytorch_conv_bn_relu_maxpool()
...
@@ -61,7 +61,7 @@ void pytorch_conv_bn_relu_maxpool()
EXPECT
(
p
==
prog
);
EXPECT
(
p
==
prog
);
}
}
void
pytorch_conv_relu_maxpool
X
2
()
void
pytorch_conv_relu_maxpool
_x
2
()
{
{
migraph
::
program
p
;
migraph
::
program
p
;
auto
l0
=
p
.
add_parameter
(
"0"
,
{
migraph
::
shape
::
float_type
,
{
1
,
3
,
32
,
32
}});
auto
l0
=
p
.
add_parameter
(
"0"
,
{
migraph
::
shape
::
float_type
,
{
1
,
3
,
32
,
32
}});
...
@@ -92,5 +92,5 @@ int main()
...
@@ -92,5 +92,5 @@ int main()
pytorch_conv_bias_test
();
pytorch_conv_bias_test
();
pytorch_conv_relu_maxpool
();
pytorch_conv_relu_maxpool
();
pytorch_conv_bn_relu_maxpool
();
pytorch_conv_bn_relu_maxpool
();
pytorch_conv_relu_maxpool
X
2
();
pytorch_conv_relu_maxpool
_x
2
();
}
}
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