null_mask.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2023, 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 #pragma once
17 
18 #include <cudf/types.hpp>
19 #include <cudf/utilities/span.hpp>
20 
21 #include <rmm/device_buffer.hpp>
23 
24 #include <vector>
25 
26 namespace cudf {
27 
46 
59 std::size_t bitmask_allocation_size_bytes(size_type number_of_bits,
60  std::size_t padding_boundary = 64);
61 
76 
88  size_type size,
89  mask_state state,
90  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
91 
104 void set_null_mask(bitmask_type* bitmask, size_type begin_bit, size_type end_bit, bool valid);
105 
123  bitmask_type const* mask,
124  size_type begin_bit,
125  size_type end_bit,
126  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
127 
140  column_view const& view,
141  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
142 
154 std::pair<rmm::device_buffer, size_type> bitmask_and(
155  table_view const& view,
156  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
157 
169 std::pair<rmm::device_buffer, size_type> bitmask_or(
170  table_view const& view,
171  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
172 
188 cudf::size_type null_count(bitmask_type const* bitmask, size_type start, size_type stop); // end of group
190 } // namespace cudf
A non-owning, immutable view of device data as a column of elements, some of which may be null as ind...
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:187
void set_null_mask(bitmask_type *bitmask, size_type begin_bit, size_type end_bit, bool valid)
Sets a pre-allocated bitmask buffer to a given state in the range [begin_bit, end_bit)
rmm::device_buffer copy_bitmask(bitmask_type const *mask, size_type begin_bit, size_type end_bit, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Creates a device_buffer from a slice of bitmask defined by a range of indices [begin_bit,...
cudf::size_type null_count(bitmask_type const *bitmask, size_type start, size_type stop)
Given a validity bitmask, counts the number of null elements (unset bits) in the range [start,...
std::size_t bitmask_allocation_size_bytes(size_type number_of_bits, std::size_t padding_boundary=64)
Computes the required bytes necessary to represent the specified number of bits with a given padding ...
size_type state_null_count(mask_state state, size_type size)
Returns the null count for a null mask of the specified state representing size elements.
std::pair< rmm::device_buffer, size_type > bitmask_and(table_view const &view, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Performs bitwise AND of the bitmasks of columns of a table. Returns a pair of resulting mask and coun...
rmm::device_buffer create_null_mask(size_type size, mask_state state, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Creates a device_buffer for use as a null value indicator bitmask of a column.
std::pair< rmm::device_buffer, size_type > bitmask_or(table_view const &view, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Performs bitwise OR of the bitmasks of columns of a table. Returns a pair of resulting mask and count...
size_type num_bitmask_words(size_type number_of_bits)
Returns the number of bitmask_type words required to represent the specified number of bits.
int32_t size_type
Row index type for columns and tables.
Definition: types.hpp:80
uint32_t bitmask_type
Bitmask type stored as 32-bit unsigned integer.
Definition: types.hpp:81
mask_state
Controls the allocation/initialization of a null mask.
Definition: types.hpp:165
cuDF interfaces
Definition: aggregation.hpp:34
Type declarations for libcudf.