Register Symqg bindings into combined module
| 113 | dists_data + (idx * k) |
| 114 | ); |
| 115 | } catch (...) { |
| 116 | #pragma omp critical(rabitq_symqg_search_error) |
| 117 | { |
| 118 | if (!error) { |
| 119 | error = std::current_exception(); |
| 120 | } |
| 121 | } |
| 122 | failed.store(true, std::memory_order_relaxed); |
| 123 | } |
| 124 | } |
| 125 | if (error) { |
| 126 | std::rethrow_exception(error); |
| 127 | } |
| 128 | |
| 129 | return py::make_tuple(ids, dists); |
| 130 | } |
| 131 | |
| 132 | void save(const std::string& path) const { |
| 133 | if (!built_) { |
| 134 | throw std::runtime_error("SymqgIndex must be built before save"); |
| 135 | } |
| 136 | index_->save(path.c_str()); |
| 137 | } |
| 138 | |
| 139 | static SymqgIndex load(const std::string& path) { |
| 140 | SymqgIndex wrapper; |
| 141 | wrapper.index_ = std::make_unique<rabitqlib::symqg::QuantizedGraph<float>>(); |
| 142 | wrapper.index_->load(path.c_str()); |
no test coverage detected