Files
leleka/scripts/fixtures/embedded-worker.c
T
Pavlo Ratushnyi 4013e0c9bd
Desktop foundation / core (ubuntu-latest) (push) Failing after 28s
Desktop foundation / core (macos-latest) (push) Canceled after 0s
Desktop foundation / core (windows-latest) (push) Canceled after 0s
Linux / verify (push) Canceled after 0s
Linux / keyless-cuda (push) Canceled after 0s
Linux / static-cuda-package (push) Canceled after 0s
Linux / hosted-cuda-package (push) Canceled after 0s
Linux / linux-static-cli (push) Canceled after 0s
Linux / linux-cli-container (push) Canceled after 0s
Linux / release-cli (push) Canceled after 0s
Import tracked Strata Next source snapshot
2026-10-05 18:15:08 +02:00

33 lines
982 B
C

/* Synthetic CPU protocol fixture; never reads model data or initializes CUDA. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
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;
}