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

Function TEST

test/diff2.cpp:179–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179TEST(Diff2, DiffLargeDim) {
180 const size_t largeDim = 65535 * 32 + 1;
181
182 deviceGC();
183 {
184 array in = constant(1, largeDim);
185 array diff = diff2(in, 0);
186 float s = sum<float>(diff, 1);
187 ASSERT_EQ(s, 0.f);
188
189 in = constant(1, 1, largeDim);
190 diff = diff2(in, 1);
191 s = sum<float>(diff, 1);
192 ASSERT_EQ(s, 0.f);
193
194 in = constant(1, 1, 1, largeDim);
195 diff = diff2(in, 2);
196 s = sum<float>(diff, 1);
197 ASSERT_EQ(s, 0.f);
198
199 in = constant(1, 1, 1, 1, largeDim);
200 diff = diff2(in, 3);
201 s = sum<float>(diff, 1);
202 ASSERT_EQ(s, 0.f);
203 }
204}
205
206////////////////////////////////// CPP ////////////////////////////////////////
207//

Callers

nothing calls this directly

Calls 4

deviceGCFunction · 0.85
constantFunction · 0.85
diff2Function · 0.50
dimsMethod · 0.45

Tested by

no test coverage detected