MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / main

Function main

examples/benchmarks/pi.cpp:49–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47static void host_wrapper() { pi_host(); }
48
49int main(int argc, char** argv) {
50 try {
51 int device = argc > 1 ? atoi(argv[1]) : 0;
52 setDevice(device);
53 info();
54
55 printf("device: %.5f seconds to estimate pi = %.5f\n",
56 timeit(device_wrapper), pi_device());
57 printf(" host: %.5f seconds to estimate pi = %.5f\n",
58 timeit(host_wrapper), pi_host());
59 } catch (exception& e) {
60 fprintf(stderr, "%s\n", e.what());
61 throw;
62 }
63
64 return 0;
65}

Callers

nothing calls this directly

Calls 5

infoFunction · 0.85
timeitFunction · 0.85
pi_deviceFunction · 0.85
pi_hostFunction · 0.85
setDeviceFunction · 0.50

Tested by

no test coverage detected