30 #ifndef HIPCUB_ROCPRIM_BLOCK_BLOCK_LOAD_HPP_
31 #define HIPCUB_ROCPRIM_BLOCK_BLOCK_LOAD_HPP_
33 #include <type_traits>
35 #include "../../../config.hpp"
37 #include <rocprim/block/block_load.hpp>
39 #include "block_load_func.hpp"
41 BEGIN_HIPCUB_NAMESPACE
46 typename std::underlying_type<::rocprim::block_load_method>::type
47 to_BlockLoadAlgorithm_enum(::rocprim::block_load_method v)
49 using utype = std::underlying_type<::rocprim::block_load_method>::type;
50 return static_cast<utype
>(v);
54 enum BlockLoadAlgorithm
57 = detail::to_BlockLoadAlgorithm_enum(::rocprim::block_load_method::block_load_direct),
59 = detail::to_BlockLoadAlgorithm_enum(::rocprim::block_load_method::block_load_striped),
61 = detail::to_BlockLoadAlgorithm_enum(::rocprim::block_load_method::block_load_vectorize),
63 = detail::to_BlockLoadAlgorithm_enum(::rocprim::block_load_method::block_load_transpose),
64 BLOCK_LOAD_WARP_TRANSPOSE
65 = detail::to_BlockLoadAlgorithm_enum(::rocprim::block_load_method::block_load_warp_transpose),
66 BLOCK_LOAD_WARP_TRANSPOSE_TIMESLICED
67 = detail::to_BlockLoadAlgorithm_enum(::rocprim::block_load_method::block_load_warp_transpose)
74 BlockLoadAlgorithm ALGORITHM = BLOCK_LOAD_DIRECT,
77 int ARCH = HIPCUB_ARCH
80 :
private ::rocprim::block_load<
84 static_cast<::rocprim::block_load_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_load<
99 static_cast<::rocprim::block_load_method
>(ALGORITHM),
105 typename base_type::storage_type& temp_storage_;
108 using TempStorage =
typename base_type::storage_type;
111 BlockLoad() : temp_storage_(private_storage())
116 BlockLoad(TempStorage& temp_storage) : temp_storage_(temp_storage)
120 template<
class InputIteratorT>
122 void Load(InputIteratorT block_iter,
123 T (&items)[ITEMS_PER_THREAD])
125 base_type::load(block_iter, items, temp_storage_);
128 template<
class InputIteratorT>
130 void Load(InputIteratorT block_iter,
131 T (&items)[ITEMS_PER_THREAD],
134 base_type::load(block_iter, items, valid_items, temp_storage_);
138 class InputIteratorT,
142 void Load(InputIteratorT block_iter,
143 T (&items)[ITEMS_PER_THREAD],
147 base_type::load(block_iter, items, valid_items, oob_default, temp_storage_);
152 TempStorage& private_storage()
154 HIPCUB_SHARED_MEMORY TempStorage private_storage;
155 return private_storage;
Definition: block_load.hpp:88