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

Function testFunction

test/backend.cpp:39–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39void testFunction(af_backend expected) {
40 af_backend activeBackend = (af_backend)0;
41 af_get_active_backend(&activeBackend);
42
43 ASSERT_EQ(expected, activeBackend);
44
45 af_array outArray = 0;
46 dim_t dims[] = {32, 32};
47 EXPECT_EQ(AF_SUCCESS, af_randu(&outArray, 2, dims, f32));
48
49 // Verify backends returned by array and by function are the same
50 af_backend arrayBackend = (af_backend)0;
51 af_get_backend_id(&arrayBackend, outArray);
52 EXPECT_EQ(arrayBackend, activeBackend);
53
54 // cleanup
55 if (outArray != 0) { ASSERT_SUCCESS(af_release_array(outArray)); }
56}
57
58void backendTest() {
59 int backends = getAvailableBackends();

Callers 1

backendTestFunction · 0.70

Calls 4

af_get_active_backendFunction · 0.50
af_randuFunction · 0.50
af_get_backend_idFunction · 0.50
af_release_arrayFunction · 0.50

Tested by

no test coverage detected