diff --git a/include/gridtools/storage/adapter/nanobind_adapter.hpp b/include/gridtools/storage/adapter/nanobind_adapter.hpp index 707734127..5a190b4c1 100644 --- a/include/gridtools/storage/adapter/nanobind_adapter.hpp +++ b/include/gridtools/storage/adapter/nanobind_adapter.hpp @@ -18,7 +18,6 @@ #include "../../common/array.hpp" #include "../../common/integral_constant.hpp" #include "../../common/tuple.hpp" -#include "../../sid/as_const.hpp" #include "../../sid/simple_ptr_holder.hpp" #include "../../sid/synthetic.hpp" #include "../../sid/unknown_kind.hpp" @@ -79,7 +78,7 @@ namespace gridtools { class Strides = fully_dynamic_strides, class StridesKind = sid::unknown_kind> auto as_sid(nanobind::ndarray, Args...> ndarray, - Strides stride_spec = {}, + Strides stride_spec_ = {}, StridesKind = {}) { using sid::property; const auto ptr = ndarray.data(); @@ -87,19 +86,16 @@ namespace gridtools { assert(ndim == ndarray.ndim()); gridtools::array shape; std::copy_n(ndarray.shape_ptr(), ndim, shape.begin()); - gridtools::array strides; - std::copy_n(ndarray.stride_ptr(), ndim, strides.begin()); - const auto static_strides = select_static_strides(stride_spec, strides.data()); - - return sid::add_const( - std::integral_constant{}, - sid::synthetic() - .template set(sid::host_device::simple_ptr_holder{ptr}) - .template set(static_strides) - .template set() - .template set(gridtools::array, ndim>()) - .template set(shape) - ); + gridtools::array strides_; + std::copy_n(ndarray.stride_ptr(), ndim, strides_.begin()); + const auto strides = select_static_strides(stride_spec_, strides_.data()); + + return sid::synthetic() + .template set(sid::host_device::simple_ptr_holder{ptr}) + .template set(strides) + .template set() + .template set(gridtools::array, ndim>()) + .template set(shape); } } // namespace nanobind_sid_adapter_impl_