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
394a7495
Unverified
Commit
394a7495
authored
Oct 29, 2018
by
Paul Fultz II
Committed by
GitHub
Oct 29, 2018
Browse files
Merge branch 'master' into renameGemmToDot
parents
a3057ebf
30371001
Changes
29
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
19 additions
and
11 deletions
+19
-11
src/targets/gpu/include/migraph/gpu/rocblas.hpp
src/targets/gpu/include/migraph/gpu/rocblas.hpp
+1
-0
src/targets/gpu/leaky_relu.cpp
src/targets/gpu/leaky_relu.cpp
+1
-1
src/targets/gpu/pooling.cpp
src/targets/gpu/pooling.cpp
+1
-1
src/targets/gpu/relu.cpp
src/targets/gpu/relu.cpp
+1
-1
src/targets/gpu/rocblas.cpp
src/targets/gpu/rocblas.cpp
+7
-0
src/targets/gpu/softmax.cpp
src/targets/gpu/softmax.cpp
+1
-1
src/targets/gpu/target.cpp
src/targets/gpu/target.cpp
+1
-5
test/CMakeLists.txt
test/CMakeLists.txt
+5
-2
test/gpu/miopen.cpp
test/gpu/miopen.cpp
+1
-0
No files found.
src/targets/gpu/include/migraph/gpu/rocblas.hpp
View file @
394a7495
...
@@ -11,6 +11,7 @@ namespace gpu {
...
@@ -11,6 +11,7 @@ namespace gpu {
using
rocblas_handle_ptr
=
MIGRAPH_MANAGE_PTR
(
rocblas_handle
,
rocblas_destroy_handle
);
using
rocblas_handle_ptr
=
MIGRAPH_MANAGE_PTR
(
rocblas_handle
,
rocblas_destroy_handle
);
rocblas_handle_ptr
create_rocblas_handle_ptr
();
rocblas_handle_ptr
create_rocblas_handle_ptr
();
rocblas_handle_ptr
create_rocblas_handle_ptr
(
hipStream_t
s
);
}
// namespace gpu
}
// namespace gpu
...
...
src/targets/gpu/leaky_relu.cpp
View file @
394a7495
...
@@ -20,7 +20,7 @@ argument miopen_leaky_relu::compute(context& ctx,
...
@@ -20,7 +20,7 @@ argument miopen_leaky_relu::compute(context& ctx,
float
alpha
=
1
,
beta
=
0
;
float
alpha
=
1
,
beta
=
0
;
auto
x_desc
=
make_tensor
(
args
[
0
].
get_shape
());
auto
x_desc
=
make_tensor
(
args
[
0
].
get_shape
());
auto
y_desc
=
make_tensor
(
output_shape
);
auto
y_desc
=
make_tensor
(
output_shape
);
miopenActivationForward
(
ctx
.
handle
.
get
(),
miopenActivationForward
(
ctx
.
get_stream
().
get_miopen
(),
ad
.
get
(),
ad
.
get
(),
&
alpha
,
&
alpha
,
x_desc
.
get
(),
x_desc
.
get
(),
...
...
src/targets/gpu/pooling.cpp
View file @
394a7495
...
@@ -21,7 +21,7 @@ argument miopen_pooling::compute(context& ctx,
...
@@ -21,7 +21,7 @@ argument miopen_pooling::compute(context& ctx,
float
alpha
=
1
,
beta
=
0
;
float
alpha
=
1
,
beta
=
0
;
miopenPoolingForward
(
ctx
.
handle
.
get
(),
miopenPoolingForward
(
ctx
.
get_stream
().
get_miopen
(),
pd
.
get
(),
pd
.
get
(),
&
alpha
,
&
alpha
,
x_desc
.
get
(),
x_desc
.
get
(),
...
...
src/targets/gpu/relu.cpp
View file @
394a7495
...
@@ -20,7 +20,7 @@ argument miopen_relu::compute(context& ctx,
...
@@ -20,7 +20,7 @@ argument miopen_relu::compute(context& ctx,
float
alpha
=
1
,
beta
=
0
;
float
alpha
=
1
,
beta
=
0
;
auto
x_desc
=
make_tensor
(
args
[
0
].
get_shape
());
auto
x_desc
=
make_tensor
(
args
[
0
].
get_shape
());
auto
y_desc
=
make_tensor
(
output_shape
);
auto
y_desc
=
make_tensor
(
output_shape
);
miopenActivationForward
(
ctx
.
handle
.
get
(),
miopenActivationForward
(
ctx
.
get_stream
().
get_miopen
(),
ad
.
get
(),
ad
.
get
(),
&
alpha
,
&
alpha
,
x_desc
.
get
(),
x_desc
.
get
(),
...
...
src/targets/gpu/rocblas.cpp
View file @
394a7495
...
@@ -10,6 +10,13 @@ rocblas_handle_ptr create_rocblas_handle_ptr()
...
@@ -10,6 +10,13 @@ rocblas_handle_ptr create_rocblas_handle_ptr()
return
rocblas_handle_ptr
{
handle
};
return
rocblas_handle_ptr
{
handle
};
}
}
rocblas_handle_ptr
create_rocblas_handle_ptr
(
hipStream_t
s
)
{
rocblas_handle_ptr
rb
=
create_rocblas_handle_ptr
();
rocblas_set_stream
(
rb
.
get
(),
s
);
return
rb
;
}
}
// namespace gpu
}
// namespace gpu
}
// namespace migraph
}
// namespace migraph
src/targets/gpu/softmax.cpp
View file @
394a7495
...
@@ -20,7 +20,7 @@ argument miopen_softmax::compute(context& ctx,
...
@@ -20,7 +20,7 @@ argument miopen_softmax::compute(context& ctx,
float
alpha
=
1
,
beta
=
0
;
float
alpha
=
1
,
beta
=
0
;
auto
x_desc
=
make_tensor
(
args
[
0
].
get_shape
());
auto
x_desc
=
make_tensor
(
args
[
0
].
get_shape
());
auto
y_desc
=
make_tensor
(
output_shape
);
auto
y_desc
=
make_tensor
(
output_shape
);
miopenSoftmaxForward
(
ctx
.
handle
.
get
(),
miopenSoftmaxForward
(
ctx
.
get_stream
().
get_miopen
(),
&
alpha
,
&
alpha
,
x_desc
.
get
(),
x_desc
.
get
(),
args
[
0
].
implicit
(),
args
[
0
].
implicit
(),
...
...
src/targets/gpu/target.cpp
View file @
394a7495
...
@@ -54,10 +54,6 @@ std::vector<pass> target::get_passes(migraph::context& gctx) const
...
@@ -54,10 +54,6 @@ std::vector<pass> target::get_passes(migraph::context& gctx) const
std
::
string
target
::
name
()
const
{
return
"miopen"
;
}
std
::
string
target
::
name
()
const
{
return
"miopen"
;
}
migraph
::
context
target
::
get_context
()
const
migraph
::
context
target
::
get_context
()
const
{
return
context
{};
}
{
return
context
{
share
(
make_obj
<
miopen_handle
>
(
&
miopenCreate
)),
share
(
create_rocblas_handle_ptr
()),
{}};
}
}
// namespace gpu
}
// namespace gpu
}
// namespace migraph
}
// namespace migraph
test/CMakeLists.txt
View file @
394a7495
...
@@ -7,7 +7,7 @@ find_package(Threads REQUIRED)
...
@@ -7,7 +7,7 @@ find_package(Threads REQUIRED)
include
(
ProcessorCount
)
include
(
ProcessorCount
)
ProcessorCount
(
N
)
ProcessorCount
(
N
)
set
(
CTEST_PARALLEL_LEVEL
${
N
}
CACHE STRING
"CTest parallel level"
)
set
(
CTEST_PARALLEL_LEVEL
${
N
}
CACHE STRING
"CTest parallel level"
)
add_custom_target
(
check COMMAND
${
CMAKE_CTEST_COMMAND
}
--output-on-failure -j
${
CTEST_PARALLEL_LEVEL
}
-C
${
CMAKE_CFG_INTDIR
}
)
add_custom_target
(
check COMMAND
${
CMAKE_CTEST_COMMAND
}
--output-on-failure -j
${
CTEST_PARALLEL_LEVEL
}
-C
${
CMAKE_CFG_INTDIR
}
--timeout 1500
)
add_custom_target
(
tests
)
add_custom_target
(
tests
)
find_program
(
MIGRAPH_GDB gdb
)
find_program
(
MIGRAPH_GDB gdb
)
...
@@ -103,7 +103,10 @@ if(MIGRAPH_ENABLE_GPU)
...
@@ -103,7 +103,10 @@ if(MIGRAPH_ENABLE_GPU)
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
}
)
rocm_clang_tidy_check
(
test_gpu_
${
BASE_NAME
}
)
set_tests_properties
(
test_gpu_
${
BASE_NAME
}
PROPERTIES COST 10
)
set_tests_properties
(
test_gpu_
${
BASE_NAME
}
PROPERTIES
COST 10
RESOURCE_LOCK gpu
)
target_link_libraries
(
test_gpu_
${
BASE_NAME
}
migraph_gpu
)
target_link_libraries
(
test_gpu_
${
BASE_NAME
}
migraph_gpu
)
endforeach
()
endforeach
()
endif
()
endif
()
...
...
test/gpu/miopen.cpp
View file @
394a7495
...
@@ -129,6 +129,7 @@ template <class V>
...
@@ -129,6 +129,7 @@ template <class V>
void
verify_program
()
void
verify_program
()
{
{
auto_print
::
set_terminate_handler
(
migraph
::
get_type_name
<
V
>
());
auto_print
::
set_terminate_handler
(
migraph
::
get_type_name
<
V
>
());
// std::cout << migraph::get_type_name<V>() << std::endl;
migraph
::
program
cpu_prog
;
migraph
::
program
cpu_prog
;
migraph
::
program
gpu_prog
;
migraph
::
program
gpu_prog
;
auto
cpu_arg_f
=
detach_async
([
&
]
{
return
run_cpu
<
V
>
(
cpu_prog
);
});
auto
cpu_arg_f
=
detach_async
([
&
]
{
return
run_cpu
<
V
>
(
cpu_prog
);
});
...
...
Prev
1
2
Next
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