Files | Enumerations | Functions

Files

file  reduction.hpp
 

Enumerations

enum  cudf::scan_type : bool { INCLUSIVE, EXCLUSIVE }
 Enum to describe scan operation type.
 

Functions

std::unique_ptr< scalarcudf::reduce (column_view const &col, std::unique_ptr< aggregation > const &agg, data_type output_dtype, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Computes the reduction of the values in all rows of a column. More...
 
std::unique_ptr< columncudf::scan (const column_view &input, std::unique_ptr< aggregation > const &agg, scan_type inclusive, null_policy null_handling=null_policy::EXCLUDE, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Computes the scan of a column. More...
 
std::pair< std::unique_ptr< scalar >, std::unique_ptr< scalar > > cudf::minmax (column_view const &col, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Determines the minimum and maximum values of a column. More...
 

Detailed Description

Function Documentation

◆ minmax()

std::pair<std::unique_ptr<scalar>, std::unique_ptr<scalar> > cudf::minmax ( column_view const &  col,
rmm::mr::device_memory_resource mr = rmm::mr::get_current_device_resource() 
)

Determines the minimum and maximum values of a column.

Parameters
colcolumn to compute minmax
mrDevice memory resource used to allocate the returned column's device memory
Returns
A std::pair of scalars with the first scalar being the minimum value and the second scalar being the maximum value of the input column.

◆ reduce()

std::unique_ptr<scalar> cudf::reduce ( column_view const &  col,
std::unique_ptr< aggregation > const &  agg,
data_type  output_dtype,
rmm::mr::device_memory_resource mr = rmm::mr::get_current_device_resource() 
)

Computes the reduction of the values in all rows of a column.

This function does not detect overflows in reductions. Using a higher precision data_type may prevent overflow. Only min and max ops are supported for reduction of non-arithmetic types (timestamp, string...). The null values are skipped for the operation. If the column is empty, the member is_valid() of the output scalar will contain false.

Exceptions
cudf::logic_errorif reduction is called for non-arithmetic output type and operator other than min and max.
cudf::logic_errorif input column data type is not convertible to output data type.
cudf::logic_errorif min or max reduction is called and the output type does not match the input column data type.

If the input column has arithmetic type, output_dtype can be any arithmetic type. For mean, var and std ops, a floating point output type must be specified. If the input column has non-arithmetic type eg.(timestamp, string...), the same type must be specified.

If the reduction fails, the member is_valid of the output scalar will contain false.

Parameters
colInput column view
aggAggregation operator applied by the reduction
output_dtypeThe computation and output precision.
mrDevice memory resource used to allocate the returned scalar's device memory
Returns
Output scalar with reduce result.

◆ scan()

std::unique_ptr<column> cudf::scan ( const column_view input,
std::unique_ptr< aggregation > const &  agg,
scan_type  inclusive,
null_policy  null_handling = null_policy::EXCLUDE,
rmm::mr::device_memory_resource mr = rmm::mr::get_current_device_resource() 
)

Computes the scan of a column.

The null values are skipped for the operation, and if an input element at i is null, then the output element at i will also be null.

Exceptions
cudf::logic_errorif column datatype is not numeric type.
Parameters
[in]inputThe input column view for the scan
[in]aggunique_ptr to aggregation operator applied by the scan
[in]inclusiveThe flag for applying an inclusive scan if scan_type::INCLUSIVE, an exclusive scan if scan_type::EXCLUSIVE.
[in]null_handlingExclude null values when computing the result if null_policy::EXCLUDE. Include nulls if null_policy::INCLUDE. Any operation with a null results in a null.
[in]mrDevice memory resource used to allocate the returned scalar's device memory
Returns
unique pointer to new output column