-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update nanobind to v2 #1777
Update nanobind to v2 #1777
Conversation
launch jenkins |
Because of this change wjakob/nanobind#377 our test setup is now broken. We have to run a test from Python. |
launch jenkins |
launch jenkins |
template <std::size_t... Values> | ||
using stride_spec = std::index_sequence<Values...>; | ||
// Use `-1` for dynamic stride, use an integral value for static stride. | ||
template <ssize_t... Values> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we use int
for indices internally at quite a few places in GridTools, so maybe this would also be good enough here (this might even have a performance impact).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually used the wrong ssize_t
. It's actually a nb type defined here https://github.com/wjakob/nanobind/blob/c5ae2a36a704c1c62da99a81fad919261a3e9848/include/nanobind/nb_traits.h#L11.
I'll use that. We could still convert (runtime) strides to int
, but I would do separately and probably should look at performance.
launch jenkins |
launch jenkins |
- nb::any is replaced by `nb::ssize_t(-1)` - Because of a change in `~ndarray`, we need to make sure that Python is initialized in our tests (see wjakob/nanobind#377)
ssize_t(-1)
~ndarray
, we need to make sure that Python is initialized in our tests (see [BUG]:nb::ndarray
arguments withnb::call_guard<nb::gil_scoped_release>
on Python 3.12 wjakob/nanobind#377)