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

Function TEST

test/triangle.cpp:150–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150TEST(Lower, ExtractGFOR) {
151 using af::constant;
152 using af::lower;
153 using af::max;
154 using af::round;
155 using af::seq;
156 using af::span;
157
158 dim4 dims = dim4(100, 100, 3);
159 array A = round(100 * randu(dims));
160 array B = constant(0, 100, 100, 3);
161
162 gfor(seq ii, 3) { B(span, span, ii) = lower(A(span, span, ii)); }
163
164 for (int ii = 0; ii < 3; ii++) {
165 array c_ii = lower(A(span, span, ii));
166 array b_ii = B(span, span, ii);
167 ASSERT_EQ(max<double>(abs(c_ii - b_ii)) < 1E-5, true);
168 }
169}

Callers

nothing calls this directly

Calls 6

roundFunction · 0.85
randuFunction · 0.85
constantFunction · 0.85
lowerFunction · 0.85
absFunction · 0.70
dim4Class · 0.50

Tested by

no test coverage detected