https://github.com/pytorch/extension-cpp
C++ extensions in PyTorch
https://github.com/pytorch/extension-cpp
Last synced: 1 day ago
JSON representation
C++ extensions in PyTorch
- Host: GitHub
- URL: https://github.com/pytorch/extension-cpp
- Owner: pytorch
- Created: 2018-03-03T10:46:31.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-01-24T16:53:24.000Z (3 months ago)
- Last Synced: 2025-04-06T10:06:39.423Z (8 days ago)
- Language: Python
- Size: 40 KB
- Stars: 1,078
- Watchers: 34
- Forks: 226
- Open Issues: 48
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- Awesome-pytorch-list-CNVersion - extension-cpp
- Awesome-pytorch-list - extension-cpp
README
# C++/CUDA Extensions in PyTorch
An example of writing a C++/CUDA extension for PyTorch. See
[here](https://pytorch.org/tutorials/advanced/cpp_custom_ops.html) for the accompanying tutorial.
This repo demonstrates how to write an example `extension_cpp.ops.mymuladd`
custom op that has both custom CPU and CUDA kernels.The examples in this repo work with PyTorch 2.4+.
To build:
```
pip install --no-build-isolation -e .
```To test:
```
python test/test_extension.py
```## Authors
[Peter Goldsborough](https://github.com/goldsborough), [Richard Zou](https://github.com/zou3519)