This repository was archived by the owner on Aug 16, 2023. It is now read-only.
File tree 3 files changed +42
-13
lines changed
3 files changed +42
-13
lines changed Original file line number Diff line number Diff line change @@ -227,18 +227,10 @@ endmacro()
227
227
if (KNOWHERE_WITH_OPENBLAS)
228
228
if (OpenBLAS_SOURCE STREQUAL "AUTO" )
229
229
# Protect OpenBLAS for faiss build
230
- if (LINUX)
230
+ if (LINUX)
231
231
set (BLA_VENDOR OpenBLAS)
232
232
endif ()
233
-
234
- if ( CMAKE_BUILD_TYPE STREQUAL "Debug" OR APPLE OR MSYS)
235
- message (STATUS "Using debug mode or host is MacOS/MSYS, try to find openblas" )
236
- find_package (BLAS)
237
- message (STATUS "Knowhere openblas libraries: ${BLAS_LIBRARIES} " )
238
- message (STATUS "Knowhere openblas found: ${BLAS_FOUND} " )
239
- endif ()
240
-
241
-
233
+ find_package (BLAS)
242
234
if (BLAS_FOUND)
243
235
add_library (openblas ALIAS BLAS::BLAS)
244
236
else ()
@@ -248,7 +240,9 @@ if (KNOWHERE_WITH_OPENBLAS)
248
240
elseif (OpenBLAS_SOURCE STREQUAL "BUNDLED" )
249
241
build_openblas()
250
242
elseif (OpenBLAS_SOURCE STREQUAL "SYSTEM" )
251
- set (BLA_VENDOR OpenBLAS)
243
+ if (LINUX)
244
+ set (BLA_VENDOR OpenBLAS)
245
+ endif ()
252
246
find_package (BLAS REQUIRED)
253
247
add_library (openblas ALIAS BLAS::BLAS)
254
248
endif ()
Original file line number Diff line number Diff line change 18
18
#include " aux_utils.h"
19
19
#include " cached_io.h"
20
20
#include " index.h"
21
- #include " openblas/cblas.h"
22
21
#include " omp.h"
23
22
#include " partition_and_pq.h"
24
23
#include " percentile_stats.h"
Original file line number Diff line number Diff line change 5
5
#include < unordered_set>
6
6
#include < malloc.h>
7
7
#include < math_utils.h>
8
- #include " openblas/cblas.h"
9
8
#include " logger.h"
10
9
#include " utils.h"
11
10
11
+
12
+ #ifdef __cplusplus
13
+ extern " C" {
14
+ #endif
15
+
16
+ #ifndef OPENBLAS_CONST
17
+ # define OPENBLAS_CONST const
18
+ #endif
19
+
20
+ typedef int blasint;
21
+
22
+ typedef enum CBLAS_ORDER {
23
+ CblasRowMajor = 101 ,
24
+ CblasColMajor = 102
25
+ } CBLAS_ORDER;
26
+ typedef enum CBLAS_TRANSPOSE {
27
+ CblasNoTrans = 111 ,
28
+ CblasTrans = 112 ,
29
+ CblasConjTrans = 113 ,
30
+ CblasConjNoTrans = 114
31
+ } CBLAS_TRANSPOSE;
32
+
33
+ float cblas_snrm2 (const int N, const float * X, const int incX);
34
+ void cblas_sgemm (OPENBLAS_CONST enum CBLAS_ORDER Order,
35
+ OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA,
36
+ OPENBLAS_CONST enum CBLAS_TRANSPOSE TransB,
37
+ OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N,
38
+ OPENBLAS_CONST blasint K, OPENBLAS_CONST float alpha,
39
+ OPENBLAS_CONST float * A, OPENBLAS_CONST blasint lda,
40
+ OPENBLAS_CONST float * B, OPENBLAS_CONST blasint ldb,
41
+ OPENBLAS_CONST float beta, float * C,
42
+ OPENBLAS_CONST blasint ldc);
43
+ #ifdef __cplusplus
44
+ }
45
+ #endif
46
+
47
+
12
48
namespace math_utils {
13
49
14
50
float calc_distance (float * vec_1, float * vec_2, size_t dim) {
You can’t perform that action at this time.
0 commit comments