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
51b2b081
Commit
51b2b081
authored
Sep 08, 2022
by
Po-Yen, Chen
Browse files
Rename 'GridwiseCopy' as 'GridwisePermute'
parent
e2bfa9bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
40 deletions
+40
-40
include/ck/tensor_operation/gpu/device/device_permute.hpp
include/ck/tensor_operation/gpu/device/device_permute.hpp
+22
-22
include/ck/tensor_operation/gpu/grid/gridwise_permute.hpp
include/ck/tensor_operation/gpu/grid/gridwise_permute.hpp
+18
-18
No files found.
include/ck/tensor_operation/gpu/device/device_permute.hpp
View file @
51b2b081
...
...
@@ -11,7 +11,7 @@
#include "ck/utility/sequence.hpp"
#include "ck/tensor_operation/gpu/device/device_base.hpp"
#include "ck/tensor_operation/gpu/device/matrix_padder.hpp"
#include "ck/tensor_operation/gpu/grid/gridwise_
copy
.hpp"
#include "ck/tensor_operation/gpu/grid/gridwise_
permute
.hpp"
#include "ck/tensor_description/tensor_descriptor_helper.hpp"
#include "ck/host_utility/kernel_launch.hpp"
...
...
@@ -140,18 +140,18 @@ struct DevicePermute : detail::DevicePermuteBase<DevicePermute<InDataType,
using
InGrid1dDesc
=
decltype
(
MakeDescriptor_N_H_W
({
1
,
1
},
{
1
,
1
}));
using
OutGrid1dDesc
=
decltype
(
MakeDescriptor_N_H_W
({
1
,
1
},
{
1
,
1
}));
using
Gridwise
Copy
=
Gridwise
Copy
<
InGrid1dDesc
,
OutGrid1dDesc
,
InDataTypePointer
,
OutDataTypePointer
,
ElementwiseOperation
,
BlockSize
,
NPerBlock
,
HPerBlock
,
WPerBlock
,
MPerThread
,
InScalarPerVector
,
OutScalarPerVector
>
;
using
Gridwise
Permute
=
Gridwise
Permute
<
InGrid1dDesc
,
OutGrid1dDesc
,
InDataTypePointer
,
OutDataTypePointer
,
ElementwiseOperation
,
BlockSize
,
NPerBlock
,
HPerBlock
,
WPerBlock
,
MPerThread
,
InScalarPerVector
,
OutScalarPerVector
>
;
struct
Argument
:
public
BaseArgument
{
...
...
@@ -171,7 +171,7 @@ struct DevicePermute : detail::DevicePermuteBase<DevicePermute<InDataType,
outLengths_
(
outLengths
),
outStrides_
(
outStrides
),
elementwise_op_
(
elementwise_op
),
block_2_tile_map_
(
Gridwise
Copy
::
MakeDefaultBlock2TileMap
(
in_grid_1d_desc_
))
block_2_tile_map_
(
Gridwise
Permute
::
MakeDefaultBlock2TileMap
(
in_grid_1d_desc_
))
{
}
...
...
@@ -187,7 +187,7 @@ struct DevicePermute : detail::DevicePermuteBase<DevicePermute<InDataType,
ElementwiseOperation
elementwise_op_
;
typename
Gridwise
Copy
::
DefaultBlock2TileMap
block_2_tile_map_
;
typename
Gridwise
Permute
::
DefaultBlock2TileMap
block_2_tile_map_
;
};
struct
Invoker
:
detail
::
InvokerBase
<
Invoker
,
Argument
>
...
...
@@ -196,13 +196,13 @@ struct DevicePermute : detail::DevicePermuteBase<DevicePermute<InDataType,
{
const
index_t
grid_size
=
arg
.
block_2_tile_map_
.
CalculateGridSize
(
arg
.
in_grid_1d_desc_
);
const
auto
kernel
=
kernel_nd_
copy
<
Gridwise
Copy
,
InGrid1dDesc
,
OutGrid1dDesc
,
InDataTypePointer
,
OutDataTypePointer
,
ElementwiseOperation
,
typename
Gridwise
Copy
::
DefaultBlock2TileMap
>
;
const
auto
kernel
=
kernel_nd_
permute
<
Gridwise
Permute
,
InGrid1dDesc
,
OutGrid1dDesc
,
InDataTypePointer
,
OutDataTypePointer
,
ElementwiseOperation
,
typename
Gridwise
Permute
::
DefaultBlock2TileMap
>
;
float
elapsed_time
=
launch_and_time_kernel
(
stream_config
,
kernel
,
...
...
include/ck/tensor_operation/gpu/grid/gridwise_
copy
.hpp
→
include/ck/tensor_operation/gpu/grid/gridwise_
permute
.hpp
View file @
51b2b081
...
...
@@ -89,29 +89,29 @@ struct Block2TileMap
};
}
// namespace detail
template
<
typename
Gridwise
Copy
,
template
<
typename
Gridwise
Permute
,
typename
InGrid1dDesc
,
typename
OutGrid1dDesc
,
typename
InDataTypePointer
,
typename
OutDataTypePointer
,
typename
ElementwiseOperation
,
typename
Block2TileMap
>
__global__
void
kernel_nd_
copy
(
const
InGrid1dDesc
in_grid_1d_desc
,
const
OutGrid1dDesc
out_grid_1d_desc
,
const
InDataTypePointer
p_in_global
,
const
OutDataTypePointer
p_out_global
,
const
ElementwiseOperation
elementwise_op
,
const
Block2TileMap
block_2_tile_map
)
__global__
void
kernel_nd_
permute
(
const
InGrid1dDesc
in_grid_1d_desc
,
const
OutGrid1dDesc
out_grid_1d_desc
,
const
InDataTypePointer
p_in_global
,
const
OutDataTypePointer
p_out_global
,
const
ElementwiseOperation
elementwise_op
,
const
Block2TileMap
block_2_tile_map
)
{
__shared__
char
p_shared
[
Gridwise
Copy
::
GetSharedMemoryNumberOfByte
()];
Gridwise
Copy
::
Run
(
in_grid_1d_desc
,
out_grid_1d_desc
,
p_in_global
,
p_out_global
,
p_shared
,
elementwise_op
,
block_2_tile_map
);
__shared__
char
p_shared
[
Gridwise
Permute
::
GetSharedMemoryNumberOfByte
()];
Gridwise
Permute
::
Run
(
in_grid_1d_desc
,
out_grid_1d_desc
,
p_in_global
,
p_out_global
,
p_shared
,
elementwise_op
,
block_2_tile_map
);
}
template
<
typename
InGrid1dDesc
,
...
...
@@ -126,7 +126,7 @@ template <typename InGrid1dDesc,
index_t
MPerThread
,
index_t
InScalarPerVector
,
index_t
OutScalarPerVector
>
struct
Gridwise
Copy
struct
Gridwise
Permute
{
static_assert
(
InGrid1dDesc
::
GetNumOfDimension
()
==
3
&&
OutGrid1dDesc
::
GetNumOfDimension
()
==
3
);
...
...
@@ -300,7 +300,7 @@ struct GridwiseCopy
decltype
(
in_grid_1d_desc_tranformed
),
Sequence
<
0
,
1
,
2
>
,
// ABlockTransferSrcAccessOrder
Sequence
<
0
,
1
,
2
>
,
// ABlockTransferDstAccessOrder
2
,
// ABlockTransferSrcVectorDim
1
,
// ABlockTransferSrcVectorDim
1
,
// ABlockTransferDstVectorDim
1
,
// ABlockTransferSrcScalarPerVector
1
,
// ABlockTransferDstScalarPerVector
...
...
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