is_cuda

PlainMatrix.is_cuda
Is True if the plain matrix is stored on the GPU, False otherwise.
  • Output
    • boolean
import numpy as np

from desilofhe import Engine

message = np.arange(64 * 64).reshape(64, 64)

gpu_engine = Engine(slot_count=64, mode="gpu")
gpu_plain_matrix = gpu_engine.encode_to_plain_matrix(message)

assert gpu_plain_matrix.is_cuda

cpu_engine = Engine(slot_count=64, mode="cpu")
cpu_plain_matrix = cpu_engine.encode_to_plain_matrix(message)

assert not cpu_plain_matrix.is_cuda