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])
120 template<
class CounterT>
122 void Composite(T (&items)[ITEMS_PER_THREAD],
125 base_type::composite(items,
histogram, temp_storage_);
128 template<
class CounterT>
130 void Histogram(T (&items)[ITEMS_PER_THREAD],
135 base_type::composite(items,
histogram, temp_storage_);
143 return private_storage;
149 #endif // HIPCUB_ROCPRIM_BLOCK_BLOCK_HISTOGRAM_HPP_ Definition: test_hipcub_block_load_store.kernels.hpp:167
Definition: block_histogram.hpp:70
Definition: block_histogram.hpp:41
Definition: benchmark_block_histogram.cpp:49