mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Adds ability to JIT compile C++ extensions from strings
>>> from torch.utils.cpp_extension import load_inline
>>> source = '''
at::Tensor sin_add(at::Tensor x, at::Tensor y) {
return x.sin() + y.sin();
}
'''
>>> module = load_inline(name='inline_extension', cpp_sources=source, functions='sin_add')
Fixes #7012
* Inline JIT C++ Extensions
* jit_compile_sources -> jit_compile
* Split up test into CUDA and non-CUDA parts
* Documentation fixes
* Implement prologue and epilogue generation
* Remove extra newline
* Only create the CUDA source file when cuda_sources is passed
13 lines
374 B
ReStructuredText
13 lines
374 B
ReStructuredText
torch.utils.cpp_extension
|
|
=========================
|
|
|
|
.. currentmodule:: torch.utils.cpp_extension
|
|
.. autofunction:: CppExtension
|
|
.. autofunction:: CUDAExtension
|
|
.. autofunction:: BuildExtension
|
|
.. autofunction:: load
|
|
.. autofunction:: load_inline
|
|
.. autofunction:: include_paths
|
|
.. autofunction:: check_compiler_abi_compatibility
|
|
.. autofunction:: verify_ninja_availability
|