| 129 | } |
| 130 | |
| 131 | void morphTest(const array input, const array mask, const bool isDilation, |
| 132 | const array gold, int targetDevice) { |
| 133 | UNSUPPORTED_BACKEND(AF_BACKEND_ONEAPI); |
| 134 | setDevice(targetDevice); |
| 135 | |
| 136 | array out; |
| 137 | |
| 138 | for (unsigned i = 0; i < ITERATION_COUNT; ++i) |
| 139 | out = isDilation ? dilate(input, mask) : erode(input, mask); |
| 140 | |
| 141 | ASSERT_IMAGES_NEAR(gold, out, 0.018f); |
| 142 | } |
| 143 | |
| 144 | TEST(Threading, SetPerThreadActiveDevice) { |
| 145 | IMAGEIO_ENABLED_CHECK(); |