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
6ea3abe0
"git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "92a3ae1bcbad99042e7d32a6461095a5d6d1b646"
Commit
6ea3abe0
authored
Apr 18, 2019
by
Shucai Xiao
Browse files
simplify code according to comments.
parent
711356dc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
33 deletions
+15
-33
src/targets/gpu/CMakeLists.txt
src/targets/gpu/CMakeLists.txt
+0
-1
src/targets/gpu/convert.cpp
src/targets/gpu/convert.cpp
+0
-23
src/targets/gpu/device/convert.cpp
src/targets/gpu/device/convert.cpp
+1
-3
src/targets/gpu/include/migraphx/gpu/convert.hpp
src/targets/gpu/include/migraphx/gpu/convert.hpp
+13
-5
src/targets/gpu/include/migraphx/gpu/device/convert.hpp
src/targets/gpu/include/migraphx/gpu/device/convert.hpp
+1
-1
No files found.
src/targets/gpu/CMakeLists.txt
View file @
6ea3abe0
...
@@ -51,7 +51,6 @@ add_library(migraphx_gpu
...
@@ -51,7 +51,6 @@ add_library(migraphx_gpu
convolution.cpp
convolution.cpp
softmax.cpp
softmax.cpp
logsoftmax.cpp
logsoftmax.cpp
convert.cpp
contiguous.cpp
contiguous.cpp
concat.cpp
concat.cpp
relu.cpp
relu.cpp
...
...
src/targets/gpu/convert.cpp
deleted
100644 → 0
View file @
711356dc
#include <migraphx/gpu/convert.hpp>
#include <migraphx/gpu/device/convert.hpp>
#include <migraphx/gpu/context.hpp>
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
gpu
{
shape
hip_convert
::
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
inputs
.
pop_back
();
check_shapes
{
inputs
}.
packed
();
return
op
.
compute_shape
(
inputs
);
}
argument
hip_convert
::
compute
(
context
&
ctx
,
const
shape
&
,
const
std
::
vector
<
argument
>&
args
)
const
{
return
device
::
convert
(
ctx
.
get_stream
().
get
(),
args
[
1
],
args
[
0
]);
}
}
// namespace gpu
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace migraphx
src/targets/gpu/device/convert.cpp
View file @
6ea3abe0
...
@@ -6,7 +6,7 @@ inline namespace MIGRAPHX_INLINE_NS {
...
@@ -6,7 +6,7 @@ inline namespace MIGRAPHX_INLINE_NS {
namespace
gpu
{
namespace
gpu
{
namespace
device
{
namespace
device
{
argument
convert
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
arg
)
void
convert
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
arg
)
{
{
result
.
visit
([
&
](
auto
output
)
{
result
.
visit
([
&
](
auto
output
)
{
arg
.
visit
([
&
](
auto
input
)
{
arg
.
visit
([
&
](
auto
input
)
{
...
@@ -16,8 +16,6 @@ argument convert(hipStream_t stream, const argument& result, const argument& arg
...
@@ -16,8 +16,6 @@ argument convert(hipStream_t stream, const argument& result, const argument& arg
result
.
get_shape
().
elements
())([
=
](
auto
i
)
{
output_ptr
[
i
]
=
input_ptr
[
i
];
});
result
.
get_shape
().
elements
())([
=
](
auto
i
)
{
output_ptr
[
i
]
=
input_ptr
[
i
];
});
});
});
});
});
return
result
;
}
}
}
// namespace device
}
// namespace device
...
...
src/targets/gpu/include/migraphx/gpu/convert.hpp
View file @
6ea3abe0
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
#include <migraphx/shape.hpp>
#include <migraphx/shape.hpp>
#include <migraphx/op/convert.hpp>
#include <migraphx/op/convert.hpp>
#include <migraphx/gpu/oper.hpp>
#include <migraphx/gpu/device/convert.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
inline
namespace
MIGRAPHX_INLINE_NS
{
...
@@ -10,13 +12,19 @@ namespace gpu {
...
@@ -10,13 +12,19 @@ namespace gpu {
struct
context
;
struct
context
;
struct
hip_convert
struct
hip_convert
:
unary_device
<
hip_convert
,
device
::
convert
>
{
{
op
::
convert
op
;
op
::
convert
op
;
std
::
string
name
()
const
{
return
"gpu::convert"
;
}
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
;
hip_convert
(
const
op
::
convert
&
oper
)
:
op
(
oper
)
{
}
argument
compute
(
context
&
ctx
,
const
shape
&
,
const
std
::
vector
<
argument
>&
args
)
const
;
hip_convert
(
const
op
::
convert
&&
oper
)
:
op
(
std
::
move
(
oper
))
{
}
int
output_alias
(
const
std
::
vector
<
shape
>&
shapes
)
const
{
return
shapes
.
size
()
-
1
;
}
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
inputs
.
pop_back
();
check_shapes
{
inputs
}.
packed
();
return
op
.
compute_shape
(
inputs
);
}
};
};
}
// namespace gpu
}
// namespace gpu
...
...
src/targets/gpu/include/migraphx/gpu/device/convert.hpp
View file @
6ea3abe0
...
@@ -11,7 +11,7 @@ inline namespace MIGRAPHX_INLINE_NS {
...
@@ -11,7 +11,7 @@ inline namespace MIGRAPHX_INLINE_NS {
namespace
gpu
{
namespace
gpu
{
namespace
device
{
namespace
device
{
argument
convert
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
arg
);
void
convert
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
arg
);
}
// namespace device
}
// namespace device
}
// namespace gpu
}
// namespace gpu
...
...
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