FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
llama.cpp/src/llama-memory.cpp at dflash-docs · kashif/llama.cpp · GitHub
kashif
/
llama.cpp
Public
forked from
ggml-org/llama.cpp
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
llama.cpp
/
src
/
llama-memory.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
59 lines (53 loc) · 1.5 KB
Breadcrumbs
llama.cpp
/
src
/
llama-memory.cpp
Copy path
File metadata and controls
59 lines (53 loc) · 1.5 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#
include
"
llama-memory.h
"
llama_memory_status
llama_memory_status_combine
(llama_memory_status s0, llama_memory_status s1) {
bool
has_update =
false
;
switch
(s0) {
case
LLAMA_MEMORY_STATUS_SUCCESS
:
{
has_update =
true
;
break
;
}
case
LLAMA_MEMORY_STATUS_NO_UPDATE
:
{
break
;
}
case
LLAMA_MEMORY_STATUS_FAILED_PREPARE
:
case
LLAMA_MEMORY_STATUS_FAILED_COMPUTE
:
{
return
s0;
}
}
switch
(s1) {
case
LLAMA_MEMORY_STATUS_SUCCESS
:
{
has_update =
true
;
break
;
}
case
LLAMA_MEMORY_STATUS_NO_UPDATE
:
{
break
;
}
case
LLAMA_MEMORY_STATUS_FAILED_PREPARE
:
case
LLAMA_MEMORY_STATUS_FAILED_COMPUTE
:
{
return
s1;
}
}
//
if either status has an update, then the combined status has an update
return
has_update ?
LLAMA_MEMORY_STATUS_SUCCESS
:
LLAMA_MEMORY_STATUS_NO_UPDATE
;
}
bool
llama_memory_status_is_fail
(llama_memory_status status) {
switch
(status) {
case
LLAMA_MEMORY_STATUS_SUCCESS
:
case
LLAMA_MEMORY_STATUS_NO_UPDATE
:
{
return
false
;
}
case
LLAMA_MEMORY_STATUS_FAILED_PREPARE
:
case
LLAMA_MEMORY_STATUS_FAILED_COMPUTE
:
{
return
true
;
}
}
return
false
;
}
Back
|
FazBrowse Home
|
New Git URL