to_cuda

Engine.to_cuda(data)
Move the data to the GPU if it is stored on the CPU. Note that this operation will throw an exception if the engine was not created in GPU mode.
  • Input:
    • Any data structures created through the engine.
  • Output:
    • None
from desilofhe import Engine

engine = Engine(mode="gpu")
secret_key = engine.create_secret_key()

assert secret_key.is_cuda

engine.to_cpu(secret_key)

assert not secret_key.is_cuda

engine.to_cuda(secret_key)

assert secret_key.is_cuda