mirror of https://github.com/google/gemma.cpp.git
Fix SVE build: add missing hn::
PiperOrigin-RevId: 632481097
This commit is contained in:
parent
c5c9fc300c
commit
22fe9809ac
|
|
@ -10,6 +10,21 @@ package(
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
config_setting(
|
||||||
|
name = "android",
|
||||||
|
constraint_values = [
|
||||||
|
"@platforms//os:android",
|
||||||
|
],
|
||||||
|
visibility = [":__subpackages__"],
|
||||||
|
)
|
||||||
|
|
||||||
|
FILE_DEPS = select({
|
||||||
|
"//conditions:default": [
|
||||||
|
# Placeholder for io deps, do not remove
|
||||||
|
],
|
||||||
|
":android": [],
|
||||||
|
})
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = "io",
|
name = "io",
|
||||||
srcs = [
|
srcs = [
|
||||||
|
|
@ -18,9 +33,8 @@ cc_library(
|
||||||
],
|
],
|
||||||
hdrs = ["io.h"],
|
hdrs = ["io.h"],
|
||||||
deps = [
|
deps = [
|
||||||
# Placeholder for io deps, do not remove
|
|
||||||
"@hwy//:hwy",
|
"@hwy//:hwy",
|
||||||
],
|
] + FILE_DEPS,
|
||||||
)
|
)
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
|
|
|
||||||
|
|
@ -264,10 +264,10 @@ struct CompressTraits<hwy::bfloat16_t> {
|
||||||
i += N;
|
i += N;
|
||||||
}
|
}
|
||||||
|
|
||||||
sum0 = Add(sum0, sum1);
|
sum0 = hn::Add(sum0, sum1);
|
||||||
sum2 = Add(sum2, sum3);
|
sum2 = hn::Add(sum2, sum3);
|
||||||
sum0 = Add(sum0, sum2);
|
sum0 = hn::Add(sum0, sum2);
|
||||||
return ReduceSum(df32, sum0);
|
return hn::ReduceSum(df32, sum0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -423,7 +423,7 @@ static HWY_INLINE hn::Vec<D> Sigmoid(D d, hn::Vec<D> v) {
|
||||||
VF b3 = hn::Sub(hn::MulAdd(f2, b2, d3), b1);
|
VF b3 = hn::Sub(hn::MulAdd(f2, b2, d3), b1);
|
||||||
VF f1 = hn::Sub(hn::MulAdd(f, b3, d4), b2);
|
VF f1 = hn::Sub(hn::MulAdd(f, b3, d4), b2);
|
||||||
|
|
||||||
return Div(f0, f1);
|
return hn::Div(f0, f1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sigmoid using the logistic function 1 / (1 + exp(-x[i]))
|
// Sigmoid using the logistic function 1 / (1 + exp(-x[i]))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue