charonloadΒΆ
This package provides the functionality to automatically build and load C++/CUDA extensions developed with CMake and PyTorch. A typical example on how to use this package is shown in the following:
# Add configuration somewhere at the top of the project
import charonload
charonload.module_config["my_cpp_cuda_ext"] = charonload.Config(
# All paths must be absolute
project_directory=pathlib.Path(__file__).parent / "<my_cpp_cuda_ext>",
build_directory="optional/build/directory/for/caching",
)
# From now on, "my_cpp_cuda_ext" can be used in this module and any other imported module
import my_cpp_cuda_ext
# ...