is_cuda

Ciphertext.is_cuda
암호문이 GPU에 저장되어 있으면 True이고, 그렇지 않으면 False입니다.
  • 아웃풋
    • boolean
from desilofhe import Engine

message = [1, 2, 3]

gpu_engine = Engine(mode="gpu")
gpu_secret_key = gpu_engine.create_secret_key()
gpu_public_key = gpu_engine.create_public_key(gpu_secret_key)
gpu_ciphertext = gpu_engine.encrypt(message, gpu_public_key)

assert gpu_ciphertext.is_cuda

cpu_engine = Engine(mode="cpu")
cpu_secret_key = cpu_engine.create_secret_key()
cpu_public_key = cpu_engine.create_public_key(cpu_secret_key)
cpu_ciphertext = cpu_engine.encrypt(message, cpu_public_key)

assert not cpu_ciphertext.is_cuda