CK
← Back to C-Kernel-Engine Docs
Doxygen Source Documentation
Loading...
Searching...
No Matches
ck_speed_profiles.h
Go to the documentation of this file.
1
#ifndef CK_SPEED_PROFILES_H
2
#define CK_SPEED_PROFILES_H
3
4
#include <stdlib.h>
5
#include <string.h>
6
7
static
inline
int
ck_env_value_truthy
(
const
char
*v)
8
{
9
return
(v && v[0] && v[0] !=
'0'
) ? 1 : 0;
10
}
11
12
static
inline
int
ck_speed_profile_qwen3vl_ocr_fast
(
void
)
13
{
14
const
char
*alias = getenv(
"CK_QWEN3VL_OCR_FAST"
);
15
if
(
ck_env_value_truthy
(alias))
return
1;
16
17
/* CK_PROFILE is already used for timing/profiling instrumentation.
18
* Keep speed policy separate so OCR tuning can coexist with CK_PROFILE=1.
19
*/
20
const
char
*profile = getenv(
"CK_SPEED_PROFILE"
);
21
if
(!profile || !profile[0])
return
0;
22
return
strcmp(profile,
"qwen3vl_ocr_xeon_avx512"
) == 0 ||
23
strcmp(profile,
"qwen3vl_ocr_fast"
) == 0 ||
24
strcmp(profile,
"qwen3vl_ocr"
) == 0;
25
}
26
27
static
inline
int
ck_env_truthy_or_qwen3vl_ocr_profile
(
const
char
*name)
28
{
29
const
char
*env = getenv(name);
30
if
(env)
return
ck_env_value_truthy
(env);
31
return
ck_speed_profile_qwen3vl_ocr_fast
();
32
}
33
34
#endif
/* CK_SPEED_PROFILES_H */
ck_speed_profile_qwen3vl_ocr_fast
static int ck_speed_profile_qwen3vl_ocr_fast(void)
Definition
ck_speed_profiles.h:12
ck_env_truthy_or_qwen3vl_ocr_profile
static int ck_env_truthy_or_qwen3vl_ocr_profile(const char *name)
Definition
ck_speed_profiles.h:27
ck_env_value_truthy
static int ck_env_value_truthy(const char *v)
Definition
ck_speed_profiles.h:7
include
ck_speed_profiles.h
Generated by
1.9.8