Skip to content

Commit 511182e

Browse files
authored
android : use "ci-android" branch for CI (ggml-org#7341)
* android : use "ci-android" branch for CI * ggml : disable SIMD exp and silu for 32-bit ARM ggml-ci * android : do not fetch, use add_subdirectory instead * cmake : provide binary dir
1 parent 133d99c commit 511182e

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

examples/llama.android/app/src/main/cpp/CMakeLists.txt

+10-8
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@ cmake_minimum_required(VERSION 3.22.1)
1212
# build script scope).
1313
project("llama-android")
1414

15-
include(FetchContent)
16-
FetchContent_Declare(
17-
llama
18-
GIT_REPOSITORY https://github.com/ggerganov/llama.cpp
19-
GIT_TAG master
20-
)
15+
#include(FetchContent)
16+
#FetchContent_Declare(
17+
# llama
18+
# GIT_REPOSITORY https://github.com/ggerganov/llama.cpp
19+
# GIT_TAG ci-android
20+
#)
21+
#
22+
## Also provides "common"
23+
#FetchContent_MakeAvailable(llama)
2124

22-
# Also provides "common"
23-
FetchContent_MakeAvailable(llama)
25+
add_subdirectory(../../../../../../ please-work)
2426

2527
# Creates and names a library, sets it as either STATIC
2628
# or SHARED, and provides the relative paths to its source code.

ggml.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -2076,7 +2076,7 @@ inline static float ggml_silu_f32(float x) {
20762076
return x/(1.0f + expf(-x));
20772077
}
20782078

2079-
#if defined(__ARM_NEON)
2079+
#if defined(__ARM_NEON) && defined(__aarch64__)
20802080

20812081
// adapted from arm limited optimized routine
20822082
// the maximum error is 1.45358 plus 0.5 ulps
@@ -2288,7 +2288,7 @@ static void ggml_vec_silu_f32(const int n, float * y, const float * x) {
22882288
for (; i + 3 < n; i += 4) {
22892289
_mm_storeu_ps(y + i, ggml_v_silu(_mm_loadu_ps(x + i)));
22902290
}
2291-
#elif defined(__ARM_NEON)
2291+
#elif defined(__ARM_NEON) && defined(__aarch64__)
22922292
for (; i + 3 < n; i += 4) {
22932293
vst1q_f32(y + i, ggml_v_silu(vld1q_f32(x + i)));
22942294
}
@@ -2335,7 +2335,7 @@ static ggml_float ggml_vec_soft_max_f32(const int n, float * y, const float * x,
23352335
#endif
23362336
sum += (ggml_float)_mm_cvtss_f32(val);
23372337
}
2338-
#elif defined(__ARM_NEON)
2338+
#elif defined(__ARM_NEON) && defined(__aarch64__)
23392339
for (; i + 3 < n; i += 4) {
23402340
float32x4_t val = ggml_v_expf(vsubq_f32(vld1q_f32(x + i),
23412341
vdupq_n_f32(max)));

0 commit comments

Comments
 (0)