faiss 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae4ad57a987514417c76771a7318c454a505d108c60ee312eef12548c97bb21a
4
- data.tar.gz: ccb724de6af1ea2b4e1a820ff28827cfdc881ca953ef9f0c03c2dcf3602567f1
3
+ metadata.gz: cc3446fb52271b6e55c4e0ba64cf7146d8bcff39316803e9e7fac68caa0b1d7d
4
+ data.tar.gz: fb3bdc9c66b670413df99c0f1d914fd4861ccce30e11a1f959fb570d62d7dca0
5
5
  SHA512:
6
- metadata.gz: 0d936042d4e70c21abfa584b1154a23bf312e6f2418df963a1a076abd7f7b3179782c10aa5eefa8e3f95a0984594e7e1ebecb858ca3673dd28208a895a2c3252
7
- data.tar.gz: 45588388c9d15510d57f3d0db66d2ff9868f59c5eddc49507d72e247b962f270e62b5a44a7b70d38c570b31af5cc604156ab71dd7477a0240baa089d73a709af
6
+ metadata.gz: b56a61bbe96f7aa628b0eb819b9404c6c48fba6f2c6cf3802d32fad52a8cbb1abbf97e09700c5d2b22faafef7ba2c5424839f7e98dacbb32d86a60c565c1b9f1
7
+ data.tar.gz: dce96c87b15ee7708e1c08f5f7ab4d04c1fb2f4399d5d423cb1ab9de7099ffc0a1bb81a968fb527562bd3d42d1cd131e60fc80cff668de6fa8270c7a81dec8a5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.3.4 (2025-02-10)
2
+
3
+ - Fixed error with Rice 4.5
4
+
1
5
  ## 0.3.3 (2025-01-30)
2
6
 
3
7
  - Updated Faiss to 1.10.0
data/ext/faiss/extconf.rb CHANGED
@@ -20,7 +20,7 @@ abort "Numo not found" unless find_header("numo/narray.h", numo)
20
20
  $LDFLAGS += " -Wl,-undefined,dynamic_lookup" if RbConfig::CONFIG["host_os"] =~ /darwin/i
21
21
 
22
22
  $CXXFLAGS += " -std=c++17 $(optflags) -DFINTEGER=int"
23
- $CXXFLAGS += " -Wall -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable -Wno-deprecated-declarations -Wno-sign-compare"
23
+ $CXXFLAGS += " -Wall -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable -Wno-unused-private-field -Wno-deprecated-declarations -Wno-sign-compare"
24
24
 
25
25
  # -march=native not supported with ARM Mac
26
26
  default_optflags = RbConfig::CONFIG["host_os"] =~ /darwin/i && RbConfig::CONFIG["host_cpu"] =~ /arm|aarch64/i ? "" : " -march=native"
data/ext/faiss/index.cpp CHANGED
@@ -17,10 +17,7 @@ namespace Rice::detail {
17
17
  template<>
18
18
  struct Type<faiss::MetricType>
19
19
  {
20
- static bool verify()
21
- {
22
- return true;
23
- }
20
+ static bool verify() { return true; }
24
21
  };
25
22
 
26
23
  template<>
@@ -29,9 +26,9 @@ namespace Rice::detail {
29
26
  public:
30
27
  From_Ruby() = default;
31
28
 
32
- From_Ruby(Arg* arg) : arg_(arg)
33
- {
34
- }
29
+ From_Ruby(Arg* arg) : arg_(arg) {}
30
+
31
+ Convertible is_convertible(VALUE value) { return Convertible::Cast; }
35
32
 
36
33
  faiss::MetricType convert(VALUE x)
37
34
  {
@@ -56,16 +53,15 @@ namespace Rice::detail {
56
53
  template<>
57
54
  struct Type<faiss::ScalarQuantizer::QuantizerType>
58
55
  {
59
- static bool verify()
60
- {
61
- return true;
62
- }
56
+ static bool verify() { return true; }
63
57
  };
64
58
 
65
59
  template<>
66
60
  class From_Ruby<faiss::ScalarQuantizer::QuantizerType>
67
61
  {
68
62
  public:
63
+ Convertible is_convertible(VALUE value) { return Convertible::Cast; }
64
+
69
65
  faiss::ScalarQuantizer::QuantizerType convert(VALUE x)
70
66
  {
71
67
  auto s = Object(x).to_s().str();
@@ -166,10 +162,10 @@ void init_index(Rice::Module& m) {
166
162
  .define_constructor(Rice::Constructor<faiss::IndexFlatIP, int64_t>());
167
163
 
168
164
  Rice::define_class_under<faiss::IndexHNSWFlat, faiss::Index>(m, "IndexHNSWFlat")
169
- .define_constructor(Rice::Constructor<faiss::IndexHNSWFlat, int, int, faiss::MetricType>(), Rice::Arg("d"), Rice::Arg("M"), Rice::Arg("metric") = faiss::METRIC_L2);
165
+ .define_constructor(Rice::Constructor<faiss::IndexHNSWFlat, int, int, faiss::MetricType>(), Rice::Arg("_d"), Rice::Arg("_M"), Rice::Arg("_metric") = faiss::METRIC_L2);
170
166
 
171
167
  Rice::define_class_under<faiss::IndexIVFFlat, faiss::Index>(m, "IndexIVFFlat")
172
- .define_constructor(Rice::Constructor<faiss::IndexIVFFlat, faiss::Index*, size_t, size_t, faiss::MetricType>(), Rice::Arg("quantizer"), Rice::Arg("d"), Rice::Arg("nlist"), Rice::Arg("metric") = faiss::METRIC_L2);
168
+ .define_constructor(Rice::Constructor<faiss::IndexIVFFlat, faiss::Index*, size_t, size_t, faiss::MetricType>(), Rice::Arg("_quantizer"), Rice::Arg("_d"), Rice::Arg("_nlist"), Rice::Arg("_metric") = faiss::METRIC_L2);
173
169
 
174
170
  Rice::define_class_under<faiss::IndexLSH, faiss::Index>(m, "IndexLSH")
175
171
  .define_constructor(Rice::Constructor<faiss::IndexLSH, int64_t, int>());
@@ -184,7 +180,7 @@ void init_index(Rice::Module& m) {
184
180
  .define_constructor(Rice::Constructor<faiss::IndexIVFScalarQuantizer, faiss::Index*, size_t, size_t, faiss::ScalarQuantizer::QuantizerType>());
185
181
 
186
182
  Rice::define_class_under<faiss::IndexIVFPQ, faiss::Index>(m, "IndexIVFPQ")
187
- .define_constructor(Rice::Constructor<faiss::IndexIVFPQ, faiss::Index*, size_t, size_t, size_t, size_t, faiss::MetricType>(), Rice::Arg("quantizer"), Rice::Arg("d"), Rice::Arg("nlist"), Rice::Arg("M"), Rice::Arg("nbits_per_idx"), Rice::Arg("metric") = faiss::METRIC_L2);
183
+ .define_constructor(Rice::Constructor<faiss::IndexIVFPQ, faiss::Index*, size_t, size_t, size_t, size_t, faiss::MetricType>(), Rice::Arg("_quantizer"), Rice::Arg("_d"), Rice::Arg("_nlist"), Rice::Arg("_M"), Rice::Arg("_nbits_per_idx"), Rice::Arg("_metric") = faiss::METRIC_L2);
188
184
 
189
185
  Rice::define_class_under<faiss::IndexIVFPQR, faiss::Index>(m, "IndexIVFPQR")
190
186
  .define_constructor(Rice::Constructor<faiss::IndexIVFPQR, faiss::Index*, size_t, size_t, size_t, size_t, size_t, size_t>());