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

Function dotAllTest

test/dot.cpp:115–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113
114template<typename T>
115void dotAllTest(string pTestFile, const int resultIdx,
116 const af_mat_prop optLhs = AF_MAT_NONE,
117 const af_mat_prop optRhs = AF_MAT_NONE) {
118 SUPPORTED_TYPE_CHECK(T);
119
120 vector<dim4> numDims;
121 vector<vector<T>> in;
122 vector<vector<T>> tests;
123
124 readTests<T, T, T>(pTestFile, numDims, in, tests);
125
126 dim4 aDims = numDims[0];
127 dim4 bDims = numDims[1];
128
129 af_array a = 0;
130 af_array b = 0;
131
132 ASSERT_SUCCESS(af_create_array(&a, &(in[0].front()), aDims.ndims(),
133 aDims.get(),
134 (af_dtype)dtype_traits<T>::af_type));
135 ASSERT_SUCCESS(af_create_array(&b, &(in[1].front()), bDims.ndims(),
136 bDims.get(),
137 (af_dtype)dtype_traits<T>::af_type));
138
139 double rval = 0, ival = 0;
140 ASSERT_SUCCESS(af_dot_all(&rval, &ival, a, b, optLhs, optRhs));
141
142 vector<T> goldData = tests[resultIdx];
143
144 using ::isinf;
145 using std::isinf;
146 if (false == (isinf(rval) && isinf(goldData[0]))) {
147 compare<T>(rval, ival, goldData[0]);
148 }
149
150 ASSERT_SUCCESS(af_release_array(a));
151 ASSERT_SUCCESS(af_release_array(b));
152}
153
154#define INSTANTIATEF(SIZE, FILENAME) \
155 TYPED_TEST(DotF, DotF_##SIZE) { \

Callers

nothing calls this directly

Calls 6

isinfFunction · 0.70
af_create_arrayFunction · 0.50
af_dot_allFunction · 0.50
af_release_arrayFunction · 0.50
ndimsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected