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

Function TEST

test/basic.cpp:22–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20using std::vector;
21
22TEST(BasicTests, constant1000x1000) {
23 static const int ndims = 2;
24 static const int dim_size = 1000;
25 dim_t d[ndims] = {dim_size, dim_size};
26
27 double valA = 3.9;
28 af_array a;
29 ASSERT_SUCCESS(af_constant(&a, valA, ndims, d, f32));
30
31 vector<float> h_a(dim_size * dim_size, 100);
32 ASSERT_SUCCESS(af_get_data_ptr((void **)&h_a[0], a));
33
34 size_t elements = dim_size * dim_size;
35 for (size_t i = 0; i < elements; i++) { ASSERT_FLOAT_EQ(valA, h_a[i]); }
36
37 ASSERT_SUCCESS(af_release_array(a));
38}
39
40TEST(BasicTests, constant10x10) {
41 static const int ndims = 2;

Callers

nothing calls this directly

Calls 9

af_addFunction · 0.85
constantFunction · 0.85
assertArrayEqFunction · 0.85
assertArrayNearFunction · 0.85
hostMethod · 0.80
af_constantFunction · 0.50
af_get_data_ptrFunction · 0.50
af_release_arrayFunction · 0.50
elementsMethod · 0.45

Tested by

no test coverage detected