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
057ffb90
"git@developer.sourcefind.cn:modelzoo/resnet50_tensorflow.git" did not exist on "e6f465eb90cb3e7f6e7d1aa608f2d34b66025a3b"
Commit
057ffb90
authored
Sep 15, 2022
by
Po-Yen, Chen
Browse files
Unify naming style in 'DevicePermute'
parent
ee40f5a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
35 deletions
+35
-35
include/ck/tensor_operation/gpu/device/device_permute.hpp
include/ck/tensor_operation/gpu/device/device_permute.hpp
+4
-4
include/ck/tensor_operation/gpu/device/impl/device_permute_impl.hpp
.../tensor_operation/gpu/device/impl/device_permute_impl.hpp
+31
-31
No files found.
include/ck/tensor_operation/gpu/device/device_permute.hpp
View file @
057ffb90
...
...
@@ -21,10 +21,10 @@ struct DevicePermute : BaseOperator
using
Strides
=
Lengths
;
virtual
std
::
unique_ptr
<
BaseArgument
>
MakeArgumentPointer
(
const
Lengths
&
in
L
engths
,
const
Strides
&
in
S
trides
,
const
Lengths
&
out
L
engths
,
const
Strides
&
out
S
trides
,
MakeArgumentPointer
(
const
Lengths
&
in
_l
engths
,
const
Strides
&
in
_s
trides
,
const
Lengths
&
out
_l
engths
,
const
Strides
&
out
_s
trides
,
const
void
*
in_dev_buffer
,
void
*
out_dev_buffer
,
ElementwiseOperation
elementwise_op
)
=
0
;
...
...
include/ck/tensor_operation/gpu/device/impl/device_permute_impl.hpp
View file @
057ffb90
...
...
@@ -60,7 +60,7 @@ struct DevicePermuteImpl : DevicePermute<NumDim, InDataType, OutDataType, Elemen
return
generate_tuple
([
&
](
auto
I
)
{
return
array
[
I
];
},
Number
<
N
>
{});
}
static
auto
MakeDescriptor_N_H_W
(
const
Lengths
&
lengths
,
const
Strides
stride
)
static
auto
MakeDescriptor_N_H_W
(
const
Lengths
&
lengths
,
const
Strides
&
stride
)
{
// create nd descriptor, shape: [d[0], d[1], d[2], ..., d[NumDim-3], d[NumDim-2],
// d[NumDim-1]]
...
...
@@ -111,21 +111,21 @@ struct DevicePermuteImpl : DevicePermute<NumDim, InDataType, OutDataType, Elemen
struct
Argument
:
public
BaseArgument
{
Argument
(
const
Lengths
&
in
L
engths
,
const
Strides
&
in
S
trides
,
const
Lengths
&
out
L
engths
,
const
Strides
&
out
S
trides
,
Argument
(
const
Lengths
&
in
_l
engths
,
const
Strides
&
in
_s
trides
,
const
Lengths
&
out
_l
engths
,
const
Strides
&
out
_s
trides
,
const
void
*
in_dev_buffer
,
void
*
out_dev_buffer
,
ElementwiseOperation
elementwise_op
)
:
in_dev_buffer_
(
static_cast
<
const
InDataType
*>
(
in_dev_buffer
)),
out_dev_buffer_
(
static_cast
<
OutDataType
*>
(
out_dev_buffer
)),
in_grid_desc_
(
MakeDescriptor_N_H_W
(
in
L
engths
,
in
S
trides
)),
out_grid_desc_
(
MakeDescriptor_N_H_W
(
out
L
engths
,
out
S
trides
)),
in
L
engths_
(
in
L
engths
),
in
S
trides_
(
in
S
trides
),
out
L
engths_
(
out
L
engths
),
out
S
trides_
(
out
S
trides
),
in_grid_desc_
(
MakeDescriptor_N_H_W
(
in
_l
engths
,
in
_s
trides
)),
out_grid_desc_
(
MakeDescriptor_N_H_W
(
out
_l
engths
,
out
_s
trides
)),
in
_l
engths_
(
in
_l
engths
),
in
_s
trides_
(
in
_s
trides
),
out
_l
engths_
(
out
_l
engths
),
out
_s
trides_
(
out
_s
trides
),
elementwise_op_
(
elementwise_op
),
block_2_tile_map_
(
GridwisePermute
::
MakeDefaultBlock2TileMap
(
in_grid_desc_
))
{
...
...
@@ -136,10 +136,10 @@ struct DevicePermuteImpl : DevicePermute<NumDim, InDataType, OutDataType, Elemen
InGridDesc
in_grid_desc_
;
OutGridDesc
out_grid_desc_
;
Lengths
in
L
engths_
;
Strides
in
S
trides_
;
Lengths
out
L
engths_
;
Strides
out
S
trides_
;
Lengths
in
_l
engths_
;
Strides
in
_s
trides_
;
Lengths
out
_l
engths_
;
Strides
out
_s
trides_
;
ElementwiseOperation
elementwise_op_
;
...
...
@@ -195,21 +195,21 @@ struct DevicePermuteImpl : DevicePermute<NumDim, InDataType, OutDataType, Elemen
return
false
;
};
return
IsScalarPerVectorValid
(
arg
.
in
L
engths_
[
SrcVectorDim
],
arg
.
in
S
trides_
[
SrcVectorDim
],
return
IsScalarPerVectorValid
(
arg
.
in
_l
engths_
[
SrcVectorDim
],
arg
.
in
_s
trides_
[
SrcVectorDim
],
SrcScalarPerVector
)
&&
IsScalarPerVectorValid
(
GetPaddedLength
(
arg
.
in
L
engths_
[
SrcVectorDim
],
GetPaddedLength
(
arg
.
in
_l
engths_
[
SrcVectorDim
],
(
SrcVectorDim
==
NumDim
-
2
?
HPerBlock
:
WPerBlock
)),
arg
.
in
S
trides_
[
SrcVectorDim
],
arg
.
in
_s
trides_
[
SrcVectorDim
],
SrcScalarPerVector
)
&&
IsScalarPerVectorValid
(
arg
.
out
L
engths_
[
DstVectorDim
],
arg
.
out
S
trides_
[
DstVectorDim
],
IsScalarPerVectorValid
(
arg
.
out
_l
engths_
[
DstVectorDim
],
arg
.
out
_s
trides_
[
DstVectorDim
],
DstScalarPerVector
)
&&
IsScalarPerVectorValid
(
GetPaddedLength
(
arg
.
out
L
engths_
[
DstVectorDim
],
GetPaddedLength
(
arg
.
out
_l
engths_
[
DstVectorDim
],
(
DstVectorDim
==
NumDim
-
2
?
HPerBlock
:
WPerBlock
)),
arg
.
in
S
trides_
[
DstVectorDim
],
arg
.
in
_s
trides_
[
DstVectorDim
],
DstScalarPerVector
)
&&
GridwisePermute
::
CheckValidity
(
arg
.
in_grid_desc_
,
arg
.
out_grid_desc_
);
};
...
...
@@ -228,18 +228,18 @@ struct DevicePermuteImpl : DevicePermute<NumDim, InDataType, OutDataType, Elemen
// override methods inherited from 'DevicePermute'
std
::
unique_ptr
<
BaseArgument
>
MakeArgumentPointer
(
const
Lengths
&
in
L
engths
,
const
Strides
&
in
S
trides
,
const
Lengths
&
out
L
engths
,
const
Strides
&
out
S
trides
,
MakeArgumentPointer
(
const
Lengths
&
in
_l
engths
,
const
Strides
&
in
_s
trides
,
const
Lengths
&
out
_l
engths
,
const
Strides
&
out
_s
trides
,
const
void
*
in_dev_buffer
,
void
*
out_dev_buffer
,
ElementwiseOperation
elementwise_op
)
override
final
{
return
std
::
make_unique
<
Argument
>
(
in
L
engths
,
in
S
trides
,
out
L
engths
,
out
S
trides
,
return
std
::
make_unique
<
Argument
>
(
in
_l
engths
,
in
_s
trides
,
out
_l
engths
,
out
_s
trides
,
in_dev_buffer
,
out_dev_buffer
,
elementwise_op
);
...
...
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