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

Function iirTest

test/iir.cpp:123–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121
122template<typename T>
123void iirTest(const char *testFile) {
124 SUPPORTED_TYPE_CHECK(T);
125 vector<dim4> inDims;
126
127 vector<vector<T>> inputs;
128 vector<vector<T>> outputs;
129 readTests<T, T, float>(testFile, inDims, inputs, outputs);
130
131 try {
132 array a = array(inDims[0], &inputs[0][0]);
133 array b = array(inDims[1], &inputs[1][0]);
134 array x = array(inDims[2], &inputs[2][0]);
135
136 array y = iir(b, a, x);
137 vector<T> gold = outputs[0];
138 ASSERT_EQ(gold.size(), (size_t)y.elements());
139
140 vector<T> out(y.elements());
141 y.host(&out[0]);
142
143 for (size_t i = 0; i < gold.size(); i++) {
144 ASSERT_NEAR(real(out[i]), real(gold[i]), 0.01) << "at: " << i;
145 }
146
147 } catch (exception &ex) { FAIL() << ex.what(); }
148}
149
150TYPED_TEST(filter, iirVecVec) {
151 iirTest<TypeParam>(TEST_DIR "/iir/iir_vv.test");

Callers

nothing calls this directly

Calls 5

hostMethod · 0.80
realFunction · 0.70
arrayClass · 0.50
iirFunction · 0.50
elementsMethod · 0.45

Tested by

no test coverage detected