You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PyBind11 allows for efficient data passing between C++ and python, particularly in cases where the memory is owned by the C++ program, and the data is passed upstream to Python. This can be implemented in a simple way via either the def_buffer definition, or alternatively by casting the data into a py::capsule which seems to be a non-owning memory container. References:
This issue would depend on whether part 4 of #136 is carried out, as removing the std::vector completely, would result in having just a std::span which is a non-owning "memory-view" to the host-visible GPU memory, and there may be hidden nuances when passing this non-owning view to python as a buffer (including non-explicit performance nuances that may be better to make explicit, such as by recommending to minimise copies to/from tensors).
The text was updated successfully, but these errors were encountered:
PyBind11 allows for efficient data passing between C++ and python, particularly in cases where the memory is owned by the C++ program, and the data is passed upstream to Python. This can be implemented in a simple way via either the
def_buffer
definition, or alternatively by casting the data into apy::capsule
which seems to be a non-owning memory container. References:def_buffer
https://pybind11.readthedocs.io/en/stable/advanced/pycpp/numpy.htmlpy::capsule
This issue would depend on whether part 4 of #136 is carried out, as removing the
std::vector
completely, would result in having just astd::span
which is a non-owning "memory-view" to the host-visible GPU memory, and there may be hidden nuances when passing this non-owning view to python as a buffer (including non-explicit performance nuances that may be better to make explicit, such as by recommending to minimise copies to/from tensors).The text was updated successfully, but these errors were encountered: