21 #ifndef ROCPRIM_BLOCK_BLOCK_DISCONTINUITY_HPP_ 22 #define ROCPRIM_BLOCK_BLOCK_DISCONTINUITY_HPP_ 25 #include "detail/block_adjacent_difference_impl.hpp" 27 #include "../config.hpp" 28 #include "../detail/various.hpp" 35 BEGIN_ROCPRIM_NAMESPACE
78 unsigned int BlockSizeX,
79 unsigned int BlockSizeY = 1,
80 unsigned int BlockSizeZ = 1
83 #ifndef DOXYGEN_SHOULD_SKIP_THIS
85 #endif // DOXYGEN_SHOULD_SKIP_THIS 89 static constexpr
unsigned BlockSize = base_type::BlockSize;
107 #ifndef DOXYGEN_SHOULD_SKIP_THIS // hides storage_type implementation for Doxygen 154 template<
unsigned int ItemsPerThread,
class Flag,
class FlagOp>
155 ROCPRIM_DEVICE ROCPRIM_INLINE
157 const T (&input)[ItemsPerThread],
161 static constexpr
auto as_flags =
true;
162 static constexpr
auto reversed =
false;
163 static constexpr
auto with_predecessor =
false;
164 base_type::template apply_left<as_flags, reversed, with_predecessor>(
165 input, head_flags, flag_op, input[0] , storage.get().left);
172 template<
unsigned int ItemsPerThread,
class Flag,
class FlagOp>
173 ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE
175 const T (&input)[ItemsPerThread],
179 flag_heads(head_flags, input, flag_op, storage);
231 template<
unsigned int ItemsPerThread,
class Flag,
class FlagOp>
232 ROCPRIM_DEVICE ROCPRIM_INLINE
234 T tile_predecessor_item,
235 const T (&input)[ItemsPerThread],
239 static constexpr
auto as_flags =
true;
240 static constexpr
auto reversed =
false;
241 static constexpr
auto with_predecessor =
true;
242 base_type::template apply_left<as_flags, reversed, with_predecessor>(
243 input, head_flags, flag_op, tile_predecessor_item, storage.get().left);
250 template<
unsigned int ItemsPerThread,
class Flag,
class FlagOp>
251 ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE
253 T tile_predecessor_item,
254 const T (&input)[ItemsPerThread],
258 flag_heads(head_flags, tile_predecessor_item, input, flag_op, storage);
302 template<
unsigned int ItemsPerThread,
class Flag,
class FlagOp>
303 ROCPRIM_DEVICE ROCPRIM_INLINE
305 const T (&input)[ItemsPerThread],
309 static constexpr
auto as_flags =
true;
310 static constexpr
auto reversed =
false;
311 static constexpr
auto with_successor =
false;
312 base_type::template apply_right<as_flags, reversed, with_successor>(
313 input, tail_flags, flag_op, input[0] , storage.get().right);
320 template<
unsigned int ItemsPerThread,
class Flag,
class FlagOp>
321 ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE
323 const T (&input)[ItemsPerThread],
327 flag_tails(tail_flags, input, flag_op, storage);
379 template<
unsigned int ItemsPerThread,
class Flag,
class FlagOp>
380 ROCPRIM_DEVICE ROCPRIM_INLINE
382 T tile_successor_item,
383 const T (&input)[ItemsPerThread],
387 static constexpr
auto as_flags =
true;
388 static constexpr
auto reversed =
false;
389 static constexpr
auto with_successor =
true;
390 base_type::template apply_right<as_flags, reversed, with_successor>(
391 input, tail_flags, flag_op, tile_successor_item, storage.get().right);
398 template<
unsigned int ItemsPerThread,
class Flag,
class FlagOp>
399 ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE
401 T tile_successor_item,
402 const T (&input)[ItemsPerThread],
406 flag_tails(tail_flags, tile_successor_item, input, flag_op, storage);
452 template<
unsigned int ItemsPerThread,
class Flag,
class FlagOp>
453 ROCPRIM_DEVICE ROCPRIM_INLINE
455 Flag (&tail_flags)[ItemsPerThread],
456 const T (&input)[ItemsPerThread],
460 static constexpr
auto as_flags =
true;
461 static constexpr
auto reversed =
false;
462 static constexpr
auto with_predecessor =
false;
463 static constexpr
auto with_successor =
false;
466 T items[ItemsPerThread];
469 for(
unsigned int i = 0; i < ItemsPerThread; ++i) {
473 base_type::template apply_left<as_flags, reversed, with_predecessor>(
474 items, head_flags, flag_op, items[0] , storage.get().left);
476 base_type::template apply_right<as_flags, reversed, with_successor>(
477 items, tail_flags, flag_op, items[0] , storage.get().right);
484 template<
unsigned int ItemsPerThread,
class Flag,
class FlagOp>
485 ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE
487 Flag (&tail_flags)[ItemsPerThread],
488 const T (&input)[ItemsPerThread],
547 template<
unsigned int ItemsPerThread,
class Flag,
class FlagOp>
548 ROCPRIM_DEVICE ROCPRIM_INLINE
550 Flag (&tail_flags)[ItemsPerThread],
551 T tile_successor_item,
552 const T (&input)[ItemsPerThread],
556 static constexpr
auto as_flags =
true;
557 static constexpr
auto reversed =
false;
558 static constexpr
auto with_predecessor =
false;
559 static constexpr
auto with_successor =
true;
562 T items[ItemsPerThread];
565 for(
unsigned int i = 0; i < ItemsPerThread; ++i) {
569 base_type::template apply_left<as_flags, reversed, with_predecessor>(
570 items, head_flags, flag_op, items[0] , storage.get().left);
572 base_type::template apply_right<as_flags, reversed, with_successor>(
573 items, tail_flags, flag_op, tile_successor_item, storage.get().right);
580 template<
unsigned int ItemsPerThread,
class Flag,
class FlagOp>
581 ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE
583 Flag (&tail_flags)[ItemsPerThread],
584 T tile_successor_item,
585 const T (&input)[ItemsPerThread],
644 template<
unsigned int ItemsPerThread,
class Flag,
class FlagOp>
645 ROCPRIM_DEVICE ROCPRIM_INLINE
647 T tile_predecessor_item,
648 Flag (&tail_flags)[ItemsPerThread],
649 const T (&input)[ItemsPerThread],
653 static constexpr
auto as_flags =
true;
654 static constexpr
auto reversed =
false;
655 static constexpr
auto with_predecessor =
true;
656 static constexpr
auto with_successor =
false;
659 T items[ItemsPerThread];
662 for(
unsigned int i = 0; i < ItemsPerThread; ++i) {
666 base_type::template apply_left<as_flags, reversed, with_predecessor>(
667 items, head_flags, flag_op, tile_predecessor_item, storage.get().left);
669 base_type::template apply_right<as_flags, reversed, with_successor>(
670 items, tail_flags, flag_op, items[0] , storage.get().right);
677 template<
unsigned int ItemsPerThread,
class Flag,
class FlagOp>
678 ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE
680 T tile_predecessor_item,
681 Flag (&tail_flags)[ItemsPerThread],
682 const T (&input)[ItemsPerThread],
747 template<
unsigned int ItemsPerThread,
class Flag,
class FlagOp>
748 ROCPRIM_DEVICE ROCPRIM_INLINE
750 T tile_predecessor_item,
751 Flag (&tail_flags)[ItemsPerThread],
752 T tile_successor_item,
753 const T (&input)[ItemsPerThread],
757 static constexpr
auto as_flags =
true;
758 static constexpr
auto reversed =
false;
759 static constexpr
auto with_predecessor =
true;
760 static constexpr
auto with_successor =
true;
763 T items[ItemsPerThread];
766 for(
unsigned int i = 0; i < ItemsPerThread; ++i) {
770 base_type::template apply_left<as_flags, reversed, with_predecessor>(
771 items, head_flags, flag_op, tile_predecessor_item, storage.get().left);
773 base_type::template apply_right<as_flags, reversed, with_successor>(
774 items, tail_flags, flag_op, tile_successor_item, storage.get().right);
781 template<
unsigned int ItemsPerThread,
class Flag,
class FlagOp>
782 ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE
784 T tile_predecessor_item,
785 Flag (&tail_flags)[ItemsPerThread],
786 T tile_successor_item,
787 const T (&input)[ItemsPerThread],
792 head_flags, tile_predecessor_item, tail_flags, tile_successor_item,
793 input, flag_op, storage
798 END_ROCPRIM_NAMESPACE
803 #endif // ROCPRIM_BLOCK_BLOCK_DISCONTINUITY_HPP_ ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE void flag_heads(Flag(&head_flags)[ItemsPerThread], T tile_predecessor_item, const T(&input)[ItemsPerThread], FlagOp flag_op)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: block_discontinuity.hpp:252
The block_discontinuity class is a block level parallel primitive which provides methods for flagging...
Definition: block_discontinuity.hpp:82
ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE void flag_heads_and_tails(Flag(&head_flags)[ItemsPerThread], T tile_predecessor_item, Flag(&tail_flags)[ItemsPerThread], T tile_successor_item, const T(&input)[ItemsPerThread], FlagOp flag_op)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: block_discontinuity.hpp:783
ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE void flag_heads_and_tails(Flag(&head_flags)[ItemsPerThread], T tile_predecessor_item, Flag(&tail_flags)[ItemsPerThread], const T(&input)[ItemsPerThread], FlagOp flag_op)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: block_discontinuity.hpp:679
ROCPRIM_DEVICE ROCPRIM_INLINE void flag_heads(Flag(&head_flags)[ItemsPerThread], T tile_predecessor_item, const T(&input)[ItemsPerThread], FlagOp flag_op, storage_type &storage)
Tags head_flags that indicate discontinuities between items partitioned across the thread block...
Definition: block_discontinuity.hpp:233
ROCPRIM_DEVICE ROCPRIM_INLINE void flag_heads_and_tails(Flag(&head_flags)[ItemsPerThread], T tile_predecessor_item, Flag(&tail_flags)[ItemsPerThread], const T(&input)[ItemsPerThread], FlagOp flag_op, storage_type &storage)
Tags both head_flags andtail_flags that indicate discontinuities between items partitioned across the...
Definition: block_discontinuity.hpp:646
ROCPRIM_DEVICE ROCPRIM_INLINE void flag_heads(Flag(&head_flags)[ItemsPerThread], const T(&input)[ItemsPerThread], FlagOp flag_op, storage_type &storage)
Tags head_flags that indicate discontinuities between items partitioned across the thread block...
Definition: block_discontinuity.hpp:156
ROCPRIM_DEVICE ROCPRIM_INLINE void flag_tails(Flag(&tail_flags)[ItemsPerThread], T tile_successor_item, const T(&input)[ItemsPerThread], FlagOp flag_op, storage_type &storage)
Tags tail_flags that indicate discontinuities between items partitioned across the thread block...
Definition: block_discontinuity.hpp:381
ROCPRIM_DEVICE ROCPRIM_INLINE void flag_heads_and_tails(Flag(&head_flags)[ItemsPerThread], T tile_predecessor_item, Flag(&tail_flags)[ItemsPerThread], T tile_successor_item, const T(&input)[ItemsPerThread], FlagOp flag_op, storage_type &storage)
Tags both head_flags andtail_flags that indicate discontinuities between items partitioned across the...
Definition: block_discontinuity.hpp:749
ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE void flag_tails(Flag(&tail_flags)[ItemsPerThread], T tile_successor_item, const T(&input)[ItemsPerThread], FlagOp flag_op)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: block_discontinuity.hpp:400
ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE void flag_heads_and_tails(Flag(&head_flags)[ItemsPerThread], Flag(&tail_flags)[ItemsPerThread], const T(&input)[ItemsPerThread], FlagOp flag_op)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: block_discontinuity.hpp:486
ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE void flag_heads(Flag(&head_flags)[ItemsPerThread], const T(&input)[ItemsPerThread], FlagOp flag_op)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: block_discontinuity.hpp:174
ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE void flag_tails(Flag(&tail_flags)[ItemsPerThread], const T(&input)[ItemsPerThread], FlagOp flag_op)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: block_discontinuity.hpp:322
Definition: block_adjacent_difference_impl.hpp:96
ROCPRIM_DEVICE ROCPRIM_INLINE void flag_heads_and_tails(Flag(&head_flags)[ItemsPerThread], Flag(&tail_flags)[ItemsPerThread], const T(&input)[ItemsPerThread], FlagOp flag_op, storage_type &storage)
Tags both head_flags andtail_flags that indicate discontinuities between items partitioned across the...
Definition: block_discontinuity.hpp:454
ROCPRIM_DEVICE ROCPRIM_INLINE void flag_heads_and_tails(Flag(&head_flags)[ItemsPerThread], Flag(&tail_flags)[ItemsPerThread], T tile_successor_item, const T(&input)[ItemsPerThread], FlagOp flag_op, storage_type &storage)
Tags both head_flags andtail_flags that indicate discontinuities between items partitioned across the...
Definition: block_discontinuity.hpp:549
Definition: block_adjacent_difference_impl.hpp:92
ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE void flag_heads_and_tails(Flag(&head_flags)[ItemsPerThread], Flag(&tail_flags)[ItemsPerThread], T tile_successor_item, const T(&input)[ItemsPerThread], FlagOp flag_op)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: block_discontinuity.hpp:582
ROCPRIM_DEVICE ROCPRIM_INLINE void flag_tails(Flag(&tail_flags)[ItemsPerThread], const T(&input)[ItemsPerThread], FlagOp flag_op, storage_type &storage)
Tags tail_flags that indicate discontinuities between items partitioned across the thread block...
Definition: block_discontinuity.hpp:304