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
composable_kernel
Commits
5a19b884
"tests/vscode:/vscode.git/clone" did not exist on "7bc0a07b1947bcbe0e84bbe9ecf8ae2d234382c4"
Commit
5a19b884
authored
Sep 14, 2022
by
Po-Yen, Chen
Browse files
Remove redudant variables
parent
2ac1a6b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
13 deletions
+7
-13
example/37_permute/run_permute_bundle_example.inc
example/37_permute/run_permute_bundle_example.inc
+5
-8
example/37_permute/run_permute_element_example.inc
example/37_permute/run_permute_element_example.inc
+2
-5
No files found.
example/37_permute/run_permute_bundle_example.inc
View file @
5a19b884
...
...
@@ -24,9 +24,6 @@ bool run_permute_bundle(const Problem& problem)
using
std
::
data
;
input_device_buf
.
ToDevice
(
data
(
input_bundle_tensor
));
const
void
*
input_bundle_data
=
input_device_buf
.
GetDeviceBuffer
();
void
*
output_bundle_data
=
output_device_buf
.
GetDeviceBuffer
();
static_assert
(
std
::
is_default_constructible_v
<
DevicePermuteInstance
>
);
auto
permute
=
DevicePermuteInstance
{};
...
...
@@ -34,8 +31,8 @@ bool run_permute_bundle(const Problem& problem)
to_array
(
input_bundle_tensor
.
GetStrides
()),
to_array
(
output_bundle_shape
),
to_array
(
output_bundle_tensor
.
GetStrides
()),
input_
bundle_data
,
output_
bundle_data
,
input_
device_buf
.
GetDeviceBuffer
()
,
output_
device_buf
.
GetDeviceBuffer
()
,
PassThrough
{});
if
(
!
permute
.
IsSupportedArgument
(
argument
))
...
...
@@ -57,10 +54,10 @@ bool run_permute_bundle(const Problem& problem)
const
auto
input_shape
=
extend_shape
(
input_bundle_shape
,
NumElemsInBundle
);
const
auto
input_axes
=
extend_axes
(
input_bundle_axes
);
using
std
::
begin
;
Tensor
<
DataType
>
input_tensor
(
input_shape
);
std
::
memcpy
(
data
(
input_tensor
),
data
(
input_bundle_tensor
),
input_bundle_tensor
.
GetElementSpaceSizeInBytes
());
ranges
::
copy
(
input_bundle_tensor
.
AsSpan
<
const
DataType
>
(),
begin
(
input_tensor
));
Tensor
<
DataType
>
output_tensor
(
transpose
(
input_shape
,
input_axes
));
if
(
!
host_permute
(
input_tensor
,
input_axes
,
PassThrough
{},
output_tensor
))
...
...
example/37_permute/run_permute_element_example.inc
View file @
5a19b884
...
...
@@ -21,9 +21,6 @@ bool run_permute_element(const Problem& problem)
using
std
::
data
;
input_device_buf
.
ToDevice
(
data
(
input_tensor
));
const
void
*
input_data
=
input_device_buf
.
GetDeviceBuffer
();
void
*
output_data
=
output_device_buf
.
GetDeviceBuffer
();
static_assert
(
std
::
is_default_constructible_v
<
DevicePermuteInstance
>
);
auto
permute
=
DevicePermuteInstance
{};
...
...
@@ -31,8 +28,8 @@ bool run_permute_element(const Problem& problem)
to_array
(
input_tensor
.
GetStrides
()),
to_array
(
output_shape
),
to_array
(
output_tensor
.
GetStrides
()),
input_d
ata
,
output_d
ata
,
input_d
evice_buf
.
GetDeviceBuffer
()
,
output_d
evice_buf
.
GetDeviceBuffer
()
,
PassThrough
{});
if
(
!
permute
.
IsSupportedArgument
(
argument
))
...
...
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