MCPcopy Create free account
hub / github.com/ml-explore/mlx / main

Function main

tests/tests.cpp:12–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10using namespace mlx::core;
11
12int main(int argc, char** argv) {
13 doctest::Context context;
14
15 const char* device = std::getenv("DEVICE");
16 if (device != nullptr && std::string(device) == "cpu") {
17 set_default_device(Device::cpu);
18 } else if (is_available(Device::gpu)) {
19 // Use generic GPU availability check (works for Metal on macOS, or CUDA on
20 // Linux/Windows)
21 set_default_device(Device::gpu);
22 }
23
24 context.applyCommandLine(argc, argv);
25 return context.run();
26}

Callers

nothing calls this directly

Calls 4

getenvFunction · 0.85
set_default_deviceFunction · 0.85
is_availableFunction · 0.50
runMethod · 0.45

Tested by

no test coverage detected