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

Function TEST

test/medfilt.cpp:349–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347using af::array;
348
349TEST(MedianFilter, CPP) {
350 UNSUPPORTED_BACKEND(AF_BACKEND_ONEAPI);
351 const dim_t w_len = 3;
352 const dim_t w_wid = 3;
353
354 vector<dim4> numDims;
355 vector<vector<float>> in;
356 vector<vector<float>> tests;
357
358 readTests<float, float, int>(
359 string(TEST_DIR "/medianfilter/batch_symmetric_pad_3x3_window.test"),
360 numDims, in, tests);
361
362 dim4 dims = numDims[0];
363 array input(dims, &(in[0].front()));
364 array output = medfilt(input, w_len, w_wid, AF_PAD_SYM);
365
366 vector<float> outData(dims.elements());
367 output.host((void*)outData.data());
368
369 vector<float> currGoldBar = tests[0];
370 size_t nElems = currGoldBar.size();
371 for (size_t elIter = 0; elIter < nElems; ++elIter) {
372 ASSERT_EQ(currGoldBar[elIter], outData[elIter])
373 << "at: " << elIter << endl;
374 }
375}
376
377TEST(MedianFilter1d, CPP) {
378 UNSUPPORTED_BACKEND(AF_BACKEND_ONEAPI);

Callers

nothing calls this directly

Calls 9

medfiltFunction · 0.85
constantFunction · 0.85
hostMethod · 0.80
absFunction · 0.70
medfilt1Function · 0.50
arrayClass · 0.50
dim4Class · 0.50
iotaFunction · 0.50
elementsMethod · 0.45

Tested by

no test coverage detected