cuDDL
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
cuddl::detail::reference_index_digest Struct Reference

Public Member Functions

Result< void > bytes (void const *data, size_t size)
 
template<typename T >
Result< void > value (T item)
 
template<typename T >
Result< void > words (std::span< T const > items)
 

Public Attributes

uint64_t digest = 0
 

Detailed Description

Definition at line 14 of file reference_index_file.cuh.

Member Function Documentation

◆ bytes()

Result< void > cuddl::detail::reference_index_digest::bytes ( void const *  data,
size_t  size 
)
inline

Definition at line 17 of file reference_index_file.cuh.

17 {
18 digest = xxhash64(static_cast<uint8_t const*>(data), size, digest);
19 return Ok();
20 }
__host__ __device__ uint64_t xxhash64(const uint8_t *bytes, uint64_t size, uint64_t seed)
Computes xxHash-64 over a byte range without allocating or copying it.
Definition hash.cuh:63
Result< void > Ok() noexcept
Success return for Result<void>; same as return {}.
Definition error.hpp:181
Here is the call graph for this function:
Here is the caller graph for this function:

◆ value()

template<typename T >
Result< void > cuddl::detail::reference_index_digest::value ( T  item)
inline

Definition at line 23 of file reference_index_file.cuh.

23 {
24 item = database_file_little_endian(item);
25 return bytes(&item, sizeof(item));
26 }
T database_file_little_endian(T value)
Result< void > bytes(void const *data, size_t size)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ words()

template<typename T >
Result< void > cuddl::detail::reference_index_digest::words ( std::span< T const >  items)
inline

Definition at line 29 of file reference_index_file.cuh.

29 {
30 if constexpr (std::endian::native == std::endian::little) {
31 return bytes(items.data(), items.size_bytes());
32 } else {
33 std::vector<T> little_endian(items.begin(), items.end());
34 for (auto& item : little_endian) {
35 item = database_file_little_endian(item);
36 }
37 return bytes(little_endian.data(), items.size_bytes());
38 }
39 }
auto const items
Definition kernels.cuh:1549
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ digest

uint64_t cuddl::detail::reference_index_digest::digest = 0

Definition at line 15 of file reference_index_file.cuh.


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