← 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
7static inline int ck_env_value_truthy(const char *v)
8{
9 return (v && v[0] && v[0] != '0') ? 1 : 0;
10}
11
12static 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
27static 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);
32}
33
34#endif /* CK_SPEED_PROFILES_H */
static int ck_speed_profile_qwen3vl_ocr_fast(void)
static int ck_env_truthy_or_qwen3vl_ocr_profile(const char *name)
static int ck_env_value_truthy(const char *v)