transform.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2021, 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/ast/expressions.hpp>
20 #include <cudf/types.hpp>
21 
22 #include <memory>
23 
24 namespace cudf {
50 std::unique_ptr<column> transform(
51  column_view const& input,
52  std::string const& unary_udf,
53  data_type output_type,
54  bool is_ptx,
55  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
56 
68 std::pair<std::unique_ptr<rmm::device_buffer>, size_type> nans_to_nulls(
69  column_view const& input,
70  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
71 
85 std::unique_ptr<column> compute_column(
86  table_view const& table,
87  ast::expression const& expr,
88  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
89 
105 std::pair<std::unique_ptr<rmm::device_buffer>, cudf::size_type> bools_to_mask(
106  column_view const& input,
107  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
108 
133 std::pair<std::unique_ptr<cudf::table>, std::unique_ptr<cudf::column>> encode(
134  cudf::table_view const& input,
135  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
136 
164 std::pair<std::unique_ptr<column>, table_view> one_hot_encode(
165  column_view const& input,
166  column_view const& categories,
167  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
168 
190 std::unique_ptr<column> mask_to_bools(
191  bitmask_type const* bitmask,
192  size_type begin_bit,
193  size_type end_bit,
194  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
195 
221 std::unique_ptr<column> row_bit_count(
222  table_view const& t,
223  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
224  // end of group
226 } // namespace cudf
cudf::compute_column
std::unique_ptr< column > compute_column(table_view const &table, ast::expression const &expr, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Compute a new column by evaluating an expression tree on a table.
cudf::mask_to_bools
std::unique_ptr< column > mask_to_bools(bitmask_type const *bitmask, size_type begin_bit, size_type end_bit, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Creates a boolean column from given bitmask.
cudf::size_type
int32_t size_type
Row index type for columns and tables.
Definition: types.hpp:84
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::table
A set of cudf::column's of the same size.
Definition: table.hpp:38
cudf::bitmask_type
uint32_t bitmask_type
Bitmask type stored as 32-bit unsigned integer.
Definition: types.hpp:85
cudf::one_hot_encode
std::pair< std::unique_ptr< column >, table_view > one_hot_encode(column_view const &input, column_view const &categories, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Encodes input by generating a new column for each value in categories indicating the presence of that...
cudf::ast::expression
A generic expression that can be evaluated to return a value.
Definition: expressions.hpp:40
cudf::table_view
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:154
cudf::row_bit_count
std::unique_ptr< column > row_bit_count(table_view const &t, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns an approximate cumulative size in bits of all columns in the table_view for each row.
cudf::transform
std::unique_ptr< column > transform(column_view const &input, std::string const &unary_udf, data_type output_type, bool is_ptx, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Creates a new column by applying a unary function against every element of an input column.
cudf::data_type
Indicator for the logical data type of an element in a column.
Definition: types.hpp:240
cudf
cuDF interfaces
Definition: aggregation.hpp:34
cudf::encode
std::pair< std::unique_ptr< cudf::table >, std::unique_ptr< cudf::column > > encode(cudf::table_view const &input, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Encode the rows of the given table as integers.
cudf::bools_to_mask
std::pair< std::unique_ptr< rmm::device_buffer >, cudf::size_type > bools_to_mask(column_view const &input, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Creates a bitmask from a column of boolean elements.
cudf::nans_to_nulls
std::pair< std::unique_ptr< rmm::device_buffer >, size_type > nans_to_nulls(column_view const &input, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Creates a null_mask from input by converting NaN to null and preserving existing null values and also...
rmm::mr::device_memory_resource