cuDDL
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
cuddl::packed_pairwise_counts Struct Reference

One pair's exact bucket comparison counts in 64 bits, the storage and transfer form of batch-search results. More...

Public Member Functions

__host__ __device__ constexpr pairwise_counts unpack (uint32_t bucket_count) const noexcept
 

Static Public Member Functions

static __host__ __device__ constexpr packed_pairwise_counts pack (uint32_t lower, uint32_t equal, uint32_t higher) noexcept
 

Public Attributes

uint64_t bits {}
 

Friends

bool operator== (packed_pairwise_counts const &, packed_pairwise_counts const &)=default
 

Detailed Description

One pair's exact bucket comparison counts in 64 bits, the storage and transfer form of batch-search results.

Lower occupies bits 0-20, equal bits 21-41 and higher bits 42-63; both-empty is the bucket count minus the three, so every supported bucket count (at most 2^13) fits.

Definition at line 48 of file pairwise_counts.cuh.

Member Function Documentation

◆ pack()

static __host__ __device__ constexpr packed_pairwise_counts cuddl::packed_pairwise_counts::pack ( uint32_t  lower,
uint32_t  equal,
uint32_t  higher 
)
inlinestaticconstexprnoexcept

Definition at line 52 of file pairwise_counts.cuh.

52 {
53 return {
54 static_cast<uint64_t>(lower) | (static_cast<uint64_t>(equal) << 21U) |
55 (static_cast<uint64_t>(higher) << 42U)
56 };
57 }

◆ unpack()

__host__ __device__ constexpr pairwise_counts cuddl::packed_pairwise_counts::unpack ( uint32_t  bucket_count) const
inlineconstexprnoexcept

Definition at line 59 of file pairwise_counts.cuh.

61 {
62 constexpr uint64_t field = (uint64_t{1} << 21U) - 1U;
63 auto const lower = static_cast<uint32_t>(bits & field);
64 auto const equal = static_cast<uint32_t>((bits >> 21U) & field);
65 auto const higher = static_cast<uint32_t>(bits >> 42U);
66 return {
67 .lower = lower,
68 .equal = equal,
69 .higher = higher,
70 .both_empty = bucket_count - lower - equal - higher,
71 };
72 }
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( packed_pairwise_counts const &  ,
packed_pairwise_counts const &   
)
friend

Member Data Documentation

◆ bits

uint64_t cuddl::packed_pairwise_counts::bits {}

Definition at line 49 of file pairwise_counts.cuh.

49{};

The documentation for this struct was generated from the following file: