Skip to content

Commit

Permalink
remove package cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
raman-r-4978 committed Sep 14, 2020
1 parent 5033178 commit 590f221
Show file tree
Hide file tree
Showing 196 changed files with 85 additions and 104 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# JFaiss **(Linux only)**
# JFaiss-CPU **(Linux only)**

Faiss bindings for Java

Expand All @@ -24,8 +24,8 @@ mvn package

Install faiss and generate required Java files
```
git clone https://github.com/RamanRajarathinam/JFaiss.git
cd JFaiss
git clone https://github.com/RamanRajarathinam/JFaiss-CPU.git
cd JFaiss-CPU
git submodule update --init
docker build -t jfaiss-source .
```
Expand Down
15 changes: 0 additions & 15 deletions cpu/pom.xml

This file was deleted.

8 changes: 2 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
<modelVersion>4.0.0</modelVersion>

<groupId>com.vectorsearch.faiss</groupId>
<artifactId>JFaiss</artifactId>
<version>1.0</version>

<modules>
<module>cpu</module>
</modules>
<artifactId>JFaiss-CPU</artifactId>
<version>1.0.0</version>

<packaging>pom</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ public int search_from_candidates(
int k,
SWIGTYPE_p_long I,
SWIGTYPE_p_float D,
HNSW.MinimaxHeap candidates,
MinimaxHeap candidates,
VisitedTable vt,
int level,
int nres_in) {
Expand All @@ -438,7 +438,7 @@ public int search_from_candidates(
k,
SWIGTYPE_p_long.getCPtr(I),
SWIGTYPE_p_float.getCPtr(D),
HNSW.MinimaxHeap.getCPtr(candidates),
MinimaxHeap.getCPtr(candidates),
candidates,
VisitedTable.getCPtr(vt),
vt,
Expand All @@ -451,7 +451,7 @@ public int search_from_candidates(
int k,
SWIGTYPE_p_long I,
SWIGTYPE_p_float D,
HNSW.MinimaxHeap candidates,
MinimaxHeap candidates,
VisitedTable vt,
int level) {
return swigfaissJNI.HNSW_search_from_candidates__SWIG_1(
Expand All @@ -462,7 +462,7 @@ public int search_from_candidates(
k,
SWIGTYPE_p_long.getCPtr(I),
SWIGTYPE_p_float.getCPtr(D),
HNSW.MinimaxHeap.getCPtr(candidates),
MinimaxHeap.getCPtr(candidates),
candidates,
VisitedTable.getCPtr(vt),
vt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ public float getPeriod() {
return swigfaissJNI.IndexIVFSpectralHash_period_get(swigCPtr, this);
}

public void setThreshold_type(IndexIVFSpectralHash.ThresholdType value) {
public void setThreshold_type(ThresholdType value) {
swigfaissJNI.IndexIVFSpectralHash_threshold_type_set(swigCPtr, this, value.swigValue());
}

public IndexIVFSpectralHash.ThresholdType getThreshold_type() {
return IndexIVFSpectralHash.ThresholdType.swigToEnum(
public ThresholdType getThreshold_type() {
return ThresholdType.swigToEnum(
swigfaissJNI.IndexIVFSpectralHash_threshold_type_get(swigCPtr, this));
}

Expand Down Expand Up @@ -137,14 +137,14 @@ public SWIGTYPE_p_faiss__InvertedListScanner get_InvertedListScanner(boolean sto
}

public static final class ThresholdType {
public static final IndexIVFSpectralHash.ThresholdType Thresh_global =
new IndexIVFSpectralHash.ThresholdType("Thresh_global");
public static final IndexIVFSpectralHash.ThresholdType Thresh_centroid =
new IndexIVFSpectralHash.ThresholdType("Thresh_centroid");
public static final IndexIVFSpectralHash.ThresholdType Thresh_centroid_half =
new IndexIVFSpectralHash.ThresholdType("Thresh_centroid_half");
public static final IndexIVFSpectralHash.ThresholdType Thresh_median =
new IndexIVFSpectralHash.ThresholdType("Thresh_median");
public static final ThresholdType Thresh_global =
new ThresholdType("Thresh_global");
public static final ThresholdType Thresh_centroid =
new ThresholdType("Thresh_centroid");
public static final ThresholdType Thresh_centroid_half =
new ThresholdType("Thresh_centroid_half");
public static final ThresholdType Thresh_median =
new ThresholdType("Thresh_median");

public final int swigValue() {
return swigValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ public PolysemousTraining getPolysemous_training() {
return (cPtr == 0) ? null : new PolysemousTraining(cPtr, false);
}

public void setSearch_type(IndexPQ.Search_type_t value) {
public void setSearch_type(Search_type_t value) {
swigfaissJNI.IndexPQ_search_type_set(swigCPtr, this, value.swigValue());
}

public IndexPQ.Search_type_t getSearch_type() {
return IndexPQ.Search_type_t.swigToEnum(swigfaissJNI.IndexPQ_search_type_get(swigCPtr, this));
public Search_type_t getSearch_type() {
return Search_type_t.swigToEnum(swigfaissJNI.IndexPQ_search_type_get(swigCPtr, this));
}

public void setEncode_signs(boolean value) {
Expand Down Expand Up @@ -192,15 +192,15 @@ public void hamming_distance_table(int n, SWIGTYPE_p_float x, SWIGTYPE_p_int dis
}

public static final class Search_type_t {
public static final IndexPQ.Search_type_t ST_PQ = new IndexPQ.Search_type_t("ST_PQ");
public static final IndexPQ.Search_type_t ST_HE = new IndexPQ.Search_type_t("ST_HE");
public static final IndexPQ.Search_type_t ST_generalized_HE =
new IndexPQ.Search_type_t("ST_generalized_HE");
public static final IndexPQ.Search_type_t ST_SDC = new IndexPQ.Search_type_t("ST_SDC");
public static final IndexPQ.Search_type_t ST_polysemous =
new IndexPQ.Search_type_t("ST_polysemous");
public static final IndexPQ.Search_type_t ST_polysemous_generalize =
new IndexPQ.Search_type_t("ST_polysemous_generalize");
public static final Search_type_t ST_PQ = new Search_type_t("ST_PQ");
public static final Search_type_t ST_HE = new Search_type_t("ST_HE");
public static final Search_type_t ST_generalized_HE =
new Search_type_t("ST_generalized_HE");
public static final Search_type_t ST_SDC = new Search_type_t("ST_SDC");
public static final Search_type_t ST_polysemous =
new Search_type_t("ST_polysemous");
public static final Search_type_t ST_polysemous_generalize =
new Search_type_t("ST_polysemous_generalize");

public final int swigValue() {
return swigValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public synchronized void delete() {
super.delete();
}

public void setOptimization_type(PolysemousTraining.Optimization_type_t value) {
public void setOptimization_type(Optimization_type_t value) {
swigfaissJNI.PolysemousTraining_optimization_type_set(swigCPtr, this, value.swigValue());
}

public PolysemousTraining.Optimization_type_t getOptimization_type() {
return PolysemousTraining.Optimization_type_t.swigToEnum(
public Optimization_type_t getOptimization_type() {
return Optimization_type_t.swigToEnum(
swigfaissJNI.PolysemousTraining_optimization_type_get(swigCPtr, this));
}

Expand Down Expand Up @@ -88,12 +88,12 @@ public void optimize_reproduce_distances(ProductQuantizer pq) {
}

public static final class Optimization_type_t {
public static final PolysemousTraining.Optimization_type_t OT_None =
new PolysemousTraining.Optimization_type_t("OT_None");
public static final PolysemousTraining.Optimization_type_t OT_ReproduceDistances_affine =
new PolysemousTraining.Optimization_type_t("OT_ReproduceDistances_affine");
public static final PolysemousTraining.Optimization_type_t OT_Ranking_weighted_diff =
new PolysemousTraining.Optimization_type_t("OT_Ranking_weighted_diff");
public static final Optimization_type_t OT_None =
new Optimization_type_t("OT_None");
public static final Optimization_type_t OT_ReproduceDistances_affine =
new Optimization_type_t("OT_ReproduceDistances_affine");
public static final Optimization_type_t OT_Ranking_weighted_diff =
new Optimization_type_t("OT_Ranking_weighted_diff");

public final int swigValue() {
return swigValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ public boolean getVerbose() {
return swigfaissJNI.ProductQuantizer_verbose_get(swigCPtr, this);
}

public void setTrain_type(ProductQuantizer.train_type_t value) {
public void setTrain_type(train_type_t value) {
swigfaissJNI.ProductQuantizer_train_type_set(swigCPtr, this, value.swigValue());
}

public ProductQuantizer.train_type_t getTrain_type() {
return ProductQuantizer.train_type_t.swigToEnum(
public train_type_t getTrain_type() {
return train_type_t.swigToEnum(
swigfaissJNI.ProductQuantizer_train_type_get(swigCPtr, this));
}

Expand Down Expand Up @@ -673,16 +673,16 @@ public long decode() {
}

public static final class train_type_t {
public static final ProductQuantizer.train_type_t Train_default =
new ProductQuantizer.train_type_t("Train_default");
public static final ProductQuantizer.train_type_t Train_hot_start =
new ProductQuantizer.train_type_t("Train_hot_start");
public static final ProductQuantizer.train_type_t Train_shared =
new ProductQuantizer.train_type_t("Train_shared");
public static final ProductQuantizer.train_type_t Train_hypercube =
new ProductQuantizer.train_type_t("Train_hypercube");
public static final ProductQuantizer.train_type_t Train_hypercube_pca =
new ProductQuantizer.train_type_t("Train_hypercube_pca");
public static final train_type_t Train_default =
new train_type_t("Train_default");
public static final train_type_t Train_hot_start =
new train_type_t("Train_hot_start");
public static final train_type_t Train_shared =
new train_type_t("Train_shared");
public static final train_type_t Train_hypercube =
new train_type_t("Train_hypercube");
public static final train_type_t Train_hypercube_pca =
new train_type_t("Train_hypercube_pca");

public final int swigValue() {
return swigValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ public synchronized void delete() {
}
}

public void setQtype(ScalarQuantizer.QuantizerType value) {
public void setQtype(QuantizerType value) {
swigfaissJNI.ScalarQuantizer_qtype_set(swigCPtr, this, value.swigValue());
}

public ScalarQuantizer.QuantizerType getQtype() {
return ScalarQuantizer.QuantizerType.swigToEnum(
public QuantizerType getQtype() {
return QuantizerType.swigToEnum(
swigfaissJNI.ScalarQuantizer_qtype_get(swigCPtr, this));
}

public void setRangestat(ScalarQuantizer.RangeStat value) {
public void setRangestat(RangeStat value) {
swigfaissJNI.ScalarQuantizer_rangestat_set(swigCPtr, this, value.swigValue());
}

public ScalarQuantizer.RangeStat getRangestat() {
return ScalarQuantizer.RangeStat.swigToEnum(
public RangeStat getRangestat() {
return RangeStat.swigToEnum(
swigfaissJNI.ScalarQuantizer_rangestat_get(swigCPtr, this));
}

Expand Down Expand Up @@ -86,7 +86,7 @@ public FloatVector getTrained() {
return (cPtr == 0) ? null : new FloatVector(cPtr, false);
}

public ScalarQuantizer(long d, ScalarQuantizer.QuantizerType qtype) {
public ScalarQuantizer(long d, QuantizerType qtype) {
this(swigfaissJNI.new_ScalarQuantizer__SWIG_0(d, qtype.swigValue()), true);
}

Expand Down Expand Up @@ -159,9 +159,9 @@ public void decode_vector(SWIGTYPE_p_unsigned_char code, SWIGTYPE_p_float x) {
}
}

public ScalarQuantizer.Quantizer select_quantizer() {
public Quantizer select_quantizer() {
long cPtr = swigfaissJNI.ScalarQuantizer_select_quantizer(swigCPtr, this);
return (cPtr == 0) ? null : new ScalarQuantizer.Quantizer(cPtr, false);
return (cPtr == 0) ? null : new Quantizer(cPtr, false);
}

public SWIGTYPE_p_faiss__ScalarQuantizer__SQDistanceComputer get_distance_computer(
Expand Down Expand Up @@ -204,20 +204,20 @@ public SWIGTYPE_p_faiss__InvertedListScanner select_InvertedListScanner(
}

public static final class QuantizerType {
public static final ScalarQuantizer.QuantizerType QT_8bit =
new ScalarQuantizer.QuantizerType("QT_8bit");
public static final ScalarQuantizer.QuantizerType QT_4bit =
new ScalarQuantizer.QuantizerType("QT_4bit");
public static final ScalarQuantizer.QuantizerType QT_8bit_uniform =
new ScalarQuantizer.QuantizerType("QT_8bit_uniform");
public static final ScalarQuantizer.QuantizerType QT_4bit_uniform =
new ScalarQuantizer.QuantizerType("QT_4bit_uniform");
public static final ScalarQuantizer.QuantizerType QT_fp16 =
new ScalarQuantizer.QuantizerType("QT_fp16");
public static final ScalarQuantizer.QuantizerType QT_8bit_direct =
new ScalarQuantizer.QuantizerType("QT_8bit_direct");
public static final ScalarQuantizer.QuantizerType QT_6bit =
new ScalarQuantizer.QuantizerType("QT_6bit");
public static final QuantizerType QT_8bit =
new QuantizerType("QT_8bit");
public static final QuantizerType QT_4bit =
new QuantizerType("QT_4bit");
public static final QuantizerType QT_8bit_uniform =
new QuantizerType("QT_8bit_uniform");
public static final QuantizerType QT_4bit_uniform =
new QuantizerType("QT_4bit_uniform");
public static final QuantizerType QT_fp16 =
new QuantizerType("QT_fp16");
public static final QuantizerType QT_8bit_direct =
new QuantizerType("QT_8bit_direct");
public static final QuantizerType QT_6bit =
new QuantizerType("QT_6bit");

public final int swigValue() {
return swigValue;
Expand Down Expand Up @@ -263,14 +263,14 @@ private QuantizerType(String swigName, QuantizerType swigEnum) {
}

public static final class RangeStat {
public static final ScalarQuantizer.RangeStat RS_minmax =
new ScalarQuantizer.RangeStat("RS_minmax");
public static final ScalarQuantizer.RangeStat RS_meanstd =
new ScalarQuantizer.RangeStat("RS_meanstd");
public static final ScalarQuantizer.RangeStat RS_quantiles =
new ScalarQuantizer.RangeStat("RS_quantiles");
public static final ScalarQuantizer.RangeStat RS_optim =
new ScalarQuantizer.RangeStat("RS_optim");
public static final RangeStat RS_minmax =
new RangeStat("RS_minmax");
public static final RangeStat RS_meanstd =
new RangeStat("RS_meanstd");
public static final RangeStat RS_quantiles =
new RangeStat("RS_quantiles");
public static final RangeStat RS_optim =
new RangeStat("RS_optim");

public final int swigValue() {
return swigValue;
Expand Down
File renamed without changes.

0 comments on commit 590f221

Please sign in to comment.