Skip to content

Create Engine

Default engine

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

  • Input:
    • mode: cpu, or gpu.
    • thread_count: Specifies the number of threads to use when the mode is gpu.
    • device_id: Specifies which GPU to use when the mode is gpu.
  • Output:
    • GLEngine
from desilofhe import GLEngine

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

Create with Shape

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

  • Input:
    • shape: Specifies the engine matrix shape.
      • List of currently supported shapes:
        • (256, 16, 16)
        • (16, 256, 256)
        • (4, 1024, 1024)
        • (256, 32, 32)
        • (16, 512, 512)
        • (4, 2048, 2048)
        • (256, 64, 64)
    • mode: cpu, or gpu.
    • thread_count: Specifies the number of threads to use when the mode is gpu.
    • device_id: Specifies which GPU to use when the mode is gpu.
  • Output
    • 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,
)