From 41f88095a5ec6a348114b22de43f0ec9c8906fc3 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 4 Dec 2021 20:35:52 +0800 Subject: [PATCH] min_artiq: add round64, floor64, ceil64 --- nac3artiq/demo/min_artiq.py | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/nac3artiq/demo/min_artiq.py b/nac3artiq/demo/min_artiq.py index 354d2a2ab..9adf1667b 100644 --- a/nac3artiq/demo/min_artiq.py +++ b/nac3artiq/demo/min_artiq.py @@ -3,13 +3,20 @@ from functools import wraps from types import SimpleNamespace from numpy import int32, int64 from typing import Generic, TypeVar +from math import floor, ceil import nac3artiq -__all__ = ["KernelInvariant", "extern", "kernel", "portable", "nac3", - "ms", "us", "ns", - "print_int32", "print_int64", - "Core", "TTLOut", "parallel", "sequential", "virtual"] + +__all__ = [ + "KernelInvariant", "virtual", + "round64", "floor64", "ceil64", + "extern", "kernel", "portable", "nac3", + "ms", "us", "ns", + "print_int32", "print_int64", + "Core", "TTLOut", + "parallel", "sequential" +] T = TypeVar('T') @@ -21,6 +28,17 @@ class KernelInvariant(Generic[T]): class virtual(Generic[T]): pass + +def round64(x): + return round(x) + +def floor64(x): + return floor(x) + +def ceil64(x): + return ceil(x) + + import device_db core_arguments = device_db.device_db["core"]["arguments"]