Metadata-Version: 2.4
Name: gpuastar-cpp
Version: 0.1.0
Summary: C++ backend for GPUAStar
Author-Email: Misagh Soltani <msoltani@email.sc.edu>
License-Expression: MIT
License-File: LICENSE
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: C++
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Typing :: Typed
Project-URL: GitHub, https://github.com/misaghsoltani/GPUAStar
Requires-Python: <3.15,>=3.10
Requires-Dist: gpuastar==0.1.0
Requires-Dist: jinja2<4,>=3.1.2
Requires-Dist: numpy<2,>=1.26; platform_system == "Darwin" and platform_machine == "x86_64" and python_version < "3.13"
Requires-Dist: numpy<3,>=2.0.0; python_version < "3.13" and (platform_system != "Darwin" or platform_machine != "x86_64")
Requires-Dist: numpy<3,>=2.1; python_version >= "3.13" and python_version < "3.14"
Requires-Dist: numpy<3,>=2.3.2; python_version >= "3.14"
Requires-Dist: setuptools<82,>=69
Requires-Dist: torch<2.7,>=2.6; implementation_name == "cpython" and python_version < "3.14" and ((platform_system == "Linux" and platform_machine == "x86_64") or (platform_system == "Darwin" and platform_machine == "arm64") or (platform_system == "Windows" and platform_machine == "AMD64"))
Requires-Dist: torch<2.12,>=2.11; implementation_name == "cpython" and python_version < "3.15" and ((platform_system == "Linux" and platform_machine == "aarch64") or (python_version >= "3.14" and ((platform_system == "Linux" and platform_machine == "x86_64") or (platform_system == "Darwin" and platform_machine == "arm64") or (platform_system == "Windows" and platform_machine == "AMD64"))))
Requires-Dist: typing-extensions>=4.12
Description-Content-Type: text/markdown

# gpuastar-cpp

`gpuastar-cpp` packages the C++ weighted A\* solvers as a nanobind extension module that is imported as the Python package `gpuastar_cpp`. It registers the `cpp` backend through the `gpuastar.backends` entry-point group.

The extension exposes two solver entry points:

- `run_weighted_astar`: the CPU solver in [cxx/parallel_weighted_astar.cpp](cxx/parallel_weighted_astar.cpp), parallelized with OpenMP. It evaluates the heuristic through an AOTInductor-compiled model package, loaded by [cxx/aoti_manifest.cpp](cxx/aoti_manifest.cpp) and [cxx/aoti_heuristic.cpp](cxx/aoti_heuristic.cpp).
- `run_torch_gpu_astar`: the GPU solver in [cxx/torch_gpu_astar.cpp](cxx/torch_gpu_astar.cpp), written against the LibTorch C++ API. It keeps the open list, the closed set, and the state data in device tensors.

## Environments

The package contains no concrete search domains. Environments are provided by plugin packages through the `gpuastar_cpp.environments` entry-point group. At import time, `gpuastar_cpp` passes a registrar PyCapsule to each plugin, and the plugin registers its compiled environment factories through the interface declared in [cxx/environment_registry.h](cxx/environment_registry.h). The `gpuastar-experiments-cpp` package in [../experiments/cpp/](../experiments/cpp/) provides the example domains this way, and third-party packages can supply additional domains through the same group.

## Building

In a source checkout, the extension is built with:

```bash
pixi run -e dev cpp-build-from-scratch
```

After changing the public headers in `cxx/`, also rebuild the plugin packages that compile against them. For the in-repo example plugin, remove `experiments/cpp/build` and re-run `pixi install -e dev`.
