Skip to content

Commit 529e749

Browse files
committed
swiftui : sync after decode
1 parent b25a0f1 commit 529e749

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/llama.swiftui/llama.cpp.swift/LibLlama.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ actor LlamaContext {
221221
if llama_decode(context, batch) != 0 {
222222
print("llama_decode() failed during prompt")
223223
}
224+
llama_synchronize(context)
224225

225226
let t_pp_end = ggml_time_us()
226227

@@ -240,6 +241,7 @@ actor LlamaContext {
240241
if llama_decode(context, batch) != 0 {
241242
print("llama_decode() failed during text generation")
242243
}
244+
llama_synchronize(context)
243245
}
244246

245247
let t_tg_end = ggml_time_us()

0 commit comments

Comments
 (0)