null_mask.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 #pragma once
17 
18 #include <cudf/types.hpp>
19 #include <cudf/utilities/span.hpp>
20 
21 #include <rmm/device_buffer.hpp>
22 
23 #include <vector>
24 
25 namespace cudf {
26 
43 
56 std::size_t bitmask_allocation_size_bytes(size_type number_of_bits,
57  std::size_t padding_boundary = 64);
58 
73 
85  size_type size,
86  mask_state state,
87  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
88 
101 void set_null_mask(bitmask_type* bitmask, size_type begin_bit, size_type end_bit, bool valid);
102 
120  bitmask_type const* mask,
121  size_type begin_bit,
122  size_type end_bit,
123  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
124 
137  column_view const& view,
138  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
139 
151 std::pair<rmm::device_buffer, size_type> bitmask_and(
152  table_view const& view,
153  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
154 
166 std::pair<rmm::device_buffer, size_type> bitmask_or(
167  table_view const& view,
168  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
169  // end of group
171 } // namespace cudf
cudf::bitmask_allocation_size_bytes
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 ...
cudf::bitmask_or
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...
cudf::size_type
int32_t size_type
Row index type for columns and tables.
Definition: types.hpp:84
cudf::bitmask_and
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...
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::num_bitmask_words
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.
cudf::create_null_mask
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.
cudf::bitmask_type
uint32_t bitmask_type
Bitmask type stored as 32-bit unsigned integer.
Definition: types.hpp:85
cudf::set_null_mask
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
cudf::mask_state
mask_state
Controls the allocation/initialization of a null mask.
Definition: types.hpp:178
device_buffer.hpp
cudf::table_view
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:154
cudf
cuDF interfaces
Definition: aggregation.hpp:34
cudf::state_null_count
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.
rmm::mr::device_memory_resource
cudf::copy_bitmask
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,...