Create Engine

Engine(mode: str = 'cpu', *, use_bootstrap: bool = False, use_multiparty: bool = False, thread_count: int = 0, device_id: int = 0)
Creates an engine to execute operations.
  • Input:
    • mode: 'cpu', 'parallel', or 'gpu'. parallel refers to parallel processing using the CPU.
    • use_bootstrap: Whether to use bootstrap.
    • use_multiparty: Whether to use multiparty computation.
    • thread_count: Specifies the number of threads to use when mode is 'parallel' or 'gpu'.
    • device_id: Specifies which GPU to use when mode is 'gpu'.
  • Output:
    • Engine

use_bootstrap and use_multiparty cannot both be enabled in a single engine.

from desilofhe import Engine

engine1 = Engine()
engine2 = Engine(mode="parallel", use_multiparty=True, thread_count=256)
engine3 = Engine(mode="gpu", use_bootstrap=True, thread_count=512, decive_id=1)


Engine(max_level: int, mode: str = 'cpu', *, use_multiparty: bool = False, thread_count: int = 0, device_id: int = 0)

  • Input:
    • max_level: Specifies the maximum number of multiplications allowed.
    • mode: 'cpu', 'parallel', or 'gpu'. parallel refers to parallel processing using the CPU.
    • use_multiparty: Whether to use multiparty computation.
    • thread_count: Specifies the number of threads to use when mode is 'parallel' or 'gpu'.
    • device_id: Specifies which GPU to use when mode is 'gpu'.
  • Output
    • Engine
from desilofhe import Engine

engine1 = Engine(max_level=10)
engine2 = Engine(max_level=12, mode="parallel", thread_count=128)
engine3 = Engine(
    max_level=15, mode="gpu", use_multiparty=True, thread_count=512, decive_id=1
)


Engine(log_coeff_count: int, special_prime_count: int, mode: str = 'cpu', *, use_multiparty: bool = False, thread_count: int = 0, device_id: int = 0)

  • Input:
    • log_coeff_count: The logarithm of the ciphertext coefficient count. Can range from 13 to 17.
    • special_prime_count: The size of a single partition for key-switching.
    • mode: 'cpu', 'parallel', or 'gpu'. parallel refers to parallel processing using the CPU.
    • use_multiparty: Whether to use multiparty computation.
    • thread_count: Specifies the number of threads to use when mode is 'parallel' or 'gpu'.
    • device_id: Specifies which GPU to use when mode is 'gpu'.
  • Output
    • Engine
from desilofhe import Engine

engine1 = Engine(log_coeff_count=14, special_prime_count=1)
engine2 = Engine(
    log_coeff_count=15, special_prime_count=2, mode="parallel", thread_count=256
)
engine3 = Engine(
    log_coeff_count=16,
    special_prime_count=4,
    mode="gpu",
    use_multiparty=True,
    thread_count=512,
    decive_id=1,
)