30 #ifndef HIPCUB_ROCPRIM_BLOCK_BLOCK_HISTOGRAM_HPP_
31 #define HIPCUB_ROCPRIM_BLOCK_BLOCK_HISTOGRAM_HPP_
33 #include "../util_ptx.hpp"
35 #include <type_traits>
37 #include <rocprim/block/block_histogram.hpp>
39 BEGIN_HIPCUB_NAMESPACE
44 typename std::underlying_type<::rocprim::block_histogram_algorithm>::type
45 to_BlockHistogramAlgorithm_enum(::rocprim::block_histogram_algorithm v)
47 using utype = std::underlying_type<::rocprim::block_histogram_algorithm>::type;
48 return static_cast<utype
>(v);
52 enum BlockHistogramAlgorithm
55 = detail::to_BlockHistogramAlgorithm_enum(::rocprim::block_histogram_algorithm::using_atomic),
57 = detail::to_BlockHistogramAlgorithm_enum(::rocprim::block_histogram_algorithm::using_sort)
65 BlockHistogramAlgorithm ALGORITHM = BLOCK_HISTO_SORT,
68 int ARCH = HIPCUB_ARCH
71 :
private ::rocprim::block_histogram<
76 static_cast<::rocprim::block_histogram_algorithm>(ALGORITHM),
82 BLOCK_DIM_X * BLOCK_DIM_Y * BLOCK_DIM_Z > 0,
83 "BLOCK_DIM_X * BLOCK_DIM_Y * BLOCK_DIM_Z must be greater than 0"
87 typename ::rocprim::block_histogram<
92 static_cast<::rocprim::block_histogram_algorithm
>(ALGORITHM),
98 typename base_type::storage_type& temp_storage_;
101 using TempStorage =
typename base_type::storage_type;
109 BlockHistogram(TempStorage& temp_storage) : temp_storage_(temp_storage)
113 template<
class CounterT>
115 void InitHistogram(CounterT histogram[BINS])
117 base_type::init_histogram(histogram);
120 template<
class CounterT>
122 void Composite(T (&items)[ITEMS_PER_THREAD],
123 CounterT histogram[BINS])
125 base_type::composite(items, histogram, temp_storage_);
128 template<
class CounterT>
130 void Histogram(T (&items)[ITEMS_PER_THREAD],
131 CounterT histogram[BINS])
133 base_type::init_histogram(histogram);
135 base_type::composite(items, histogram, temp_storage_);
140 TempStorage& private_storage()
142 HIPCUB_SHARED_MEMORY TempStorage private_storage;
143 return private_storage;
Definition: block_histogram.hpp:80