cache: can't return list[int32] yet

This commit is contained in:
Sébastien Bourdeauducq 2024-02-20 13:27:00 +08:00
parent 6cb49ac89b
commit 923ca3377d

View File

@ -22,22 +22,23 @@ class CoreCache:
def __init__(self, dmgr, core_device="core"): def __init__(self, dmgr, core_device="core"):
self.core = dmgr.get(core_device) self.core = dmgr.get(core_device)
@kernel # NAC3TODO
def get(self, key: str) -> list[int32]: # @kernel
"""Extract a value from the core device cache. # def get(self, key: str) -> list[int32]:
After a value is extracted, it cannot be replaced with another value using # """Extract a value from the core device cache.
:meth:`put` until all kernel functions finish executing; attempting # After a value is extracted, it cannot be replaced with another value using
to replace it will result in a :class:`artiq.coredevice.exceptions.CacheError`. # :meth:`put` until all kernel functions finish executing; attempting
# to replace it will result in a :class:`artiq.coredevice.exceptions.CacheError`.
If the cache does not contain any value associated with ``key``, an empty list #
is returned. # If the cache does not contain any value associated with ``key``, an empty list
# is returned.
The value is not copied, so mutating it will change what's stored in the cache. #
# The value is not copied, so mutating it will change what's stored in the cache.
:param str key: cache key #
:return: a list of 32-bit integers # :param str key: cache key
""" # :return: a list of 32-bit integers
return cache_get(key) # """
# return cache_get(key)
@kernel @kernel
def put(self, key: str, value: list[int32]): def put(self, key: str, value: list[int32]):