Asynchronous setup (#514)

Cherry-picked a part of features from #167: now `Communicator::setup()`
is unneeded. `Communicator::sendMemory()` conducts the task inline, and
`Communicator::recvMemory()` and `Communicator::connect()` conducts the
task asynchronously without explicit setup.
This commit is contained in:
Changho Hwang
2025-05-08 15:01:51 -07:00
committed by GitHub
parent 8bc369ceb4
commit d636093336
7 changed files with 59 additions and 180 deletions

View File

@@ -29,9 +29,7 @@ extern void register_gpu_utils(nb::module_& m);
template <typename T>
void def_nonblocking_future(nb::handle& m, const std::string& typestr) {
std::string pyclass_name = std::string("NonblockingFuture") + typestr;
nb::class_<NonblockingFuture<T>>(m, pyclass_name.c_str())
.def("ready", &NonblockingFuture<T>::ready)
.def("get", &NonblockingFuture<T>::get);
nb::class_<NonblockingFuture<T>>(m, pyclass_name.c_str()).def("get", &NonblockingFuture<T>::get);
}
void register_core(nb::module_& m) {