콘텐츠로 이동

엔진 생성

기본

GLEngine(mode: str = 'cpu', *, thread_count: int = 0, device_id: int = 0)

  • 인풋:
    • mode: cpu, gpu
    • thread_count: mode가 gpu일 때 스레드를 몇 개 사용할지 지정
    • device_id: mode가 gpu일 경우 몇 번 gpu를 사용할지 지정
  • 아웃풋
    • GLEngine
from desilofhe import GLEngine

engine1 = GLEngine()
engine2 = GLEngine(mode="gpu", thread_count=512, device_id=1)

행렬 형상 지정

GLEngine(shape: tuple[int, int, int], mode: str = 'cpu', *, thread_count: int = 0, device_id: int = 0)

  • 인풋:
    • shape: 암호화 단위 행렬 형상 지정
      • 현재 지원되는 형상 목록:
        • (256, 16, 16)
        • (16, 256, 256)
        • (4, 1024, 1024)
        • (256, 32, 32)
        • (16, 512, 512)
        • (4, 2048, 2048)
        • (256, 64, 64)
    • mode: cpu, gpu.
    • thread_count: mode가 gpu일 때 스레드를 몇 개 사용할지 지정
    • device_id: mode가 gpu일 경우 몇 번 gpu를 사용할지 지정
  • 아웃풋
    • GLEngine
from desilofhe import GLEngine

engine1 = GLEngine(shape=(16, 256, 256))
engine2 = GLEngine(
    shape=(16, 512, 512),
    mode="gpu",
    thread_count=512,
    device_id=1,
)