"tutorials/vscode:/vscode.git/clone" did not exist on "322bd713e4b0ce90fae12292c90d45710af78515"
Commit 7a7497f9 authored by Qianfeng Zhang's avatar Qianfeng Zhang
Browse files

Remove constexpr from initialized zeroVal and tiny fix in reduction_operator.hpp

parent 4fea4251
...@@ -92,7 +92,7 @@ struct GridwiseReduction_xy_to_x_blockwise ...@@ -92,7 +92,7 @@ struct GridwiseReduction_xy_to_x_blockwise
// LDS // LDS
__shared__ compType p_in_block_buffer[BlockBufferSize]; __shared__ compType p_in_block_buffer[BlockBufferSize];
constexpr auto zeroVal = opReduce::GetReductionZeroVal(); const auto zeroVal = opReduce::GetReductionZeroVal();
const auto src_global_buf = make_dynamic_buffer<AddressSpaceEnum_t::Global>( const auto src_global_buf = make_dynamic_buffer<AddressSpaceEnum_t::Global>(
p_src_global, src2dDesc.GetElementSpaceSize(), type_convert<srcDataType>{}(zeroVal)); p_src_global, src2dDesc.GetElementSpaceSize(), type_convert<srcDataType>{}(zeroVal));
...@@ -243,7 +243,7 @@ struct GridwiseReduction_xy_to_x_blockwise ...@@ -243,7 +243,7 @@ struct GridwiseReduction_xy_to_x_blockwise
__shared__ compType p_in_block_buffer[BlockBufferSize]; __shared__ compType p_in_block_buffer[BlockBufferSize];
__shared__ int block_indices_buffer[BlockBufferSize]; __shared__ int block_indices_buffer[BlockBufferSize];
constexpr auto zeroVal = opReduce::GetReductionZeroVal(); const auto zeroVal = opReduce::GetReductionZeroVal();
const auto src_global_buf = make_dynamic_buffer<AddressSpaceEnum_t::Global>( const auto src_global_buf = make_dynamic_buffer<AddressSpaceEnum_t::Global>(
p_src_global, src2dDesc.GetElementSpaceSize(), type_convert<srcDataType>{}(zeroVal)); p_src_global, src2dDesc.GetElementSpaceSize(), type_convert<srcDataType>{}(zeroVal));
...@@ -431,7 +431,7 @@ struct GridwiseReduction_xy_to_x_blockwise ...@@ -431,7 +431,7 @@ struct GridwiseReduction_xy_to_x_blockwise
__shared__ compType p_in_block_buffer[BlockBufferSize]; __shared__ compType p_in_block_buffer[BlockBufferSize];
__shared__ int block_indices_buffer[BlockBufferSize]; __shared__ int block_indices_buffer[BlockBufferSize];
constexpr auto zeroVal = opReduce::GetReductionZeroVal(); const auto zeroVal = opReduce::GetReductionZeroVal();
const auto src_global_val_buf = const auto src_global_val_buf =
make_dynamic_buffer<AddressSpaceEnum_t::Global>(ws_values_global, make_dynamic_buffer<AddressSpaceEnum_t::Global>(ws_values_global,
......
...@@ -82,7 +82,7 @@ struct GridwiseReduction_xy_to_x_direct_threadwise ...@@ -82,7 +82,7 @@ struct GridwiseReduction_xy_to_x_direct_threadwise
(void)ws_indices_global; (void)ws_indices_global;
(void)indices_global; (void)indices_global;
constexpr auto zeroVal = opReduce::GetReductionZeroVal(); const auto zeroVal = opReduce::GetReductionZeroVal();
const auto src_global_buf = make_dynamic_buffer<AddressSpaceEnum_t::Global>( const auto src_global_buf = make_dynamic_buffer<AddressSpaceEnum_t::Global>(
p_src_global, src2dDesc.GetElementSpaceSize(), type_convert<srcDataType>{}(zeroVal)); p_src_global, src2dDesc.GetElementSpaceSize(), type_convert<srcDataType>{}(zeroVal));
...@@ -204,7 +204,7 @@ struct GridwiseReduction_xy_to_x_direct_threadwise ...@@ -204,7 +204,7 @@ struct GridwiseReduction_xy_to_x_direct_threadwise
{ {
(void)ws_indices_global; (void)ws_indices_global;
constexpr auto zeroVal = opReduce::GetReductionZeroVal(); const auto zeroVal = opReduce::GetReductionZeroVal();
const auto src_global_buf = make_dynamic_buffer<AddressSpaceEnum_t::Global>( const auto src_global_buf = make_dynamic_buffer<AddressSpaceEnum_t::Global>(
p_src_global, src2dDesc.GetElementSpaceSize(), type_convert<srcDataType>{}(zeroVal)); p_src_global, src2dDesc.GetElementSpaceSize(), type_convert<srcDataType>{}(zeroVal));
...@@ -348,7 +348,7 @@ struct GridwiseReduction_xy_to_x_direct_threadwise ...@@ -348,7 +348,7 @@ struct GridwiseReduction_xy_to_x_direct_threadwise
{ {
(void)origReduceLen; (void)origReduceLen;
constexpr auto zeroVal = opReduce::GetReductionZeroVal(); const auto zeroVal = opReduce::GetReductionZeroVal();
const auto src_global_val_buf = const auto src_global_val_buf =
make_dynamic_buffer<AddressSpaceEnum_t::Global>(ws_values_global, make_dynamic_buffer<AddressSpaceEnum_t::Global>(ws_values_global,
......
...@@ -82,7 +82,7 @@ struct GridwiseReduction_xy_to_x_direct_warpwise ...@@ -82,7 +82,7 @@ struct GridwiseReduction_xy_to_x_direct_warpwise
(void)ws_indices_global; (void)ws_indices_global;
(void)indices_global; (void)indices_global;
constexpr auto zeroVal = opReduce::GetReductionZeroVal(); const auto zeroVal = opReduce::GetReductionZeroVal();
const auto src_global_buf = make_dynamic_buffer<AddressSpaceEnum_t::Global>( const auto src_global_buf = make_dynamic_buffer<AddressSpaceEnum_t::Global>(
p_src_global, src2dDesc.GetElementSpaceSize(), type_convert<srcDataType>{}(zeroVal)); p_src_global, src2dDesc.GetElementSpaceSize(), type_convert<srcDataType>{}(zeroVal));
...@@ -215,7 +215,7 @@ struct GridwiseReduction_xy_to_x_direct_warpwise ...@@ -215,7 +215,7 @@ struct GridwiseReduction_xy_to_x_direct_warpwise
{ {
(void)ws_indices_global; (void)ws_indices_global;
constexpr auto zeroVal = opReduce::GetReductionZeroVal(); const auto zeroVal = opReduce::GetReductionZeroVal();
const auto src_global_buf = make_dynamic_buffer<AddressSpaceEnum_t::Global>( const auto src_global_buf = make_dynamic_buffer<AddressSpaceEnum_t::Global>(
p_src_global, src2dDesc.GetElementSpaceSize(), type_convert<srcDataType>{}(zeroVal)); p_src_global, src2dDesc.GetElementSpaceSize(), type_convert<srcDataType>{}(zeroVal));
...@@ -373,7 +373,7 @@ struct GridwiseReduction_xy_to_x_direct_warpwise ...@@ -373,7 +373,7 @@ struct GridwiseReduction_xy_to_x_direct_warpwise
{ {
(void)origReduceLen; (void)origReduceLen;
constexpr auto zeroVal = opReduce::GetReductionZeroVal(); const auto zeroVal = opReduce::GetReductionZeroVal();
const auto src_global_val_buf = const auto src_global_val_buf =
make_dynamic_buffer<AddressSpaceEnum_t::Global>(ws_values_global, make_dynamic_buffer<AddressSpaceEnum_t::Global>(ws_values_global,
......
...@@ -86,7 +86,7 @@ struct GridwiseReduction_xy_to_x_multiblock ...@@ -86,7 +86,7 @@ struct GridwiseReduction_xy_to_x_multiblock
(void)alpha; // unused (void)alpha; // unused
(void)beta; // unused (void)beta; // unused
constexpr auto zeroVal = opReduce::GetReductionZeroVal(); const auto zeroVal = opReduce::GetReductionZeroVal();
// LDS // LDS
__shared__ compType p_in_block_buffer[BlockBufferSize]; __shared__ compType p_in_block_buffer[BlockBufferSize];
...@@ -216,7 +216,7 @@ struct GridwiseReduction_xy_to_x_multiblock ...@@ -216,7 +216,7 @@ struct GridwiseReduction_xy_to_x_multiblock
(void)alpha; // unused (void)alpha; // unused
(void)beta; // unused (void)beta; // unused
constexpr auto zeroVal = opReduce::GetReductionZeroVal(); const auto zeroVal = opReduce::GetReductionZeroVal();
// LDS // LDS
__shared__ compType p_in_block_values_buffer[BlockBufferSize]; __shared__ compType p_in_block_values_buffer[BlockBufferSize];
......
...@@ -82,7 +82,7 @@ struct Max ...@@ -82,7 +82,7 @@ struct Max
{ {
using dataType = T; using dataType = T;
__device__ static constexpr T GetReductionZeroVal() { return NumericLimits<T>::lowest(); }; __device__ static constexpr T GetReductionZeroVal() { return NumericLimits<T>::Lowest(); };
__device__ inline constexpr void operator()(T& a, T b) const __device__ inline constexpr void operator()(T& a, T b) const
{ {
......
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