Skip to content
YUENIX-FHEContact
Preview documentation. The YUENIX-FHE 1.0 API is in development and names or signatures may change before release. Request an evaluation

Execution model

A yuenix_context binds one GPU and one CUDA stream. Every plan, keyset, evaluator and ciphertext belongs to exactly one context. The context also stores the most recent error message, which yuenix_last_error(ctx) returns.

yuenix_context_options opt = {.struct_size = sizeof opt, .device = 0};
yuenix_context_create(&opt, &ctx);

Operations enqueue GPU work on the context’s stream and return without waiting for it. Encrypt, decrypt, serialize and deserialize synchronize as needed because they produce host data. Call yuenix_synchronize(ctx) before measuring time or reading results produced by other means.

Use one host thread per context at a time. Separate contexts may run on separate threads, or on separate GPUs.

Functions that return a new object take a T** output argument.

  • If *out is NULL, the library allocates a new object.
  • If *out points to an existing object of the right shape, the library overwrites it in place. This avoids allocations in loops.

Release every object with its _destroy function. Destroy objects before the context they belong to.

Each context keeps a GPU memory pool. Evaluation keys for N = 2^16 bootstrapping profiles occupy several gigabytes of GPU memory, and aggregation programs over many clients use most of a 32 GB GPU. Large aggregation programs keep part of their keys in host memory and move them to the GPU as needed. Their program report shows the GPU and host memory they use.

The library writes nothing to standard output. Register a callback with yuenix_set_log_callback to receive diagnostic messages.