3namespace py = pybind11;
5// Explicit instantiation for int16_t
6py::array get_run_lengths_int16(py::array_t<int16_t> x) {
7 return get_run_lengths_impl<int16_t>(x);
8}
10// Explicit instantiation for int32_t
11py::array get_run_lengths_int32(py::array_t<int32_t> x) {
12 return get_run_lengths_impl<int32_t>(x);
13}
15PYBIND11_MODULE(get_run_lengths_cpp_ext, m) {
16 m.doc() = "C++ implementation of get_run_lengths using pybind11";
17 m.def("get_run_lengths_int16", &get_run_lengths_int16,
18 "Calculate run lengths of zeros and non-zeros in a signal (int16)");
19 m.def("get_run_lengths_int32", &get_run_lengths_int32,
20 "Calculate run lengths of zeros and non-zeros in a signal (int32)");
21}