is_cuda

MatrixMultiplicationKey.is_cuda
Is True if the matrix multiplication key is stored on the GPU, False otherwise.
  • Output
    • boolean
from desilofhe import Engine

gpu_engine = Engine(slot_count=64, mode="gpu")
gpu_secret_key = gpu_engine.create_secret_key()
gpu_matrix_multiplication_key = gpu_engine.create_matrix_multiplication_key(
    gpu_secret_key
)

assert gpu_matrix_multiplication_key.is_cuda

cpu_engine = Engine(slot_count=64, mode="cpu")
cpu_secret_key = cpu_engine.create_secret_key()
cpu_matrix_multiplication_key = cpu_engine.create_matrix_multiplication_key(
    cpu_secret_key
)

assert not cpu_matrix_multiplication_key.is_cuda