Skip to content

Commit ca481ed

Browse files
committed
[common] Compile time debug logs
Define a new macro LLAMA_LOG_CMAKE_DEBUG that results in no-op when a release build is activated. This will allow to have a good trace and debugging capabilities that will be specially useful for the async loading of multiple model shards.
1 parent f8942e7 commit ca481ed

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/llama-impl.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ void llama_log_callback_default(ggml_log_level level, const char * text, void *
3030
#define LLAMA_LOG_DEBUG(...) llama_log_internal(GGML_LOG_LEVEL_DEBUG, __VA_ARGS__)
3131
#define LLAMA_LOG_CONT(...) llama_log_internal(GGML_LOG_LEVEL_CONT , __VA_ARGS__)
3232

33+
// Debug-only logging macro that's only enabled in debug builds at compile time
34+
#ifndef NDEBUG
35+
#define LLAMA_LOG_CMAKE_DEBUG(...) LLAMA_LOG_DEBUG(__VA_ARGS__)
36+
#else
37+
#define LLAMA_LOG_CMAKE_DEBUG(...)
38+
#endif
39+
3340
//
3441
// helpers
3542
//

0 commit comments

Comments
 (0)