MCPcopy Create free account
hub / github.com/antirez/ds4 / parse_backend

Function parse_backend

ds4_eval.c:1471–1486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1469 fprintf(stderr, "ds4-eval: invalid value for %s: %s\n", opt, s);
1470 exit(2);
1471 }
1472 return v;
1473}
1474
1475static const char *need_arg(int *i, int argc, char **argv, const char *opt) {
1476 if (*i + 1 >= argc) {
1477 fprintf(stderr, "ds4-eval: %s requires an argument\n", opt);
1478 exit(2);
1479 }
1480 return argv[++*i];
1481}
1482
1483static ds4_backend parse_backend(const char *s, const char *opt) {
1484 if (!strcmp(s, "metal")) return DS4_BACKEND_METAL;
1485#ifdef DS4_ROCM_BUILD
1486 if (!strcmp(s, "rocm")) return DS4_BACKEND_CUDA;
1487#else
1488 if (!strcmp(s, "cuda")) return DS4_BACKEND_CUDA;
1489#endif

Callers 1

parse_optionsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected