stream_compaction.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2022, NVIDIA CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <cudf/types.hpp>
20 
21 #include <memory>
22 #include <vector>
23 
24 namespace cudf {
69 std::unique_ptr<table> drop_nulls(
70  table_view const& input,
71  std::vector<size_type> const& keys,
72  cudf::size_type keep_threshold,
73  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
74 
101 std::unique_ptr<table> drop_nulls(
102  table_view const& input,
103  std::vector<size_type> const& keys,
104  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
105 
143 std::unique_ptr<table> drop_nans(
144  table_view const& input,
145  std::vector<size_type> const& keys,
146  cudf::size_type keep_threshold,
147  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
148 
176 std::unique_ptr<table> drop_nans(
177  table_view const& input,
178  std::vector<size_type> const& keys,
179  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
180 
202 std::unique_ptr<table> apply_boolean_mask(
203  table_view const& input,
204  column_view const& boolean_mask,
205  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
206 
211  KEEP_FIRST = 0,
212  KEEP_LAST,
213  KEEP_NONE
214 };
215 
247 std::unique_ptr<table> unique(
248  table_view const& input,
249  std::vector<size_type> const& keys,
251  null_equality nulls_equal = null_equality::EQUAL,
252  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
253 
278 std::unique_ptr<table> distinct(
279  table_view const& input,
280  std::vector<size_type> const& keys,
281  null_equality nulls_equal = null_equality::EQUAL,
282  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
283 
300  null_policy null_handling,
301  nan_policy nan_handling);
302 
313  null_equality nulls_equal = null_equality::EQUAL);
314 
336  null_policy null_handling,
337  nan_policy nan_handling);
338 
349  null_equality nulls_equal = null_equality::EQUAL);
350 
352 } // namespace cudf
cudf::nan_policy
nan_policy
Enum to treat NaN floating point value as null or non-null element.
Definition: types.hpp:131
cudf::apply_boolean_mask
std::unique_ptr< table > apply_boolean_mask(table_view const &input, column_view const &boolean_mask, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Filters input using boolean_mask of boolean values as a mask.
cudf::size_type
int32_t size_type
Row index type for columns and tables.
Definition: types.hpp:84
cudf::null_policy
null_policy
Enum to specify whether to include nulls or exclude nulls.
Definition: types.hpp:123
cudf::unique
std::unique_ptr< table > unique(table_view const &input, std::vector< size_type > const &keys, duplicate_keep_option keep, null_equality nulls_equal=null_equality::EQUAL, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Create a new table with consecutive duplicate rows removed.
cudf::column_view
A non-owning, immutable view of device data as a column of elements, some of which may be null as ind...
Definition: column_view.hpp:300
types.hpp
Type declarations for libcudf.
cudf::drop_nulls
std::unique_ptr< table > drop_nulls(table_view const &input, std::vector< size_type > const &keys, cudf::size_type keep_threshold, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Filters a table to remove null elements with threshold count.
cudf::duplicate_keep_option::KEEP_FIRST
@ KEEP_FIRST
Keeps first duplicate element and unique elements.
cudf::distinct
std::unique_ptr< table > distinct(table_view const &input, std::vector< size_type > const &keys, null_equality nulls_equal=null_equality::EQUAL, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Create a new table without duplicate rows.
cudf::table_view
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:154
cudf::duplicate_keep_option
duplicate_keep_option
Choices for drop_duplicates API for retainment of duplicate rows.
Definition: stream_compaction.hpp:210
cudf
cuDF interfaces
Definition: aggregation.hpp:34
cudf::distinct_count
cudf::size_type distinct_count(column_view const &input, null_policy null_handling, nan_policy nan_handling)
Count the distinct elements in the column_view.
cudf::unique_count
cudf::size_type unique_count(column_view const &input, null_policy null_handling, nan_policy nan_handling)
Count the number of consecutive groups of equivalent rows in a column.
cudf::null_equality
null_equality
Enum to consider two nulls as equal or unequal.
Definition: types.hpp:148
rmm::mr::device_memory_resource
cudf::drop_nans
std::unique_ptr< table > drop_nans(table_view const &input, std::vector< size_type > const &keys, cudf::size_type keep_threshold, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Filters a table to remove NANs with threshold count.