30 #ifndef HIPCUB_ROCPRIM_BLOCK_BLOCK_HISTOGRAM_HPP_
31 #define HIPCUB_ROCPRIM_BLOCK_BLOCK_HISTOGRAM_HPP_
33 #include <type_traits>
35 #include <rocprim/block/block_histogram.hpp>
37 BEGIN_HIPCUB_NAMESPACE
42 typename std::underlying_type<::rocprim::block_histogram_algorithm>::type
43 to_BlockHistogramAlgorithm_enum(::rocprim::block_histogram_algorithm v)
45 using utype = std::underlying_type<::rocprim::block_histogram_algorithm>::type;
46 return static_cast<utype
>(v);
50 enum BlockHistogramAlgorithm
53 = detail::to_BlockHistogramAlgorithm_enum(::rocprim::block_histogram_algorithm::using_atomic),
55 = detail::to_BlockHistogramAlgorithm_enum(::rocprim::block_histogram_algorithm::using_sort)
63 BlockHistogramAlgorithm ALGORITHM = BLOCK_HISTO_SORT,
66 int ARCH = HIPCUB_ARCH
69 :
private ::rocprim::block_histogram<
74 static_cast<::rocprim::block_histogram_algorithm>(ALGORITHM),
80 BLOCK_DIM_X * BLOCK_DIM_Y * BLOCK_DIM_Z > 0,
81 "BLOCK_DIM_X * BLOCK_DIM_Y * BLOCK_DIM_Z must be greater than 0"
85 typename ::rocprim::block_histogram<
90 static_cast<::rocprim::block_histogram_algorithm
>(ALGORITHM),
96 typename base_type::storage_type& temp_storage_;
99 using TempStorage =
typename base_type::storage_type;
107 BlockHistogram(TempStorage& temp_storage) : temp_storage_(temp_storage)
111 template<
class CounterT>
113 void InitHistogram(CounterT histogram[BINS])
115 base_type::init_histogram(histogram);
118 template<
class CounterT>
120 void Composite(T (&items)[ITEMS_PER_THREAD],
121 CounterT histogram[BINS])
123 base_type::composite(items, histogram, temp_storage_);
126 template<
class CounterT>
128 void Histogram(T (&items)[ITEMS_PER_THREAD],
129 CounterT histogram[BINS])
131 base_type::init_histogram(histogram);
133 base_type::composite(items, histogram, temp_storage_);
138 TempStorage& private_storage()
140 HIPCUB_SHARED_MEMORY TempStorage private_storage;
141 return private_storage;
Definition: block_histogram.hpp:78