device_reduce_threadwise.hpp Source File#
device_reduce_threadwise.hpp
Go to the documentation of this file.
float launch_and_time_kernel(const StreamConfig &stream_config, F kernel, dim3 grid_dim, dim3 block_dim, std::size_t lds_byte, Args... args)
Definition host_utility/kernel_launch.hpp:14
__host__ __device__ constexpr auto integer_least_multiple(X x, Y y)
Definition utility/math.hpp:78
Definition convolution_backward_data_specialization.hpp:8
std::pair< long_index_t, long_index_t > get_2d_lengths(const std::vector< index_t > &inLengths)
Definition device_reduce_common.hpp:20
std::vector< index_t > shuffle_tensor_dimensions(const std::vector< index_t > &origLengthsStrides, const std::vector< int > &reduceDims)
Definition device_reduce_common.hpp:75
Definition convolution_backward_data_specialization.hpp:7
Definition ck.hpp:268
__host__ __device__ constexpr auto make_naive_tensor_descriptor(const Tuple< Lengths... > &lengths, const Tuple< Strides... > &strides)
Definition tensor_descriptor_helper.hpp:49
__host__ __device__ constexpr auto make_right_pad_transform(const LowLength &low_length, const RightPadLength &right_pad, integral_constant< bool, SkipIsValidCheck >=integral_constant< bool, false >{})
Definition multi_index_transform_helper.hpp:37
__global__ void kernel_reduce_threadwise(const InGridDesc_M_K in_grid_desc_m_k, const OutGridDesc_M out_grid_desc_m, const InElementwiseOperation in_elementwise_op, const AccElementwiseOperation acc_elementwise_op, AccDataType alpha, const InDataType *const __restrict__ p_in_value_global, const IndexDataType *const __restrict__ p_in_index_global, AccDataType beta, OutDataType *const __restrict__ p_out_value_global, IndexDataType *const __restrict__ p_out_index_global)
Definition gridwise_2d_reduction_threadwise.hpp:28
__host__ __device__ constexpr auto make_merge_transform(const LowLengths &low_lengths)
Definition multi_index_transform_helper.hpp:55
__host__ __device__ constexpr Y type_convert(X x)
Definition utility/type_convert.hpp:98
__host__ __device__ constexpr auto generate_tuple(F &&f, Number< N >)
Definition tuple_helper.hpp:21
__host__ __device__ constexpr auto make_tuple(Xs &&... xs)
Definition utility/tuple.hpp:211
__host__ __device__ constexpr auto transform_tensor_descriptor(const OldTensorDescriptor &old_tensor_desc, const NewTransforms &new_transforms, NewLowerDimensionOldVisibleIdss, NewUpperDimensionNewVisibleIdss)
Definition tensor_description/tensor_descriptor.hpp:319
__host__ __device__ constexpr auto make_unmerge_transform(const UpLengths &up_lengths, integral_constant< bool, Use24BitIntegerCalculation >=integral_constant< bool, false >{})
Definition multi_index_transform_helper.hpp:90
Definition ck/stream_config.hpp:10
Definition gridwise_2d_reduction_threadwise.hpp:84
Definition utility/sequence.hpp:43
typename conditional< kHasContent, type0, type1 >::type type
Definition utility/sequence.hpp:271
Definition device_base.hpp:197
BaseArgument()=default
BaseInvoker()=default
Definition device_reduce.hpp:27
Definition device_reduce_threadwise.hpp:162
std::array< index_t, Rank > inLengths_
Definition device_reduce_threadwise.hpp:205
std::array< index_t, NumDstDim > outStrides_
Definition device_reduce_threadwise.hpp:208
InElementwiseOperation in_elementwise_op_
Definition device_reduce_threadwise.hpp:217
int numBlockTileIteration
Definition device_reduce_threadwise.hpp:225
IndexDataType * out_index_dev_
Definition device_reduce_threadwise.hpp:215
index_t invariant_lowest_length
Definition device_reduce_threadwise.hpp:220
OutDataType * out_dev_
Definition device_reduce_threadwise.hpp:214
AccDataType alpha_
Definition device_reduce_threadwise.hpp:210
size_t gridSize
Definition device_reduce_threadwise.hpp:226
AccDataType beta_
Definition device_reduce_threadwise.hpp:211
AccElementwiseOperation acc_elementwise_op_
Definition device_reduce_threadwise.hpp:218
std::array< index_t, Rank > inStrides_
Definition device_reduce_threadwise.hpp:206
std::array< index_t, NumDstDim > outLengths_
Definition device_reduce_threadwise.hpp:207
index_t reduce_lowest_length
Definition device_reduce_threadwise.hpp:221
long_index_t invariant_total_length
Definition device_reduce_threadwise.hpp:222
long_index_t reduce_total_length
Definition device_reduce_threadwise.hpp:223
Argument(const std::array< index_t, Rank > inLengths, const std::array< index_t, Rank > inStrides, const std::array< index_t, NumDstDim > outLengths, const std::array< index_t, NumDstDim > outStrides, const std::array< int, NumReduceDim > reduceDims, double alpha, double beta, const InDataType *in_dev, OutDataType *out_dev, IndexDataType *out_index_dev, const InElementwiseOperation in_elementwise_op, const AccElementwiseOperation acc_elementwise_op)
Definition device_reduce_threadwise.hpp:163
const InDataType * in_dev_
Definition device_reduce_threadwise.hpp:213
Definition device_reduce_threadwise.hpp:230
float Run(const BaseArgument *p_arg, const StreamConfig &stream_config=StreamConfig{}) override
Definition device_reduce_threadwise.hpp:293
float Run(const Argument &arg, const StreamConfig &stream_config=StreamConfig{})
Definition device_reduce_threadwise.hpp:231
Definition device_reduce_threadwise.hpp:49
static constexpr index_t NumSrcDim
Definition device_reduce_threadwise.hpp:63
std::unique_ptr< BaseArgument > MakeArgumentPointer(const std::array< index_t, Rank > inLengths, const std::array< index_t, Rank > inStrides, const std::array< index_t, NumDstDim > outLengths, const std::array< index_t, NumDstDim > outStrides, const std::array< int, NumReduceDim > reduceDims, double alpha, double beta, const void *in_dev, const void *in_index_dev, void *out_dev, void *out_index_dev, const InElementwiseOperation in_elementwise_op, const AccElementwiseOperation acc_elementwise_op) override
Definition device_reduce_threadwise.hpp:340
int32_t IndexDataType
Definition device_reduce_threadwise.hpp:57
static constexpr index_t NumDstDim
Definition device_reduce_threadwise.hpp:64
bool IsSupportedArgument(const BaseArgument *p_arg) override
Definition device_reduce_threadwise.hpp:300
std::string GetTypeString() const override
Definition device_reduce_threadwise.hpp:375
static constexpr index_t NumInvariantDim
Definition device_reduce_threadwise.hpp:61
static constexpr index_t M_BlockTileSize
Definition device_reduce_threadwise.hpp:67
static constexpr bool reduceAllDim
Definition device_reduce_threadwise.hpp:65
static constexpr bool HaveIndexInput
Definition device_reduce_threadwise.hpp:59
static constexpr index_t K_BlockTileSize
Definition device_reduce_threadwise.hpp:68
std::unique_ptr< BaseInvoker > MakeInvokerPointer() override
Definition device_reduce_threadwise.hpp:370
static auto MakeSrc2dDescriptor(const std::array< index_t, Rank > &inLengths, const std::array< index_t, Rank > &inStrides)
Definition device_reduce_threadwise.hpp:70
static auto MakeDst1dDescriptor(const std::array< index_t, NumDstDim > &outLengths, const std::array< index_t, NumDstDim > &outStrides)
Definition device_reduce_threadwise.hpp:132