trait PRNGEngine(Movable):
@staticmethod
fn ndim() -> Int:
"""SIMD size."""
pass
fn next_scalar(inout self) -> UInt64:
"""Get only a single value from the generator."""
pass
fn next(inout self) -> SIMD[DType.uint64, Self.ndim()]:
"""Get Self.ndim() values from the generator."""
pass
struct DummyEngine[n: Int](PRNGEngine):
@staticmethod
fn ndim() -> Int:
"""SIMD size."""
return 2
fn next_scalar(inout self) -> UInt64:
"""Get only a single value from the generator."""
return 42
fn next(inout self) -> SIMD[DType.uint64, Self.ndim()]:
"""Get Self.ndim() values from the generator."""
var res: SIMD[DType.uint64, Self.ndim()] = 42
return res
trait PRNGEngine(Movable):
@staticmethod
fn ndim() -> Int:
"""SIMD size."""
pass
fn next_scalar(inout self) -> UInt64:
"""Get only a single value from the generator."""
pass
fn next(inout self) -> SIMD[DType.uint64, Self.ndim()]:
"""Get Self.ndim() values from the generator."""
pass
struct DummyEngine[n: Int](PRNGEngine):
@staticmethod
fn ndim() -> Int:
"""SIMD size."""
return 2
fn next_scalar(inout self) -> UInt64:
"""Get only a single value from the generator."""
return 42
fn next(inout self) -> SIMD[DType.uint64, Self.ndim()]:
"""Get Self.ndim() values from the generator."""
var res: SIMD[DType.uint64, Self.ndim()] = 42
return res