is_cuda

LightPlainMatrix.is_cuda
Is True if the light 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_light_plain_matrix = gpu_engine.encode_to_light_plain_matrix(message)

assert gpu_light_plain_matrix.is_cuda

cpu_engine = Engine(slot_count=64, mode="cpu")
cpu_light_plain_matrix = cpu_engine.encode_to_light_plain_matrix(message)

assert not cpu_light_plain_matrix.is_cuda