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

Function Test_flip_1D

test/flip.cpp:27–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25using af::span;
26
27void Test_flip_1D(const af::dtype dt) {
28 const int num = 10000;
29 array in = randu(num, dt);
30 array out = flip(in, 0);
31
32 float *h_in = in.as(f32).host<float>();
33 float *h_out = out.as(f32).host<float>();
34
35 for (int i = 0; i < num; i++) {
36 ASSERT_EQ(h_in[num - i - 1], h_out[i]) << "at (" << i << ")";
37 }
38
39 freeHost(h_in);
40 freeHost(h_out);
41}
42
43TEST(FlipTests, Test_flip_1D_f32) { Test_flip_1D(f32); }
44

Callers 1

TESTFunction · 0.85

Calls 4

randuFunction · 0.85
freeHostFunction · 0.85
asMethod · 0.80
flipFunction · 0.50

Tested by

no test coverage detected