reduction.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/aggregation.hpp>
20 #include <cudf/scalar/scalar.hpp>
21 
22 namespace cudf {
32 enum class scan_type : bool { INCLUSIVE, EXCLUSIVE };
33 
69 std::unique_ptr<scalar> reduce(
70  column_view const& col,
71  std::unique_ptr<reduce_aggregation> const& agg,
72  data_type output_dtype,
73  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
74 
117 std::unique_ptr<column> segmented_reduce(
118  column_view const& segmented_values,
120  segmented_reduce_aggregation const& agg,
121  data_type output_dtype,
122  null_policy null_handling,
123  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
124 
143 std::unique_ptr<column> scan(
144  const column_view& input,
145  std::unique_ptr<scan_aggregation> const& agg,
147  null_policy null_handling = null_policy::EXCLUDE,
148  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
149 
159 std::pair<std::unique_ptr<scalar>, std::unique_ptr<scalar>> minmax(
160  column_view const& col,
161  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
162  // end of group
164 
165 } // namespace cudf
cudf::segmented_reduce
std::unique_ptr< column > segmented_reduce(column_view const &segmented_values, device_span< size_type const > offsets, segmented_reduce_aggregation const &agg, data_type output_dtype, null_policy null_handling, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Compute reduction of each segment in the input column.
scalar.hpp
Class definitions for cudf::scalar.
cudf::null_policy
null_policy
Enum to specify whether to include nulls or exclude nulls.
Definition: types.hpp:123
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
cudf::scan
std::unique_ptr< column > scan(const column_view &input, std::unique_ptr< scan_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.
cudf::segmented_reduce_aggregation
Derived class intended for segmented reduction usage.
Definition: aggregation.hpp:200
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::reduce
std::unique_ptr< scalar > reduce(column_view const &col, std::unique_ptr< reduce_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.
cudf::inclusive
inclusive
Enum used to define whether or not bins include their boundary points.
Definition: label_bins.hpp:38
cudf::minmax
std::pair< std::unique_ptr< scalar >, std::unique_ptr< scalar > > 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.
aggregation.hpp
Representation for specifying desired aggregations from aggregation-based APIs, e....
rmm::mr::device_memory_resource
cudf::device_span
Definition: span.hpp:194
cudf::scan_type
scan_type
Enum to describe scan operation type.
Definition: reduction.hpp:32