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

Function TYPED_TEST

test/dog.cpp:43–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41TYPED_TEST_SUITE(DOG, TestTypes);
42
43TYPED_TEST(DOG, Basic) {
44 SUPPORTED_TYPE_CHECK(TypeParam);
45
46 dim4 iDims(512, 512, 1, 1);
47 array in = constant(1, iDims, (af_dtype)dtype_traits<float>::af_type);
48 /* calculate DOG using ArrayFire functions */
49 array k1 = gaussianKernel(3, 3);
50 array k2 = gaussianKernel(2, 2);
51 array smth1 = convolve2(in, k1);
52 array smth2 = convolve2(in, k2);
53 array diff = smth1 - smth2;
54 /* calcuate DOG using new function */
55 array out = dog(in, 3, 2);
56 /* compare both the values */
57 float accumErr = sum<float>(out - diff);
58 EXPECT_EQ(true, accumErr < 1.0e-2);
59}
60
61TYPED_TEST(DOG, Batch) {
62 SUPPORTED_TYPE_CHECK(TypeParam);

Callers

nothing calls this directly

Calls 5

constantFunction · 0.85
randuFunction · 0.85
gaussianKernelFunction · 0.50
convolve2Function · 0.50
dogFunction · 0.50

Tested by

no test coverage detected