|
28 | 28 | #endif |
29 | 29 |
|
30 | 30 | void |
31 | | -checkBuildConfig(knowhere::IndexType indexType, knowhere::Json& json) { |
32 | | - std::string msg; |
| 31 | +checkBuildConfig(knowhere::IndexType indexType, const knowhere::Json& json) { |
| 32 | + const auto version = knowhere::Version::GetCurrentVersion().VersionNumber(); |
33 | 33 | if (knowhere::IndexFactory::Instance().FeatureCheck(indexType, knowhere::feature::BINARY)) { |
34 | | - CHECK(knowhere::IndexStaticFaced<knowhere::bin1>::ConfigCheck( |
35 | | - indexType, knowhere::Version::GetCurrentVersion().VersionNumber(), json, msg) == |
| 34 | + auto binary_json = json; |
| 35 | + binary_json[knowhere::meta::METRIC_TYPE] = knowhere::metric::HAMMING; |
| 36 | + std::string msg; |
| 37 | + CHECK(knowhere::IndexStaticFaced<knowhere::bin1>::ConfigCheck(indexType, version, binary_json, msg) == |
36 | 38 | knowhere::Status::success); |
37 | 39 | CHECK(msg.empty()); |
38 | 40 | } |
39 | 41 | if (knowhere::IndexFactory::Instance().FeatureCheck(indexType, knowhere::feature::FLOAT32)) { |
40 | | - CHECK(knowhere::IndexStaticFaced<float>::ConfigCheck(indexType, |
41 | | - knowhere::Version::GetCurrentVersion().VersionNumber(), |
42 | | - json, msg) == knowhere::Status::success); |
| 42 | + std::string msg; |
| 43 | + CHECK(knowhere::IndexStaticFaced<float>::ConfigCheck(indexType, version, json, msg) == |
| 44 | + knowhere::Status::success); |
43 | 45 | CHECK(msg.empty()); |
44 | 46 | } |
45 | 47 | if (knowhere::IndexFactory::Instance().FeatureCheck(indexType, knowhere::feature::BF16)) { |
46 | | - CHECK(knowhere::IndexStaticFaced<knowhere::bf16>::ConfigCheck( |
47 | | - indexType, knowhere::Version::GetCurrentVersion().VersionNumber(), json, msg) == |
| 48 | + std::string msg; |
| 49 | + CHECK(knowhere::IndexStaticFaced<knowhere::bf16>::ConfigCheck(indexType, version, json, msg) == |
48 | 50 | knowhere::Status::success); |
49 | 51 | CHECK(msg.empty()); |
50 | 52 | } |
51 | 53 | if (knowhere::IndexFactory::Instance().FeatureCheck(indexType, knowhere::feature::FP16)) { |
52 | | - CHECK(knowhere::IndexStaticFaced<knowhere::fp16>::ConfigCheck( |
53 | | - indexType, knowhere::Version::GetCurrentVersion().VersionNumber(), json, msg) == |
| 54 | + std::string msg; |
| 55 | + CHECK(knowhere::IndexStaticFaced<knowhere::fp16>::ConfigCheck(indexType, version, json, msg) == |
54 | 56 | knowhere::Status::success); |
55 | 57 | CHECK(msg.empty()); |
56 | 58 | } |
57 | 59 | if (knowhere::IndexFactory::Instance().FeatureCheck(indexType, knowhere::feature::SPARSE_U32_F32)) { |
58 | | - CHECK(knowhere::IndexStaticFaced<float>::ConfigCheck(indexType, |
59 | | - knowhere::Version::GetCurrentVersion().VersionNumber(), |
60 | | - json, msg) == knowhere::Status::success); |
| 60 | + std::string msg; |
| 61 | + CHECK(knowhere::IndexStaticFaced<float>::ConfigCheck(indexType, version, json, msg) == |
| 62 | + knowhere::Status::success); |
61 | 63 | CHECK(msg.empty()); |
62 | 64 | } |
63 | 65 | #ifndef KNOWHERE_WITH_CARDINAL |
64 | 66 | if (knowhere::IndexFactory::Instance().FeatureCheck(indexType, knowhere::feature::INT8)) { |
65 | | - CHECK(knowhere::IndexStaticFaced<knowhere::int8>::ConfigCheck( |
66 | | - indexType, knowhere::Version::GetCurrentVersion().VersionNumber(), json, msg) == |
| 67 | + std::string msg; |
| 68 | + CHECK(knowhere::IndexStaticFaced<knowhere::int8>::ConfigCheck(indexType, version, json, msg) == |
67 | 69 | knowhere::Status::success); |
68 | 70 | CHECK(msg.empty()); |
69 | 71 | } |
|
0 commit comments