bitset< Block, Allocator >

bitset< Block, Allocator >#

stdgpu: stdgpu::bitset< Block, Allocator >
stdgpu Latest
Efficient STL-like Data Structures on the GPU

Detailed Description

template<typename Block = bitset_default_type, typename Allocator = safe_device_allocator<Block>>
class stdgpu::bitset< Block, Allocator >

A class to model a bitset on the GPU.

Template Parameters
BlockThe internal bit block type
AllocatorThe allocator type

Differences to std::bitset:

  • Manual allocation and destruction of container required
  • set(), reset() and flip() return old state rather than reference to itself

Classes

class  reference
 

Public Types

using allocator_type = Allocator
 
using block_type = Block
 

Public Member Functions

 bitset () noexcept=default
 
bool all () const
 
template<typename ExecutionPolicy , STDGPU_DETAIL_OVERLOAD_IF(is_execution_policy_v< remove_cvref_t< ExecutionPolicy > >) >
bool all (ExecutionPolicy &&policy) const
 
bool any () const
 
template<typename ExecutionPolicy , STDGPU_DETAIL_OVERLOAD_IF(is_execution_policy_v< remove_cvref_t< ExecutionPolicy > >) >
bool any (ExecutionPolicy &&policy) const
 
index_t count () const
 
template<typename ExecutionPolicy , STDGPU_DETAIL_OVERLOAD_IF(is_execution_policy_v< remove_cvref_t< ExecutionPolicy > >) >
index_t count (ExecutionPolicy &&policy) const
 
STDGPU_HOST_DEVICE bool empty () const noexcept
 
void flip ()
 
STDGPU_DEVICE_ONLY bool flip (const index_t n)
 
template<typename ExecutionPolicy , STDGPU_DETAIL_OVERLOAD_IF(is_execution_policy_v< remove_cvref_t< ExecutionPolicy > >) >
void flip (ExecutionPolicy &&policy)
 
STDGPU_HOST_DEVICE allocator_type get_allocator () const noexcept
 
bool none () const
 
template<typename ExecutionPolicy , STDGPU_DETAIL_OVERLOAD_IF(is_execution_policy_v< remove_cvref_t< ExecutionPolicy > >) >
bool none (ExecutionPolicy &&policy) const
 
STDGPU_DEVICE_ONLY reference operator[] (const index_t n)
 
STDGPU_DEVICE_ONLY bool operator[] (const index_t n) const
 
void reset ()
 
STDGPU_DEVICE_ONLY bool reset (const index_t n)
 
template<typename ExecutionPolicy , STDGPU_DETAIL_OVERLOAD_IF(is_execution_policy_v< remove_cvref_t< ExecutionPolicy > >) >
void reset (ExecutionPolicy &&policy)
 
void set ()
 
STDGPU_DEVICE_ONLY bool set (const index_t n, const bool value=true)
 
template<typename ExecutionPolicy , STDGPU_DETAIL_OVERLOAD_IF(is_execution_policy_v< remove_cvref_t< ExecutionPolicy > >) >
void set (ExecutionPolicy &&policy)
 
STDGPU_HOST_DEVICE index_t size () const noexcept
 
STDGPU_DEVICE_ONLY bool test (const index_t n) const
 

Static Public Member Functions

static bitset createDeviceObject (const index_t &size, const Allocator &allocator=Allocator())
 
template<typename ExecutionPolicy , STDGPU_DETAIL_OVERLOAD_IF(is_execution_policy_v< remove_cvref_t< ExecutionPolicy > >) >
static bitset createDeviceObject (ExecutionPolicy &&policy, const index_t &size, const Allocator &allocator=Allocator())
 
static void destroyDeviceObject (bitset &device_object)
 
template<typename ExecutionPolicy , STDGPU_DETAIL_OVERLOAD_IF(is_execution_policy_v< remove_cvref_t< ExecutionPolicy > >) >
static void destroyDeviceObject (ExecutionPolicy &&policy, bitset &device_object)