Operators#

cuPQC-NTT operators are used to describe the transform to be performed and configure execution. They are combined via addition (+) to form a cuPQC-NTT descriptor.

Description Operators#

Algorithm#

template<algorithm Alg>
Algorithm()#

Sets the algorithm Alg to use. Valid values are:

enum algorithm#
enumerator NTT#

Number Theoretic Transform.

There is no default value.

Direction#

template<nttDirection Dir>
Direction()#

Selects the transform direction. Valid values are:

enum nttDirection#
enumerator FORWARD#

Maps the length-N coefficient sequence to evaluation form.

enumerator INVERSE#

Maps evaluation form back to coefficient form.

Default: Direction<nttDirection::FORWARD>.

Precision#

template<typename T>
Precision()#

Sets the element type T for coefficients and the prime modulus. The type parameter T must be one of the following standard fixed-width unsigned integer types (<cstdint>):

type std::uint16_t#

Fixed-width unsigned 16-bit integer element type.

type std::uint32_t#

Fixed-width unsigned 32-bit integer element type.

type std::uint64_t#

Fixed-width unsigned 64-bit integer element type.

There is no default; a precision type must be specified explicitly. See cuPQC-NTT: Number Theoretic Transform for supported transform lengths per type.

Size#

template<unsigned int N>
Size()#

Sets the transform length N.

See cuPQC-NTT: Number Theoretic Transform for supported transform lengths, staging, and precision limits.

Default: Size<2048>.

SubSize#

template<unsigned int M>
SubSize()#

Optional. Selects staged execution when present in the descriptor. Decomposes an N-point NTT into two passes: the first stage uses K = N/M consecutive elements per block, and the second stage uses M strided elements per block. Omit for single-stage execution.

See cuPQC-NTT: Number Theoretic Transform for supported (N, SubSize<M>) combinations (Staged NTT limits).

Execution Operators#

Block#

Block()#

Specifies block-level execution: one CUDA block runs one length-N transform.

Requires the BlockDim operator.

BlockDim#

template<unsigned int X, unsigned int Y = 1, unsigned int Z = 1>
BlockDim(
)#

Number of threads per block.

Default: BlockDim<128>.

Descriptor static members#

These static constexpr members are on the instantiated NTT descriptor type. In the declarations below, NTT is a placeholder for that type.

static constexpr auto NTT::Size#

The transform length N, from the Size operator.

static constexpr auto NTT::BlockDim#

The configured number of threads per block; use as the second argument to the kernel launch triple-chevron.