mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 01:28:27 +08:00
enhance: Rectify run_clang_format grep command (#39534)
Previously the grep with regex does not work and failed to match lots of .cpp files This PR: - use "-E" flag to use regex match - commit the fixed result of current cpp code Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
56659bacbb
commit
844df76cc0
@ -9,7 +9,7 @@ CorePath=$1
|
|||||||
CLANG_FORMAT=clang-format-12
|
CLANG_FORMAT=clang-format-12
|
||||||
|
|
||||||
formatThis() {
|
formatThis() {
|
||||||
find "$1" | grep "(\.cpp\|\.h\|\.cc)$" | grep -v "gen_tools/templates" | grep -v "\.pb\." | grep -v "tantivy-binding.h" | xargs $CLANG_FORMAT -i
|
find "$1" | grep -E "(\.cpp|\.h|\.cc)$" | grep -v "gen_tools/templates" | grep -v "\.pb\." | grep -v "tantivy-binding.h" | xargs $CLANG_FORMAT -i
|
||||||
}
|
}
|
||||||
|
|
||||||
formatThis "${CorePath}/src"
|
formatThis "${CorePath}/src"
|
||||||
|
|||||||
@ -37,13 +37,16 @@ CheckBruteForceSearchParam(const FieldMeta& field,
|
|||||||
"[BruteForceSearch] Data type isn't vector type");
|
"[BruteForceSearch] Data type isn't vector type");
|
||||||
if (IsBinaryVectorDataType(data_type)) {
|
if (IsBinaryVectorDataType(data_type)) {
|
||||||
AssertInfo(IsBinaryVectorMetricType(metric_type),
|
AssertInfo(IsBinaryVectorMetricType(metric_type),
|
||||||
"[BruteForceSearch] Binary vector, data type and metric type miss-match");
|
"[BruteForceSearch] Binary vector, data type and metric "
|
||||||
|
"type miss-match");
|
||||||
} else if (IsFloatVectorDataType(data_type)) {
|
} else if (IsFloatVectorDataType(data_type)) {
|
||||||
AssertInfo(IsFloatVectorMetricType(metric_type),
|
AssertInfo(IsFloatVectorMetricType(metric_type),
|
||||||
"[BruteForceSearch] Float vector, data type and metric type miss-match");
|
"[BruteForceSearch] Float vector, data type and metric type "
|
||||||
|
"miss-match");
|
||||||
} else if (IsIntVectorDataType(data_type)) {
|
} else if (IsIntVectorDataType(data_type)) {
|
||||||
AssertInfo(IsIntVectorMetricType(metric_type),
|
AssertInfo(IsIntVectorMetricType(metric_type),
|
||||||
"[BruteForceSearch] Int vector, data type and metric type miss-match");
|
"[BruteForceSearch] Int vector, data type and metric type "
|
||||||
|
"miss-match");
|
||||||
} else {
|
} else {
|
||||||
AssertInfo(IsVectorDataType(data_type),
|
AssertInfo(IsVectorDataType(data_type),
|
||||||
"[BruteForceSearch] Unsupported vector data type");
|
"[BruteForceSearch] Unsupported vector data type");
|
||||||
|
|||||||
@ -170,8 +170,7 @@ class ConcurrentVectorImpl : public VectorBase {
|
|||||||
std::conditional_t<
|
std::conditional_t<
|
||||||
std::is_same_v<Type, bfloat16>,
|
std::is_same_v<Type, bfloat16>,
|
||||||
BFloat16Vector,
|
BFloat16Vector,
|
||||||
std::conditional_t<
|
std::conditional_t<std::is_same_v<Type, int8>,
|
||||||
std::is_same_v<Type, int8>,
|
|
||||||
Int8Vector,
|
Int8Vector,
|
||||||
BinaryVector>>>>>;
|
BinaryVector>>>>>;
|
||||||
|
|
||||||
@ -546,8 +545,7 @@ class ConcurrentVector<BFloat16Vector>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class ConcurrentVector<Int8Vector>
|
class ConcurrentVector<Int8Vector> : public ConcurrentVectorImpl<int8, false> {
|
||||||
: public ConcurrentVectorImpl<int8, false> {
|
|
||||||
public:
|
public:
|
||||||
ConcurrentVector(int64_t dim,
|
ConcurrentVector(int64_t dim,
|
||||||
int64_t size_per_chunk,
|
int64_t size_per_chunk,
|
||||||
|
|||||||
@ -609,8 +609,7 @@ MergeDataArray(std::vector<MergeBase>& merge_bases,
|
|||||||
}
|
}
|
||||||
vector_array->set_dim(dst->dim());
|
vector_array->set_dim(dst->dim());
|
||||||
*dst->mutable_contents() = src.contents();
|
*dst->mutable_contents() = src.contents();
|
||||||
} else if (field_meta.get_data_type() ==
|
} else if (field_meta.get_data_type() == DataType::VECTOR_INT8) {
|
||||||
DataType::VECTOR_INT8) {
|
|
||||||
auto data = VEC_FIELD_DATA(src_field_data, int8);
|
auto data = VEC_FIELD_DATA(src_field_data, int8);
|
||||||
auto obj = vector_array->mutable_int8_vector();
|
auto obj = vector_array->mutable_int8_vector();
|
||||||
obj->assign(data, dim * sizeof(int8));
|
obj->assign(data, dim * sizeof(int8));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user