naive implementation of 3x3 and 5x5 reduction

This commit is contained in:
froejdh_e
2025-06-27 16:36:21 +02:00
parent e3f4b34b72
commit 5a9c3b717e
4 changed files with 136 additions and 0 deletions

View File

@ -104,4 +104,14 @@ void define_ClusterVector(py::module &m, const std::string &typestr) {
});
}
void define_reduction(py::module &m) {
m.def("reduce_3x3_to_2x2", [](const ClusterVector<Cluster<int, 3, 3, uint16_t>> &cv) {
return new ClusterVector<Cluster<int, 2, 2, uint16_t>>(reduce_3x3_to_2x2(cv));
// return new ClusterVector<Cluster<int, 3, 3>>();
})
.def("reduce_5x5_to_3x3", [](const ClusterVector<Cluster<int, 5, 5, uint16_t>> &cv) {
return new ClusterVector<Cluster<int, 3, 3, uint16_t>>(reduce_5x5_to_3x3(cv));
});
}
#pragma GCC diagnostic pop

View File

@ -81,4 +81,8 @@ PYBIND11_MODULE(_aare, m) {
DEFINE_CLUSTER_BINDINGS(int, 9, 9, uint16_t, i);
DEFINE_CLUSTER_BINDINGS(double, 9, 9, uint16_t, d);
DEFINE_CLUSTER_BINDINGS(float, 9, 9, uint16_t, f);
define_reduction(m);
}