|
| | GrottoDcf (Prg prg) |
| | Configure the pseudorandom generator.
|
| void | Gen (cuda::std::span< int4 > cws, In &tr, cuda::std::span< const int4, 2 > s0s, In a, size_t stride=1) |
| | Generate split DPF correction words with beta equal to zero.
|
| bool | Eval (bool b, int4 s0, cuda::std::span< const int4 > cws, In tr, In x, size_t stride=1) |
| | Evaluate a comparison share along x's path from split correction words.
|
| void | Preprocess (bool b, int4 s0, cuda::std::span< const int4 > cws, In tr, bool p[], int par_depth=0, size_t stride=1) |
| | Expand split leaf control bits and build a parity tree in caller-owned host storage.
|
| OwnedParityTree< GrottoDcf > | PreprocessOwned (bool b, int4 s0, cuda::std::span< const int4 > cws, In tr, int par_depth=0, size_t stride=1) |
| | Allocate and populate a parity tree from split correction words in host storage.
|
| void | EvalAll (bool b, int4 s0, cuda::std::span< const int4 > cws, In tr, bool ys[], int par_depth=0, size_t stride=1) |
| | Evaluate comparison shares for the full domain from split correction words.
|
template<int frontier_depth = 16, int threads_per_block = 256>
requires (in_bits < sizeof(size_t) * 8) |
| cudaError_t | PreprocessGpu (bool b, int4 s0, cuda::std::span< const int4 > cws, In tr, cuda::std::span< bool > tree, cudaStream_t stream=0, size_t stride=1) const |
| | Build a parity tree on the GPU from split device correction words.
|
template<int frontier_depth = 16, int threads_per_block = 256>
requires (in_bits < sizeof(size_t) * 8) |
| cudaError_t | EvalAllGpu (bool b, int4 s0, cuda::std::span< const int4 > cws, In tr, cuda::std::span< bool > ys, cudaStream_t stream=0, size_t stride=1) const |
| | Evaluate all comparison shares on the GPU from split device correction words.
|
template<int in_bits, typename Prg, typename In = uint>
requires (ValidForInputBits<In, in_bits> &&
Prgable<Prg, 2>)
class fss::GrottoDcf< in_bits, Prg, In >
2-party DCF scheme over F2 from standard DPF (Grotto construction).
- Template Parameters
-
| in_bits | Input domain bit size. |
| Prg | See Prgable. Must satisfy Prgable<Prg, 2> (same as DPF). |
| In | Type for the input domain. From uint8_t to __uint128_t. |
Gen() and scalar Eval() are callable from host and device when the backend supports the execution space and all accessed storage is accessible there. EvalAll() is a host operation.
template<int in_bits, typename Prg, typename In>
requires (in_bits < sizeof(size_t) * 8)
template<int frontier_depth, int threads_per_block>
requires (in_bits < sizeof(size_t) * 8)
| cudaError_t fss::GrottoDcf< in_bits, Prg, In >::EvalAllGpu |
( |
bool | b, |
|
|
int4 | s0, |
|
|
cuda::std::span< const int4 > | cws, |
|
|
In | tr, |
|
|
cuda::std::span< bool > | ys, |
|
|
cudaStream_t | stream = 0, |
|
|
size_t | stride = 1 ) const |
|
inline |
Evaluate all comparison shares on the GPU from split device correction words.
Follows the leaf-prefix route, as in the Cw form. Per-party shares are not comparable across routes.
Layer l is read from cws[l*stride] and tr carries the right-control bits, bit l for layer l, as in the Cw form. The host instance passes its PRG value to the expansion kernel. Temporary scan storage is queried, allocated, and released on stream. No backend upload, deep copy, synchronization, or event management occurs.
- Parameters
-
| b | Party index. |
| s0 | This party's seed, passed by value. |
| cws | Device correction words, layer l at index l*stride. |
| tr | Packed right-control bits, bit l for layer l. |
| ys | Device output of at least 2^in_bits bool entries, in input order. |
| stream | Stream used for expansion, scanning, and temporary storage. |
| stride | Positive stride between correction entries. |
- Precondition
- stride > 0 and cws holds at least in_bits*stride+1 elements.
-
Buffers and referenced backend resources remain valid until work completes.
- Returns
- The first immediate CUDA failure, including allocation or release. Invalid buffers/counts return cudaErrorInvalidValue. Work is asynchronous.
template<int in_bits, typename Prg, typename In>
requires (in_bits < sizeof(size_t) * 8)
Evaluate all comparison shares from a device parity tree.
Scans the stored leaves without PRG calls. Temporary scan storage is queried, allocated, and released on stream, without implicit synchronization.
- Parameters
-
| pt | Borrowed tree produced by PreprocessGpu(), with 2^(in_bits+1)-1 entries. |
| ys | Device output of at least 2^in_bits bool entries, disjoint from pt. |
| stream | Stream used for the scan and temporary storage. |
- Precondition
- Input and output storage remain valid until queued work completes.
- Returns
- The first immediate CUDA failure. Invalid buffers/counts return cudaErrorInvalidValue. Completion remains asynchronous.
template<int in_bits, typename Prg, typename In>
requires (in_bits < sizeof(size_t) * 8)
template<int frontier_depth, int threads_per_block>
requires (in_bits < sizeof(size_t) * 8)
| cudaError_t fss::GrottoDcf< in_bits, Prg, In >::PreprocessGpu |
( |
bool | b, |
|
|
int4 | s0, |
|
|
cuda::std::span< const int4 > | cws, |
|
|
In | tr, |
|
|
cuda::std::span< bool > | tree, |
|
|
cudaStream_t | stream = 0, |
|
|
size_t | stride = 1 ) const |
|
inline |
Build a parity tree on the GPU from split device correction words.
Layer l is read from cws[l*stride] and tr carries the right-control bits, bit l for layer l, as in the Cw form. The PRG value is passed to the kernel; any resources it references must already be device-accessible. No allocation, upload, deep copy, or synchronization is performed.
- Parameters
-
| b | Party index. |
| s0 | This party's initial seed, passed by value to the kernel. |
| cws | Device correction words, layer l at index l*stride. |
| tr | Packed right-control bits, bit l for layer l. |
| tree | Device output of at least 2^(in_bits+1)-1 bool entries. |
| stream | Stream on the device owning the referenced resources. |
| stride | Positive stride between correction entries. |
- Precondition
- stride > 0 and cws holds at least in_bits*stride+1 elements.
-
Tree element counts and byte counts fit size_t.
-
Buffers and backend resources remain valid until queued work completes.
- Returns
- Immediate CUDA status. Invalid buffers or unaddressable counts return cudaErrorInvalidValue; oversized grids return cudaErrorInvalidConfiguration. Work remains asynchronous, and execution errors are observed on the stream.