/* Synthetic CPU protocol fixture; never reads model data or initializes CUDA. */ #include #include #include #include int main(int argc, char **argv) { if (argc == 2 && !strcmp(argv[1], "--help")) { const char *visible = getenv("CUDA_VISIBLE_DEVICES"); if (!visible || *visible) return 5; puts("embedded fixture help (GPU hidden)"); return 0; } if (argc != 3 || strcmp(argv[1], "--serve")) return 2; FILE *pid = fopen(argv[2], "w"); if (!pid) return 3; fprintf(pid, "%ld\n", (long)getpid()); fclose(pid); setvbuf(stdout, NULL, _IONBF, 0); puts("READY 262144 stop"); char *line = NULL; size_t capacity = 0; while (getline(&line, &capacity, stdin) >= 0) { if (!strncmp(line, "QUIT", 4)) break; if (!strncmp(line, "GEN ", 4)) { puts("T 65"); puts("DONE 1 1 1.0 2.0 stop"); } } free(line); return 0; }