MUDA
Loading...
Searching...
No Matches
device_run_length_encode.h
1#pragma once
2#include <muda/cub/device/cub_wrapper.h>
3#include "details/cub_wrapper_macro_def.inl"
4#ifndef __INTELLISENSE__
5#include <cub/device/device_run_length_encode.cuh>
6#endif
7
8namespace muda
9{
10//ref: https://nvlabs.github.io/cub/structcub_1_1_device_run_length_encode.html
11class DeviceRunLengthEncode : public CubWrapper<DeviceRunLengthEncode>
12{
14
15 public:
16 using Base::Base;
17
18 template <typename InputIteratorT, typename UniqueOutputIteratorT, typename LengthsOutputIteratorT, typename NumRunsOutputIteratorT>
19 DeviceRunLengthEncode& Encode(InputIteratorT d_in,
20 UniqueOutputIteratorT d_unique_out,
21 LengthsOutputIteratorT d_counts_out,
22 NumRunsOutputIteratorT d_num_runs_out,
23 int num_items)
24 {
25 MUDA_CUB_WRAPPER_IMPL(cub::DeviceRunLengthEncode::Encode(
26 d_temp_storage, temp_storage_bytes, d_in, d_unique_out, d_counts_out, d_num_runs_out, num_items, _stream, false));
27 }
28
29 template <typename InputIteratorT, typename OffsetsOutputIteratorT, typename LengthsOutputIteratorT, typename NumRunsOutputIteratorT>
30 DeviceRunLengthEncode& NonTrivialRuns(InputIteratorT d_in,
31 OffsetsOutputIteratorT d_offsets_out,
32 LengthsOutputIteratorT d_lengths_out,
33 NumRunsOutputIteratorT d_num_runs_out,
34 int num_items)
35 {
36 MUDA_CUB_WRAPPER_IMPL(cub::DeviceRunLengthEncode::NonTrivialRuns(
37 d_temp_storage, temp_storage_bytes, d_in, d_offsets_out, d_lengths_out, d_num_runs_out, num_items, _stream, false));
38 }
39
40
41 // Origin:
42
43 template <typename InputIteratorT, typename UniqueOutputIteratorT, typename LengthsOutputIteratorT, typename NumRunsOutputIteratorT>
44 DeviceRunLengthEncode& Encode(void* d_temp_storage,
45 size_t& temp_storage_bytes,
46 InputIteratorT d_in,
47 UniqueOutputIteratorT d_unique_out,
48 LengthsOutputIteratorT d_counts_out,
49 NumRunsOutputIteratorT d_num_runs_out,
50 int num_items)
51 {
52 MUDA_CUB_WRAPPER_FOR_COMPUTE_GRAPH_IMPL(cub::DeviceRunLengthEncode::Encode(
53 d_temp_storage, temp_storage_bytes, d_in, d_unique_out, d_counts_out, d_num_runs_out, num_items, _stream, false));
54 }
55
56 template <typename InputIteratorT, typename OffsetsOutputIteratorT, typename LengthsOutputIteratorT, typename NumRunsOutputIteratorT>
57 DeviceRunLengthEncode& NonTrivialRuns(void* d_temp_storage,
58 size_t& temp_storage_bytes,
59 InputIteratorT d_in,
60 OffsetsOutputIteratorT d_offsets_out,
61 LengthsOutputIteratorT d_lengths_out,
62 NumRunsOutputIteratorT d_num_runs_out,
63 int num_items)
64 {
65 MUDA_CUB_WRAPPER_FOR_COMPUTE_GRAPH_IMPL(cub::DeviceRunLengthEncode::NonTrivialRuns(
66 d_temp_storage, temp_storage_bytes, d_in, d_offsets_out, d_lengths_out, d_num_runs_out, num_items, _stream, false));
67 }
68};
69} // namespace muda
70
71#include "details/cub_wrapper_macro_undef.inl"
Definition cub_wrapper.h:14
Definition device_run_length_encode.h:12
Definition launch_base.h:42