← Back to C-Kernel-Engine Docs Doxygen Source Documentation
 
Loading...
Searching...
No Matches
ck_speed_profiles.h File Reference
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Functions

static int ck_env_truthy_or_qwen3vl_ocr_profile (const char *name)
 
static int ck_env_value_truthy (const char *v)
 
static int ck_speed_profile_qwen3vl_ocr_fast (void)
 

Function Documentation

◆ ck_env_truthy_or_qwen3vl_ocr_profile()

static int ck_env_truthy_or_qwen3vl_ocr_profile ( const char *  name)
inlinestatic

Definition at line 27 of file ck_speed_profiles.h.

28{
29 const char *env = getenv(name);
30 if (env) return ck_env_value_truthy(env);
32}
static int ck_speed_profile_qwen3vl_ocr_fast(void)
static int ck_env_value_truthy(const char *v)

References ck_env_value_truthy(), and ck_speed_profile_qwen3vl_ocr_fast().

Referenced by ck_q8_0_fp32_m4n4_enabled().

◆ ck_env_value_truthy()

static int ck_env_value_truthy ( const char *  v)
inlinestatic

Definition at line 7 of file ck_speed_profiles.h.

8{
9 return (v && v[0] && v[0] != '0') ? 1 : 0;
10}

Referenced by ck_env_truthy_or_qwen3vl_ocr_profile(), ck_q4k_x16_chunk4_enabled(), and ck_speed_profile_qwen3vl_ocr_fast().

◆ ck_speed_profile_qwen3vl_ocr_fast()

static int ck_speed_profile_qwen3vl_ocr_fast ( void  )
inlinestatic

Definition at line 12 of file ck_speed_profiles.h.

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}

References ck_env_value_truthy().

Referenced by ck_env_truthy_or_qwen3vl_ocr_profile().