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

Function iotaTest

test/iota.cpp:50–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48
49template<typename T>
50void iotaTest(const dim4 idims, const dim4 tdims) {
51 SUPPORTED_TYPE_CHECK(T);
52
53 af_array outArray = 0;
54
55 ASSERT_SUCCESS(af_iota(&outArray, idims.ndims(), idims.get(), tdims.ndims(),
56 tdims.get(), (af_dtype)dtype_traits<T>::af_type));
57
58 af_array temp0 = 0, temp1 = 0, temp2 = 0;
59 dim4 tempdims(idims.elements());
60 dim4 fulldims;
61 for (unsigned i = 0; i < 4; i++) { fulldims[i] = idims[i] * tdims[i]; }
62 ASSERT_SUCCESS(af_range(&temp2, tempdims.ndims(), tempdims.get(), 0,
63 (af_dtype)dtype_traits<T>::af_type));
64 ASSERT_SUCCESS(af_moddims(&temp1, temp2, idims.ndims(), idims.get()));
65 ASSERT_SUCCESS(
66 af_tile(&temp0, temp1, tdims[0], tdims[1], tdims[2], tdims[3]));
67
68 ASSERT_ARRAYS_EQ(temp0, outArray);
69
70 if (outArray != 0) af_release_array(outArray);
71 if (temp0 != 0) af_release_array(temp0);
72 if (temp1 != 0) af_release_array(temp1);
73 if (temp2 != 0) af_release_array(temp2);
74}
75
76#define IOTA_INIT(desc, x, y, z, w, a, b, c, d) \
77 TYPED_TEST(Iota, desc) { \

Callers

nothing calls this directly

Calls 8

af_iotaFunction · 0.50
af_rangeFunction · 0.50
af_moddimsFunction · 0.50
af_tileFunction · 0.50
af_release_arrayFunction · 0.50
ndimsMethod · 0.45
getMethod · 0.45
elementsMethod · 0.45

Tested by

no test coverage detected