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

Function bilateralDataTest

test/bilateral.cpp:84–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82
83template<typename inType>
84void bilateralDataTest(string pTestFile) {
85 SUPPORTED_TYPE_CHECK(inType);
86
87 typedef typename cond_type<is_same_type<inType, double>::value, double,
88 float>::type outType;
89
90 vector<dim4> numDims;
91 vector<vector<inType>> in;
92 vector<vector<outType>> tests;
93
94 readTests<inType, outType, float>(pTestFile, numDims, in, tests);
95
96 dim4 dims = numDims[0];
97 af_array outArray = 0;
98 af_array inArray = 0;
99
100 ASSERT_SUCCESS(af_create_array(&inArray, &(in[0].front()), dims.ndims(),
101 dims.get(),
102 (af_dtype)dtype_traits<inType>::af_type));
103
104 ASSERT_SUCCESS(af_bilateral(&outArray, inArray, 2.25f, 25.56f, false));
105
106 vector<outType> outData(dims.elements());
107
108 ASSERT_SUCCESS(af_get_data_ptr((void*)outData.data(), outArray));
109
110 for (size_t testIter = 0; testIter < tests.size(); ++testIter) {
111 vector<outType> currGoldBar = tests[testIter];
112 size_t nElems = currGoldBar.size();
113 ASSERT_EQ(true, compareArraysRMSD(nElems, &currGoldBar.front(),
114 outData.data(), 0.02f));
115 }
116
117 // cleanup
118 ASSERT_SUCCESS(af_release_array(inArray));
119 ASSERT_SUCCESS(af_release_array(outArray));
120}
121
122TYPED_TEST(BilateralOnData, Rectangle) {
123 bilateralDataTest<TypeParam>(string(TEST_DIR "/bilateral/rectangle.test"));

Callers

nothing calls this directly

Calls 8

compareArraysRMSDFunction · 0.85
af_create_arrayFunction · 0.50
af_bilateralFunction · 0.50
af_get_data_ptrFunction · 0.50
af_release_arrayFunction · 0.50
ndimsMethod · 0.45
getMethod · 0.45
elementsMethod · 0.45

Tested by

no test coverage detected