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

Function tileTest

test/tile.cpp:58–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56
57template<typename T>
58void 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) { \

Callers

nothing calls this directly

Calls 6

af_create_arrayFunction · 0.50
af_indexFunction · 0.50
af_tileFunction · 0.50
af_release_arrayFunction · 0.50
ndimsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected