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
18781f56
Commit
18781f56
authored
Sep 06, 2022
by
Po-Yen, Chen
Browse files
Remove 'elementwise' from identifiers
parent
9c5dd6bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
11 deletions
+8
-11
example/36_elementwise_permute/common.hpp
example/36_elementwise_permute/common.hpp
+1
-4
example/36_elementwise_permute/elementwise_permute_fp16.cpp
example/36_elementwise_permute/elementwise_permute_fp16.cpp
+2
-2
example/36_elementwise_permute/run_elementwise_permute_example.inc
...6_elementwise_permute/run_elementwise_permute_example.inc
+5
-5
No files found.
example/36_elementwise_permute/common.hpp
View file @
18781f56
...
@@ -353,10 +353,7 @@ std::enable_if_t<detail::is_random_access_range_v<Axes> && detail::is_sized_rang
...
@@ -353,10 +353,7 @@ std::enable_if_t<detail::is_random_access_range_v<Axes> && detail::is_sized_rang
std
::
add_lvalue_reference_t
<
Dest
>
,
std
::
add_lvalue_reference_t
<
Dest
>
,
std
::
add_lvalue_reference_t
<
Src
>>
,
std
::
add_lvalue_reference_t
<
Src
>>
,
bool
>
bool
>
host_elementwise_permute
(
const
Tensor
<
Src
>&
src
,
host_permute
(
const
Tensor
<
Src
>&
src
,
const
Axes
&
axes
,
Functor
functor
,
Tensor
<
Dest
>&
dest
)
const
Axes
&
axes
,
Functor
functor
,
Tensor
<
Dest
>&
dest
)
{
{
const
auto
&
shape
=
src
.
mDesc
.
GetLengths
();
const
auto
&
shape
=
src
.
mDesc
.
GetLengths
();
const
auto
&
transposed_shape
=
dest
.
mDesc
.
GetLengths
();
const
auto
&
transposed_shape
=
dest
.
mDesc
.
GetLengths
();
...
...
example/36_elementwise_permute/elementwise_permute_fp16.cpp
View file @
18781f56
...
@@ -6,9 +6,9 @@
...
@@ -6,9 +6,9 @@
using
ADataType
=
F16
;
using
ADataType
=
F16
;
using
BDataType
=
F16
;
using
BDataType
=
F16
;
using
Device
Elementwise
PermuteInstance
=
ck
::
tensor_operation
::
device
::
using
DevicePermuteInstance
=
ck
::
tensor_operation
::
device
::
DevicePermute
<
ck
::
Tuple
<
ADataType
>
,
ck
::
Tuple
<
BDataType
>
,
PassThrough
,
4
,
8
,
S
<
8
>
,
S
<
1
>>
;
DevicePermute
<
ck
::
Tuple
<
ADataType
>
,
ck
::
Tuple
<
BDataType
>
,
PassThrough
,
4
,
8
,
S
<
8
>
,
S
<
1
>>
;
#include "run_elementwise_permute_example.inc"
#include "run_elementwise_permute_example.inc"
int
main
(
int
argc
,
char
*
argv
[])
{
return
!
run_
elementwise_
permute_example
(
argc
,
argv
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
return
!
run_permute_example
(
argc
,
argv
);
}
example/36_elementwise_permute/run_elementwise_permute_example.inc
View file @
18781f56
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
#pragma once
#pragma once
bool
run_
elementwise_
permute
(
const
ExecutionConfig
&
config
,
const
Problem
&
problem
)
bool
run_permute
(
const
ExecutionConfig
&
config
,
const
Problem
&
problem
)
{
{
using
std
::
begin
,
std
::
end
;
using
std
::
begin
,
std
::
end
;
...
@@ -31,7 +31,7 @@ bool run_elementwise_permute(const ExecutionConfig& config, const Problem& probl
...
@@ -31,7 +31,7 @@ bool run_elementwise_permute(const ExecutionConfig& config, const Problem& probl
std
::
copy
(
begin
(
a
.
mDesc
.
GetStrides
()),
end
(
a
.
mDesc
.
GetStrides
()),
begin
(
a_strides
));
std
::
copy
(
begin
(
a
.
mDesc
.
GetStrides
()),
end
(
a
.
mDesc
.
GetStrides
()),
begin
(
a_strides
));
std
::
copy
(
begin
(
b
.
mDesc
.
GetStrides
()),
end
(
b
.
mDesc
.
GetStrides
()),
begin
(
b_strides
));
std
::
copy
(
begin
(
b
.
mDesc
.
GetStrides
()),
end
(
b
.
mDesc
.
GetStrides
()),
begin
(
b_strides
));
auto
permute
=
Device
Elementwise
PermuteInstance
{};
auto
permute
=
DevicePermuteInstance
{};
auto
argument
=
auto
argument
=
permute
.
MakeArgument
(
ab_lengths
,
{
a_strides
},
{
b_strides
},
input
,
output
,
PassThrough
{});
permute
.
MakeArgument
(
ab_lengths
,
{
a_strides
},
{
b_strides
},
input
,
output
,
PassThrough
{});
...
@@ -50,7 +50,7 @@ bool run_elementwise_permute(const ExecutionConfig& config, const Problem& probl
...
@@ -50,7 +50,7 @@ bool run_elementwise_permute(const ExecutionConfig& config, const Problem& probl
if
(
config
.
do_verification
)
if
(
config
.
do_verification
)
{
{
Tensor
<
BDataType
>
host_b
(
transposed_shape
);
Tensor
<
BDataType
>
host_b
(
transposed_shape
);
host_
elementwise_
permute
(
a
,
problem
.
axes
,
PassThrough
{},
host_b
);
host_permute
(
a
,
problem
.
axes
,
PassThrough
{},
host_b
);
b_device_buf
.
FromDevice
(
b
.
mData
.
data
());
b_device_buf
.
FromDevice
(
b
.
mData
.
data
());
...
@@ -61,10 +61,10 @@ bool run_elementwise_permute(const ExecutionConfig& config, const Problem& probl
...
@@ -61,10 +61,10 @@ bool run_elementwise_permute(const ExecutionConfig& config, const Problem& probl
return
true
;
return
true
;
}
}
bool
run_
elementwise_
permute_example
(
int
argc
,
char
*
argv
[])
bool
run_permute_example
(
int
argc
,
char
*
argv
[])
{
{
ExecutionConfig
config
;
ExecutionConfig
config
;
Problem
problem
;
Problem
problem
;
return
parse_cmd_args
(
argc
,
argv
,
config
,
problem
)
&&
run_
elementwise_
permute
(
config
,
problem
);
return
parse_cmd_args
(
argc
,
argv
,
config
,
problem
)
&&
run_permute
(
config
,
problem
);
}
}
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