# How to extend Numba so it supports pybind11-wrapped C++ struct?

**URL:** https://numba.discourse.group/t/how-to-extend-numba-so-it-supports-pybind11-wrapped-c-struct/1419
**Category:** Support: How do I do ...?
**Created:** [June 29, 2022, 2:29pm UTC](https://numba.discourse.group/t/how-to-extend-numba-so-it-supports-pybind11-wrapped-c-struct/1419 "2022-06-29T14:29:24Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![gauenk](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/gauenk/32/697_2.png) [@gauenk](https://numba.discourse.group/u/gauenk)
#### Post date: [September 10, 2022, 3:27pm UTC](https://numba.discourse.group/t/how-to-extend-numba-so-it-supports-pybind11-wrapped-c-struct/1419/2 "2022-09-10T15:27:29Z")

</div>

I would love this feature too. I am linking c-source code to pytorch and jax.

I am trying to wrap the pybind11 functions I use for pytorch with the jax header in a python script. To do this, I use numba’s cfunc to wrap my original pybind11 interface. An example is [shown here](https://github.com/PhilipVinc/numba4jax/blob/054c275fb5c58b8a968d4242ff87e1cb37a3edbe/numba4jax/_src/backends/gpu.py#L53). I am unfamiliar with this low-level detail but I hope this post demonstrates another use case for this feature.

Potentially using FFI to read the pybind11 so file will work soon [if this PR does what I think it does](https://github.com/pybind/pybind11/pull/4001).

---

_[View the full topic](https://numba.discourse.group/t/how-to-extend-numba-so-it-supports-pybind11-wrapped-c-struct/1419)._
