30 #ifndef HIPCUB_ROCPRIM_BLOCK_BLOCK_STORE_HPP_
31 #define HIPCUB_ROCPRIM_BLOCK_BLOCK_STORE_HPP_
33 #include <type_traits>
35 #include "../../../config.hpp"
37 #include "block_store_func.hpp"
39 #include <rocprim/block/block_store.hpp>
41 BEGIN_HIPCUB_NAMESPACE
46 typename std::underlying_type<::rocprim::block_store_method>::type
47 to_BlockStoreAlgorithm_enum(::rocprim::block_store_method v)
49 using utype = std::underlying_type<::rocprim::block_store_method>::type;
50 return static_cast<utype
>(v);
54 enum BlockStoreAlgorithm
57 = detail::to_BlockStoreAlgorithm_enum(::rocprim::block_store_method::block_store_direct),
59 = detail::to_BlockStoreAlgorithm_enum(::rocprim::block_store_method::block_store_striped),
61 = detail::to_BlockStoreAlgorithm_enum(::rocprim::block_store_method::block_store_vectorize),
63 = detail::to_BlockStoreAlgorithm_enum(::rocprim::block_store_method::block_store_transpose),
64 BLOCK_STORE_WARP_TRANSPOSE
65 = detail::to_BlockStoreAlgorithm_enum(::rocprim::block_store_method::block_store_warp_transpose),
66 BLOCK_STORE_WARP_TRANSPOSE_TIMESLICED
67 = detail::to_BlockStoreAlgorithm_enum(::rocprim::block_store_method::block_store_warp_transpose)
74 BlockStoreAlgorithm ALGORITHM = BLOCK_STORE_DIRECT,
77 int ARCH = HIPCUB_ARCH
80 :
private ::rocprim::block_store<
84 static_cast<::rocprim::block_store_method>(ALGORITHM),
90 BLOCK_DIM_X * BLOCK_DIM_Y * BLOCK_DIM_Z > 0,
91 "BLOCK_DIM_X * BLOCK_DIM_Y * BLOCK_DIM_Z must be greater than 0"
95 typename ::rocprim::block_store<
99 static_cast<::rocprim::block_store_method
>(ALGORITHM),
105 typename base_type::storage_type& temp_storage_;
108 using TempStorage =
typename base_type::storage_type;
111 BlockStore() : temp_storage_(private_storage())
116 BlockStore(TempStorage& temp_storage) : temp_storage_(temp_storage)
120 template<
class OutputIteratorT>
122 void Store(OutputIteratorT block_iter,
123 T (&items)[ITEMS_PER_THREAD])
125 base_type::store(block_iter, items, temp_storage_);
128 template<
class OutputIteratorT>
130 void Store(OutputIteratorT block_iter,
131 T (&items)[ITEMS_PER_THREAD],
134 base_type::store(block_iter, items, valid_items, temp_storage_);
139 TempStorage& private_storage()
141 HIPCUB_SHARED_MEMORY TempStorage private_storage;
142 return private_storage;
Definition: block_store.hpp:88