min_artiq: add round64, floor64, ceil64

This commit is contained in:
Sebastien Bourdeauducq 2021-12-04 20:35:52 +08:00
parent c98f367f90
commit 41f88095a5
1 changed files with 22 additions and 4 deletions

View File

@ -3,13 +3,20 @@ from functools import wraps
from types import SimpleNamespace from types import SimpleNamespace
from numpy import int32, int64 from numpy import int32, int64
from typing import Generic, TypeVar from typing import Generic, TypeVar
from math import floor, ceil
import nac3artiq import nac3artiq
__all__ = ["KernelInvariant", "extern", "kernel", "portable", "nac3",
"ms", "us", "ns", __all__ = [
"print_int32", "print_int64", "KernelInvariant", "virtual",
"Core", "TTLOut", "parallel", "sequential", "virtual"] "round64", "floor64", "ceil64",
"extern", "kernel", "portable", "nac3",
"ms", "us", "ns",
"print_int32", "print_int64",
"Core", "TTLOut",
"parallel", "sequential"
]
T = TypeVar('T') T = TypeVar('T')
@ -21,6 +28,17 @@ class KernelInvariant(Generic[T]):
class virtual(Generic[T]): class virtual(Generic[T]):
pass pass
def round64(x):
return round(x)
def floor64(x):
return floor(x)
def ceil64(x):
return ceil(x)
import device_db import device_db
core_arguments = device_db.device_db["core"]["arguments"] core_arguments = device_db.device_db["core"]["arguments"]