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

Function TEST

test/diff1.cpp:186–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184using af::sum;
185
186TEST(Diff1, DiffLargeDim) {
187 const size_t largeDim = 65535 * 32 + 1;
188
189 deviceGC();
190 {
191 array in = constant(1, largeDim);
192 array diff = diff1(in, 0);
193 float s = sum<float>(diff, 1);
194 ASSERT_EQ(s, 0.f);
195
196 in = constant(1, 1, largeDim);
197 diff = diff1(in, 1);
198 s = sum<float>(diff, 1);
199 ASSERT_EQ(s, 0.f);
200
201 in = constant(1, 1, 1, largeDim);
202 diff = diff1(in, 2);
203 s = sum<float>(diff, 1);
204 ASSERT_EQ(s, 0.f);
205
206 in = constant(1, 1, 1, 1, largeDim);
207 diff = diff1(in, 3);
208 s = sum<float>(diff, 1);
209 ASSERT_EQ(s, 0.f);
210 }
211}
212
213TEST(Diff1, CPP) {
214 const unsigned dim = 0;

Callers

nothing calls this directly

Calls 3

deviceGCFunction · 0.85
constantFunction · 0.85
diff1Function · 0.50

Tested by

no test coverage detected