Skip to content

Commit d6c2ea0

Browse files
determine memory use iteratively
1 parent 172c694 commit d6c2ea0

File tree

2 files changed

+300
-247
lines changed

2 files changed

+300
-247
lines changed

src/llama-context.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ struct llama_memory_breakdown_data {
2626
size_t model = 0; // memory allocated for the model
2727
size_t context = 0; // memory allocated for the context
2828
size_t compute = 0; // memory allocated for temporary compute buffers
29+
30+
size_t total() const {
31+
return model + context + compute;
32+
}
2933
};
3034

3135
struct llama_context {

0 commit comments

Comments
 (0)