Public Member Functions | Public Attributes | Static Private Attributes | List of all members
pybind11.setup_helpers.ParallelCompile Class Reference

Public Member Functions

S __enter__ (S self)
 
None __exit__ (self, *Any args)
 
None __init__ (self, str|None envvar=None, int default=0, int max=0, Callable[[str, str], bool] needs_recompile=no_recompile)
 
CCompilerMethod function (self)
 
S install (S self)
 

Public Attributes

 default
 
 envvar
 
 max
 
 needs_recompile
 

Static Private Attributes

 __slots__
 

Detailed Description

Make a parallel compile function. Inspired by
numpy.distutils.ccompiler.CCompiler.compile and cppimport.

This takes several arguments that allow you to customize the compile
function created:

envvar:
    Set an environment variable to control the compilation threads, like
    NPY_NUM_BUILD_JOBS
default:
    0 will automatically multithread, or 1 will only multithread if the
    envvar is set.
max:
    The limit for automatic multithreading if non-zero
needs_recompile:
    A function of (obj, src) that returns True when recompile is needed.  No
    effect in isolated mode; use ccache instead, see
    https://github.com/matplotlib/matplotlib/issues/1507/

To use::

    ParallelCompile("NPY_NUM_BUILD_JOBS").install()

or::

    with ParallelCompile("NPY_NUM_BUILD_JOBS"):
        setup(...)

By default, this assumes all files need to be recompiled. A smarter
function can be provided via needs_recompile.  If the output has not yet
been generated, the compile will always run, and this function is not
called.

Definition at line 372 of file setup_helpers.py.

Constructor & Destructor Documentation

◆ __init__()

None pybind11.setup_helpers.ParallelCompile.__init__ (   self,
str | None   envvar = None,
int   default = 0,
int   max = 0,
Callable[[str, str], bool]   needs_recompile = no_recompile 
)

Definition at line 410 of file setup_helpers.py.

Member Function Documentation

◆ __enter__()

S pybind11.setup_helpers.ParallelCompile.__enter__ ( S  self)

Definition at line 495 of file setup_helpers.py.

◆ __exit__()

None pybind11.setup_helpers.ParallelCompile.__exit__ (   self,
*Any  args 
)

Definition at line 499 of file setup_helpers.py.

◆ function()

CCompilerMethod pybind11.setup_helpers.ParallelCompile.function (   self)
Builds a function object usable as distutils.ccompiler.CCompiler.compile.

Definition at line 423 of file setup_helpers.py.

◆ install()

S pybind11.setup_helpers.ParallelCompile.install ( S  self)
Installs the compile function into distutils.ccompiler.CCompiler.compile.

Definition at line 488 of file setup_helpers.py.

Member Data Documentation

◆ __slots__

pybind11.setup_helpers.ParallelCompile.__slots__
staticprivate

Definition at line 408 of file setup_helpers.py.

◆ default

pybind11.setup_helpers.ParallelCompile.default

Definition at line 412 of file setup_helpers.py.

◆ envvar

pybind11.setup_helpers.ParallelCompile.envvar

Definition at line 411 of file setup_helpers.py.

◆ max

pybind11.setup_helpers.ParallelCompile.max

Definition at line 413 of file setup_helpers.py.

◆ needs_recompile

pybind11.setup_helpers.ParallelCompile.needs_recompile

Definition at line 414 of file setup_helpers.py.


The documentation for this class was generated from the following file:


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:16:46