This repository is a boilerplate for writing C++ / CUDA extension for PyTorch / libtorch.
-
LibTorch:
https://download.pytorch.org/libtorch/cu128/libtorch-cxx11-abi-shared-with-deps-2.7.0%2Bcu128.zip -
GoogleTest:
https:////github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
Place them / symbolic link them to CUDAExtension/lib/libtorch and CUDAExtension/lib/googletest respectively.
-
Run
docker compose buildto build the docker image for development environment on your local machine. -
Use VSCode devcontainer feature to launch workspace and work.
See ./CUDAExtension/README.md.
- After building the
CUDAExtensionpackage, runpython -m PythonSrc.<your_script_name>and useimport CUDAExtensionin script to access the built extension.