Compile
caution
This API is still in the internal testing phase.
torchpipe.utils.cpp_extension.load
Compile and load a C++ file.
def load(name="",
sources=[],
rebuild_if_exist=True,
is_python_module=False,
extra_include_paths=[],
extra_ldflags=[],
with_cuda=True)
参数
- name - Name of the compiled dynamic library. It can be empty and will be automatically generated based on the source file name.
- sources - List of C++ source files to be compiled.
- rebuild_if_exist - Whether to restart the compilation process if the dynamic library already exists. Note: even if it is set to True, the source code may not be recompiled if it has not changed.
- is_python_module - Whether it is a Python module. If it is, a Python library will be returned.
- extra_include_paths - Additional header file paths.
- extra_ldflags - Additional ldflags.
- with_cuda - Whether there is CUDA-related code.