Commit 51b2b081 authored by Po-Yen, Chen's avatar Po-Yen, Chen
Browse files

Rename 'GridwiseCopy' as 'GridwisePermute'

parent e2bfa9bb
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "ck/utility/sequence.hpp" #include "ck/utility/sequence.hpp"
#include "ck/tensor_operation/gpu/device/device_base.hpp" #include "ck/tensor_operation/gpu/device/device_base.hpp"
#include "ck/tensor_operation/gpu/device/matrix_padder.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/tensor_description/tensor_descriptor_helper.hpp"
#include "ck/host_utility/kernel_launch.hpp" #include "ck/host_utility/kernel_launch.hpp"
...@@ -140,18 +140,18 @@ struct DevicePermute : detail::DevicePermuteBase<DevicePermute<InDataType, ...@@ -140,18 +140,18 @@ struct DevicePermute : detail::DevicePermuteBase<DevicePermute<InDataType,
using InGrid1dDesc = decltype(MakeDescriptor_N_H_W({1, 1}, {1, 1})); using InGrid1dDesc = decltype(MakeDescriptor_N_H_W({1, 1}, {1, 1}));
using OutGrid1dDesc = decltype(MakeDescriptor_N_H_W({1, 1}, {1, 1})); using OutGrid1dDesc = decltype(MakeDescriptor_N_H_W({1, 1}, {1, 1}));
using GridwiseCopy = GridwiseCopy<InGrid1dDesc, using GridwisePermute = GridwisePermute<InGrid1dDesc,
OutGrid1dDesc, OutGrid1dDesc,
InDataTypePointer, InDataTypePointer,
OutDataTypePointer, OutDataTypePointer,
ElementwiseOperation, ElementwiseOperation,
BlockSize, BlockSize,
NPerBlock, NPerBlock,
HPerBlock, HPerBlock,
WPerBlock, WPerBlock,
MPerThread, MPerThread,
InScalarPerVector, InScalarPerVector,
OutScalarPerVector>; OutScalarPerVector>;
struct Argument : public BaseArgument struct Argument : public BaseArgument
{ {
...@@ -171,7 +171,7 @@ struct DevicePermute : detail::DevicePermuteBase<DevicePermute<InDataType, ...@@ -171,7 +171,7 @@ struct DevicePermute : detail::DevicePermuteBase<DevicePermute<InDataType,
outLengths_(outLengths), outLengths_(outLengths),
outStrides_(outStrides), outStrides_(outStrides),
elementwise_op_(elementwise_op), elementwise_op_(elementwise_op),
block_2_tile_map_(GridwiseCopy::MakeDefaultBlock2TileMap(in_grid_1d_desc_)) block_2_tile_map_(GridwisePermute::MakeDefaultBlock2TileMap(in_grid_1d_desc_))
{ {
} }
...@@ -187,7 +187,7 @@ struct DevicePermute : detail::DevicePermuteBase<DevicePermute<InDataType, ...@@ -187,7 +187,7 @@ struct DevicePermute : detail::DevicePermuteBase<DevicePermute<InDataType,
ElementwiseOperation elementwise_op_; ElementwiseOperation elementwise_op_;
typename GridwiseCopy::DefaultBlock2TileMap block_2_tile_map_; typename GridwisePermute::DefaultBlock2TileMap block_2_tile_map_;
}; };
struct Invoker : detail::InvokerBase<Invoker, Argument> struct Invoker : detail::InvokerBase<Invoker, Argument>
...@@ -196,13 +196,13 @@ struct DevicePermute : detail::DevicePermuteBase<DevicePermute<InDataType, ...@@ -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 index_t grid_size = arg.block_2_tile_map_.CalculateGridSize(arg.in_grid_1d_desc_);
const auto kernel = kernel_nd_copy<GridwiseCopy, const auto kernel = kernel_nd_permute<GridwisePermute,
InGrid1dDesc, InGrid1dDesc,
OutGrid1dDesc, OutGrid1dDesc,
InDataTypePointer, InDataTypePointer,
OutDataTypePointer, OutDataTypePointer,
ElementwiseOperation, ElementwiseOperation,
typename GridwiseCopy::DefaultBlock2TileMap>; typename GridwisePermute::DefaultBlock2TileMap>;
float elapsed_time = launch_and_time_kernel(stream_config, float elapsed_time = launch_and_time_kernel(stream_config,
kernel, kernel,
......
...@@ -89,29 +89,29 @@ struct Block2TileMap ...@@ -89,29 +89,29 @@ struct Block2TileMap
}; };
} // namespace detail } // namespace detail
template <typename GridwiseCopy, template <typename GridwisePermute,
typename InGrid1dDesc, typename InGrid1dDesc,
typename OutGrid1dDesc, typename OutGrid1dDesc,
typename InDataTypePointer, typename InDataTypePointer,
typename OutDataTypePointer, typename OutDataTypePointer,
typename ElementwiseOperation, typename ElementwiseOperation,
typename Block2TileMap> typename Block2TileMap>
__global__ void kernel_nd_copy(const InGrid1dDesc in_grid_1d_desc, __global__ void kernel_nd_permute(const InGrid1dDesc in_grid_1d_desc,
const OutGrid1dDesc out_grid_1d_desc, const OutGrid1dDesc out_grid_1d_desc,
const InDataTypePointer p_in_global, const InDataTypePointer p_in_global,
const OutDataTypePointer p_out_global, const OutDataTypePointer p_out_global,
const ElementwiseOperation elementwise_op, const ElementwiseOperation elementwise_op,
const Block2TileMap block_2_tile_map) const Block2TileMap block_2_tile_map)
{ {
__shared__ char p_shared[GridwiseCopy::GetSharedMemoryNumberOfByte()]; __shared__ char p_shared[GridwisePermute::GetSharedMemoryNumberOfByte()];
GridwiseCopy::Run(in_grid_1d_desc, GridwisePermute::Run(in_grid_1d_desc,
out_grid_1d_desc, out_grid_1d_desc,
p_in_global, p_in_global,
p_out_global, p_out_global,
p_shared, p_shared,
elementwise_op, elementwise_op,
block_2_tile_map); block_2_tile_map);
} }
template <typename InGrid1dDesc, template <typename InGrid1dDesc,
...@@ -126,7 +126,7 @@ template <typename InGrid1dDesc, ...@@ -126,7 +126,7 @@ template <typename InGrid1dDesc,
index_t MPerThread, index_t MPerThread,
index_t InScalarPerVector, index_t InScalarPerVector,
index_t OutScalarPerVector> index_t OutScalarPerVector>
struct GridwiseCopy struct GridwisePermute
{ {
static_assert(InGrid1dDesc::GetNumOfDimension() == 3 && static_assert(InGrid1dDesc::GetNumOfDimension() == 3 &&
OutGrid1dDesc::GetNumOfDimension() == 3); OutGrid1dDesc::GetNumOfDimension() == 3);
...@@ -300,7 +300,7 @@ struct GridwiseCopy ...@@ -300,7 +300,7 @@ struct GridwiseCopy
decltype(in_grid_1d_desc_tranformed), decltype(in_grid_1d_desc_tranformed),
Sequence<0, 1, 2>, // ABlockTransferSrcAccessOrder Sequence<0, 1, 2>, // ABlockTransferSrcAccessOrder
Sequence<0, 1, 2>, // ABlockTransferDstAccessOrder Sequence<0, 1, 2>, // ABlockTransferDstAccessOrder
2, // ABlockTransferSrcVectorDim 1, // ABlockTransferSrcVectorDim
1, // ABlockTransferDstVectorDim 1, // ABlockTransferDstVectorDim
1, // ABlockTransferSrcScalarPerVector 1, // ABlockTransferSrcScalarPerVector
1, // ABlockTransferDstScalarPerVector 1, // ABlockTransferDstScalarPerVector
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment