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
ee119d9e
Commit
ee119d9e
authored
Sep 14, 2022
by
Po-Yen, Chen
Browse files
Use existing method to shorten code
parent
9e03c383
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
example/37_permute/run_permute_bundle_example.inc
example/37_permute/run_permute_bundle_example.inc
+2
-2
example/37_permute/run_permute_element_example.inc
example/37_permute/run_permute_element_example.inc
+3
-3
No files found.
example/37_permute/run_permute_bundle_example.inc
View file @
ee119d9e
...
...
@@ -36,9 +36,9 @@ bool run_permute_bundle(const Problem& problem)
void
*
output
=
b_device_buf
.
GetDeviceBuffer
();
std
::
copy
(
begin
(
shape
),
end
(
shape
),
begin
(
a_lengths
));
std
::
copy
(
begin
(
a
.
mDesc
.
GetStrides
()),
end
(
a
.
mDesc
.
GetStrides
()),
begin
(
a_strides
));
std
::
copy
(
begin
(
a
.
GetStrides
()),
end
(
a
.
GetStrides
()),
begin
(
a_strides
));
std
::
copy
(
begin
(
transposed_shape
),
end
(
transposed_shape
),
begin
(
b_lengths
));
std
::
copy
(
begin
(
b
.
mDesc
.
GetStrides
()),
end
(
b
.
mDesc
.
GetStrides
()),
begin
(
b_strides
));
std
::
copy
(
begin
(
b
.
GetStrides
()),
end
(
b
.
GetStrides
()),
begin
(
b_strides
));
static_assert
(
std
::
is_default_constructible_v
<
DevicePermuteInstance
>
);
...
...
example/37_permute/run_permute_element_example.inc
View file @
ee119d9e
...
...
@@ -14,7 +14,7 @@ bool run_permute_element(const Problem& problem)
Tensor
<
ADataType
>
a
(
shape
);
Tensor
<
BDataType
>
b
(
transposed_shape
);
ck
::
utils
::
FillUniformDistribution
<
ADataType
>
{
-
1.
f
,
1.
f
}(
begin
(
a
.
mData
),
end
(
a
.
mData
));
ck
::
utils
::
FillUniformDistribution
<
ADataType
>
{
-
1.
f
,
1.
f
}(
begin
(
a
),
end
(
a
));
DeviceMem
a_device_buf
(
a
.
GetElementSpaceSizeInBytes
());
DeviceMem
b_device_buf
(
b
.
GetElementSpaceSizeInBytes
());
...
...
@@ -29,9 +29,9 @@ bool run_permute_element(const Problem& problem)
void
*
output
=
b_device_buf
.
GetDeviceBuffer
();
std
::
copy
(
begin
(
shape
),
end
(
shape
),
begin
(
a_lengths
));
std
::
copy
(
begin
(
a
.
mDesc
.
GetStrides
()),
end
(
a
.
mDesc
.
GetStrides
()),
begin
(
a_strides
));
std
::
copy
(
begin
(
a
.
GetStrides
()),
end
(
a
.
GetStrides
()),
begin
(
a_strides
));
std
::
copy
(
begin
(
transposed_shape
),
end
(
transposed_shape
),
begin
(
b_lengths
));
std
::
copy
(
begin
(
b
.
mDesc
.
GetStrides
()),
end
(
b
.
mDesc
.
GetStrides
()),
begin
(
b_strides
));
std
::
copy
(
begin
(
b
.
GetStrides
()),
end
(
b
.
GetStrides
()),
begin
(
b_strides
));
static_assert
(
std
::
is_default_constructible_v
<
DevicePermuteInstance
>
);
...
...
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