Browse Source

docs for numba and cuda

devel
Stefan Holst 4 years ago
parent
commit
ee30898cef
  1. 4
      docs/miscellaneous.rst
  2. 11
      src/kyupy/__init__.py

4
docs/miscellaneous.rst

@ -1,10 +1,10 @@ @@ -1,10 +1,10 @@
Miscellaneous
=============
.. automodule:: kyupy.techlib
.. automodule:: kyupy
:members:
.. automodule:: kyupy
.. automodule:: kyupy.techlib
:members:

11
src/kyupy/__init__.py

@ -1,8 +1,8 @@ @@ -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: @@ -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.')

Loading…
Cancel
Save