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

Function TEST

test/unwrap.cpp:155–187  ·  view source on GitHub ↗

//////////////////////////// CPP ////////////////////////////////////

Source from the content-addressed store, hash-verified

153///////////////////////////////// CPP ////////////////////////////////////
154//
155TEST(Unwrap, CPP) {
156 const unsigned resultIdx = 20;
157 const unsigned wx = 4;
158 const unsigned wy = 4;
159 const unsigned sx = 4;
160 const unsigned sy = 4;
161 const unsigned px = 3;
162 const unsigned py = 3;
163
164 vector<dim4> numDims;
165 vector<vector<float>> in;
166 vector<vector<float>> tests;
167 readTests<float, float, int>(string(TEST_DIR "/unwrap/unwrap_small.test"),
168 numDims, in, tests);
169
170 dim4 idims = numDims[0];
171 array input(idims, &(in[0].front()));
172 array output = unwrap(input, wx, wy, sx, sy, px, py);
173
174 // Get result
175 float* outData = new float[tests[resultIdx].size()];
176 output.host((void*)outData);
177
178 // Compare result
179 size_t nElems = tests[resultIdx].size();
180 for (size_t elIter = 0; elIter < nElems; ++elIter) {
181 ASSERT_EQ(tests[resultIdx][elIter], outData[elIter])
182 << "at: " << elIter << endl;
183 }
184
185 // Delete
186 delete[] outData;
187}
188
189TEST(Unwrap, MaxDim) {
190 const size_t largeDim = 65535 + 1;

Callers

nothing calls this directly

Calls 5

moddimsFunction · 0.85
hostMethod · 0.80
unwrapFunction · 0.50
rangeFunction · 0.50
dim4Class · 0.50

Tested by

no test coverage detected