From ee30898cef3bd04c18eec33d98a101a80c9b28c7 Mon Sep 17 00:00:00 2001 From: Stefan Holst Date: Sat, 16 Jan 2021 13:35:20 +0900 Subject: [PATCH] docs for numba and cuda --- docs/miscellaneous.rst | 4 ++-- src/kyupy/__init__.py | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/miscellaneous.rst b/docs/miscellaneous.rst index 08da343..fff469f 100644 --- a/docs/miscellaneous.rst +++ b/docs/miscellaneous.rst @@ -1,10 +1,10 @@ Miscellaneous ============= -.. automodule:: kyupy.techlib +.. automodule:: kyupy :members: -.. automodule:: kyupy +.. automodule:: kyupy.techlib :members: diff --git a/src/kyupy/__init__.py b/src/kyupy/__init__.py index 2a12c78..8bbfc9f 100644 --- a/src/kyupy/__init__.py +++ b/src/kyupy/__init__.py @@ -1,8 +1,8 @@ """A package for processing and analysis of non-hierarchical gate-level VLSI designs. The kyupy package itself contains a logger and other simple utility functions. -In addition, it defines a ``numba`` and a ``cuda`` module that point to the actual modules -if they are available and point to mocks if numba is not installed. +In addition, it defines a ``numba`` and a ``cuda`` objects that point to the actual packages +if they are available and otherwise point to mocks. """ import time @@ -202,5 +202,12 @@ if importlib.util.find_spec('numba') is not None: cuda = MockCuda() else: numba = MockNumba() + """If Numba is available on the system, it is the actual ``numba`` package. + Otherwise, it simply defines an ``njit`` decorator that does nothing. + """ cuda = MockCuda() + """If Numba is installed and Cuda GPUs are available, it is the actual ``numba.cuda`` package. + Otherwise, it is an object that defines basic methods and decorators so that cuda-code can still + run in the Python interpreter. + """ log.warn('Numba unavailable. Falling back to pure Python.')