[CustomOp]Add cpp_extension en doc (#31187)

* add cpp_extension en doc

* remove cuda_cflags and add optional in doc

* refine style

* fix indent problem

* add default None
test_model_benchmark_ci
Aurelius84 4 years ago committed by GitHub
parent e8cdb49aa9
commit 912022fa0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -32,7 +32,6 @@ dispatch_op = load(
sources=['dispatch_test_op.cc'],
extra_include_paths=paddle_includes, # add for Coverage CI
extra_cxx_cflags=extra_compile_args,
extra_cuda_cflags=extra_compile_args, # add for Coverage CI
verbose=True)

@ -36,7 +36,6 @@ multi_out_module = load(
sources=['multi_out_test_op.cc'],
extra_include_paths=paddle_includes, # add for Coverage CI
extra_cxx_cflags=extra_compile_args, # add for Coverage CI
extra_cuda_cflags=extra_compile_args, # add for Coverage CI
verbose=True)

@ -25,6 +25,5 @@ from . import cpp_extension
from . import extension_utils
__all__ = [
'CppExtension', 'CUDAExtension', 'BuildExtension', 'load', 'setup',
'get_build_directory'
'CppExtension', 'CUDAExtension', 'load', 'setup', 'get_build_directory'
]

File diff suppressed because it is too large Load Diff

@ -440,7 +440,22 @@ def is_cuda_file(path):
def get_build_directory(verbose=False):
"""
Return paddle extension root directory, default specific by `PADDLE_EXTENSION_DIR`
Return paddle extension root directory to put shared library. It could be specified by
``export PADDLE_EXTENSION_DIR=XXX`` . If not set, ``~/.cache/paddle_extension`` will be used
by default.
Returns:
The root directory of compiling customized operators.
Examples:
.. code-block:: python
from paddle.utils.cpp_extension import get_build_directory
build_dir = get_build_directory()
print(build_dir)
"""
root_extensions_directory = os.environ.get('PADDLE_EXTENSION_DIR')
if root_extensions_directory is None:

Loading…
Cancel
Save