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
aa9863b6
Commit
aa9863b6
authored
Jun 19, 2019
by
Paul
Browse files
Remove unused concat code
parent
bd2f3f8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
58 deletions
+0
-58
src/targets/gpu/device/concat.cpp
src/targets/gpu/device/concat.cpp
+0
-58
No files found.
src/targets/gpu/device/concat.cpp
View file @
aa9863b6
...
@@ -9,41 +9,6 @@ inline namespace MIGRAPHX_INLINE_NS {
...
@@ -9,41 +9,6 @@ inline namespace MIGRAPHX_INLINE_NS {
namespace
gpu
{
namespace
gpu
{
namespace
device
{
namespace
device
{
#if 0
argument concat(hipStream_t stream,
const migraphx::shape&,
std::vector<migraphx::argument> args_vec,
std::vector<std::size_t> offsets_vec)
{
static constexpr const std::size_t limit = 6;
if(offsets_vec.size() > limit)
MIGRAPHX_THROW("Too many arguments to concat");
std::size_t nelements =
std::max_element(args_vec.begin(),
std::prev(args_vec.end()),
by(std::less<>{}, [&](auto&& x) { return x.get_shape().elements(); }))
->get_shape()
.elements();
auto offsets = to_hip_vector<limit>(offsets_vec);
hip_visit_all<limit + 1>(args_vec)([&](auto args) {
auto output = args.back();
auto ninputs = args.size() - 1;
gs_launch(stream, nelements)([=](auto i) {
for(std::size_t j = 0; j < ninputs; j++)
{
auto&& arg = args[j];
if(i >= arg.size())
continue;
auto idx = output.get_shape().index(arg.get_shape().multi(i));
output.data()[idx + offsets[j]] = arg.data()[i];
}
});
});
return args_vec.back();
}
#else
argument
concat
(
hipStream_t
stream
,
argument
concat
(
hipStream_t
stream
,
const
migraphx
::
shape
&
,
const
migraphx
::
shape
&
,
std
::
vector
<
migraphx
::
argument
>
args
,
std
::
vector
<
migraphx
::
argument
>
args
,
...
@@ -65,29 +30,6 @@ argument concat(hipStream_t stream,
...
@@ -65,29 +30,6 @@ argument concat(hipStream_t stream,
return
args
.
back
();
return
args
.
back
();
}
}
// argument concat(hipStream_t stream,
// const migraphx::shape& output_shape,
// std::vector<migraphx::argument> args,
// std::vector<std::size_t> offsets)
// {
// for(std::size_t l = 0; l < args.size() - 1; l++)
// {
// auto argl = args[l];
// std::size_t nelements = argl.get_shape().elements();
// visit_all(args.back(), argl)([&](auto output, auto input) {
// visit_tensor_size(output_shape.lens().size(), [&](auto ndim) {
// auto* outptr = output.data() + offsets[l];
// const auto* inptr = input.data();
// hip_tensor_descriptor<ndim> desc_input(input.get_shape());
// hip_tensor_descriptor<ndim> desc_output(output.get_shape());
// gs_launch(stream, nelements)(
// [=](auto i) { outptr[desc_output.linear(desc_input.multi(i))] = inptr[i]; });
// });
// });
// }
// return args.back();
// }
#endif
}
// namespace device
}
// namespace device
}
// namespace gpu
}
// namespace gpu
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace MIGRAPHX_INLINE_NS
...
...
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