Skip to content

Commit 56b1087

Browse files
move fvec_madd_* functions declarations to a right header (facebookresearch#3054)
Summary: The implementations for `fvec_madd` and `fvec_madd_and_argmin` are in `utils/distances.cpp`, so I moved the declarations from `utils/utils.h` to `utils/distances.h` Pull Request resolved: facebookresearch#3054 Reviewed By: mlomeli1 Differential Revision: D49687725 Pulled By: mdouze fbshipit-source-id: b98c13f5710f06daba479767a7aab8d62d6e6ddf
1 parent 0780a28 commit 56b1087

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed

faiss/utils/distances.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,4 +434,27 @@ void compute_PQ_dis_tables_dsub2(
434434
* Templatized versions of distance functions
435435
***************************************************************************/
436436

437+
/***************************************************************************
438+
* Misc matrix and vector manipulation functions
439+
***************************************************************************/
440+
441+
/** compute c := a + bf * b for a, b and c tables
442+
*
443+
* @param n size of the tables
444+
* @param a size n
445+
* @param b size n
446+
* @param c restult table, size n
447+
*/
448+
void fvec_madd(size_t n, const float* a, float bf, const float* b, float* c);
449+
450+
/** same as fvec_madd, also return index of the min of the result table
451+
* @return index of the min of table c
452+
*/
453+
int fvec_madd_and_argmin(
454+
size_t n,
455+
const float* a,
456+
float bf,
457+
const float* b,
458+
float* c);
459+
437460
} // namespace faiss

faiss/utils/utils.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,6 @@ uint64_t get_cycles();
4949
* Misc matrix and vector manipulation functions
5050
***************************************************************************/
5151

52-
/** compute c := a + bf * b for a, b and c tables
53-
*
54-
* @param n size of the tables
55-
* @param a size n
56-
* @param b size n
57-
* @param c restult table, size n
58-
*/
59-
void fvec_madd(size_t n, const float* a, float bf, const float* b, float* c);
60-
61-
/** same as fvec_madd, also return index of the min of the result table
62-
* @return index of the min of table c
63-
*/
64-
int fvec_madd_and_argmin(
65-
size_t n,
66-
const float* a,
67-
float bf,
68-
const float* b,
69-
float* c);
70-
7152
/* perform a reflection (not an efficient implementation, just for test ) */
7253
void reflection(const float* u, float* x, size_t n, size_t d, size_t nu);
7354

0 commit comments

Comments
 (0)