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

Function main

examples/unified/basic.cpp:35–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35int main(int, char**) {
36 std::generate(input.begin(), input.end(), unifRand);
37
38 try {
39 printf("Trying CPU Backend\n");
40 af::setBackend(AF_BACKEND_CPU);
41 testBackend();
42 } catch (af::exception& e) {
43 printf("Caught exception when trying CPU backend\n");
44 fprintf(stderr, "%s\n", e.what());
45 }
46
47 try {
48 printf("Trying CUDA Backend\n");
49 af::setBackend(AF_BACKEND_CUDA);
50 testBackend();
51 } catch (af::exception& e) {
52 printf("Caught exception when trying CUDA backend\n");
53 fprintf(stderr, "%s\n", e.what());
54 }
55
56 try {
57 printf("Trying OpenCL Backend\n");
58 af::setBackend(AF_BACKEND_OPENCL);
59 testBackend();
60 } catch (af::exception& e) {
61 printf("Caught exception when trying OpenCL backend\n");
62 fprintf(stderr, "%s\n", e.what());
63 }
64
65 return 0;
66}

Callers

nothing calls this directly

Calls 2

testBackendFunction · 0.85
setBackendFunction · 0.50

Tested by

no test coverage detected