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

Function main

examples/benchmarks/fft.cpp:24–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24int main(int argc, char** argv) {
25 try {
26 int device = argc > 1 ? atoi(argv[1]) : 0;
27 setDevice(device);
28 info();
29
30 printf("Benchmark N-by-N 2D fft\n");
31 for (int M = 7; M <= 12; M++) {
32 int N = (1 << M);
33
34 printf("%4d x %4d: ", N, N);
35 A = randu(N, N);
36 double time = timeit(fn); // time in seconds
37 double gflops = 10.0 * N * N * M / (time * 1e9);
38
39 printf(" %4.0f Gflops\n", gflops);
40 fflush(stdout);
41 }
42 } catch (af::exception& e) { fprintf(stderr, "%s\n", e.what()); }
43
44 return 0;
45}

Callers

nothing calls this directly

Calls 4

infoFunction · 0.85
randuFunction · 0.85
timeitFunction · 0.85
setDeviceFunction · 0.50

Tested by

no test coverage detected