| 56 | |
| 57 | template<typename T> |
| 58 | void tileTest(string pTestFile, const unsigned resultIdx, const uint x, |
| 59 | const uint y, const uint z, const uint w, bool isSubRef = false, |
| 60 | const vector<af_seq>* seqv = NULL) { |
| 61 | SUPPORTED_TYPE_CHECK(T); |
| 62 | |
| 63 | vector<dim4> numDims; |
| 64 | vector<vector<T>> in; |
| 65 | vector<vector<T>> tests; |
| 66 | readTests<T, T, int>(pTestFile, numDims, in, tests); |
| 67 | |
| 68 | dim4 idims = numDims[0]; |
| 69 | |
| 70 | af_array inArray = 0; |
| 71 | af_array outArray = 0; |
| 72 | af_array tempArray = 0; |
| 73 | |
| 74 | if (isSubRef) { |
| 75 | ASSERT_SUCCESS(af_create_array(&tempArray, &(in[0].front()), |
| 76 | idims.ndims(), idims.get(), |
| 77 | (af_dtype)dtype_traits<T>::af_type)); |
| 78 | |
| 79 | ASSERT_SUCCESS( |
| 80 | af_index(&inArray, tempArray, seqv->size(), &seqv->front())); |
| 81 | } else { |
| 82 | ASSERT_SUCCESS(af_create_array(&inArray, &(in[0].front()), |
| 83 | idims.ndims(), idims.get(), |
| 84 | (af_dtype)dtype_traits<T>::af_type)); |
| 85 | } |
| 86 | |
| 87 | ASSERT_SUCCESS(af_tile(&outArray, inArray, x, y, z, w)); |
| 88 | |
| 89 | dim4 goldDims(idims[0] * x, idims[1] * y, idims[2] * z, idims[3] * w); |
| 90 | ASSERT_VEC_ARRAY_EQ(tests[resultIdx], goldDims, outArray); |
| 91 | |
| 92 | if (inArray != 0) af_release_array(inArray); |
| 93 | if (outArray != 0) af_release_array(outArray); |
| 94 | if (tempArray != 0) af_release_array(tempArray); |
| 95 | } |
| 96 | |
| 97 | #define TILE_INIT(desc, file, resultIdx, x, y, z, w) \ |
| 98 | TYPED_TEST(Tile, desc) { \ |
nothing calls this directly
no test coverage detected