Fix log assertions ggml

This commit is contained in:
Aleksandras Kostarevas 2024-03-30 19:11:01 -05:00
parent 1331b1c6d6
commit bec40d167c
2 changed files with 4 additions and 7 deletions

View File

@ -85,13 +85,13 @@ include $(CLEAR_VARS)
# All code in LOCAL_WHOLE_STATIC_LIBRARIES will be built into this shared library.
LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static
LOCAL_LDFLAGS += -llog
ifeq ($(FLAG_DO_PROFILE), true)
$(warning Making profiling version of native library)
LOCAL_LDFLAGS += -llog
else # FLAG_DO_PROFILE
ifeq ($(FLAG_DBG), true)
$(warning Making debug version of native library)
LOCAL_LDFLAGS += -llog
endif # FLAG_DBG
endif # FLAG_DO_PROFILE

View File

@ -207,9 +207,6 @@
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <android/log.h>
#define GAKLOGE(fmt, ...) __android_log_print(ANDROID_LOG_ERROR, "GGML", fmt, ##__VA_ARGS__)
#define GAKLOGI(fmt, ...) __android_log_print(ANDROID_LOG_INFO, "GGML", fmt, ##__VA_ARGS__)
#define GGML_FILE_MAGIC 0x67676d6c // "ggml"
#define GGML_FILE_VERSION 1
@ -244,11 +241,11 @@
#define GGML_PAD(x, n) (((x) + (n) - 1) & ~((n) - 1))
#include <android/log.h>
#define GGML_ASSERT(x) \
do { \
if (!(x)) { \
GAKLOGE("GGML_ASSERT: %s:%d: %s\n", __FILE__, __LINE__, #x); \
ggml_print_backtrace(); \
__android_log_assert("", "GGML_ASSERT: ", "%s:%d: %s\n", __FILE__, __LINE__, #x); \
exit(1); \
} \
} while (0)