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

Function TEST

test/blas.cpp:240–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238
239float batch_tol = 1E-2;
240TEST(MatrixMultiply, Batched) {
241 const int M = 512;
242 const int K = 512;
243 const int N = 10;
244 const int D2 = 2;
245 const int D3 = 3;
246 for (int d3 = 1; d3 <= D3; d3 *= D3) {
247 for (int d2 = 1; d2 <= D2; d2 *= D2) {
248 array a = randu(M, K, d2, d3);
249 array b = randu(K, N, d2, d3);
250 array c = matmul(a, b);
251
252 for (int j = 0; j < d3; j++) {
253 for (int i = 0; i < d2; i++) {
254 array a_ij = a(span, span, i, j);
255 array b_ij = b(span, span, i, j);
256 array c_ij = c(span, span, i, j);
257 array res = matmul(a_ij, b_ij);
258 ASSERT_ARRAYS_NEAR(c_ij, res, batch_tol);
259 }
260 }
261 }
262 }
263}
264
265#undef DEVICE_ITERATE
266

Callers

nothing calls this directly

Calls 15

randuFunction · 0.85
matmulTTFunction · 0.85
constantFunction · 0.85
TMethod · 0.80
asMethod · 0.80
hostMethod · 0.80
matmulFunction · 0.50
arrayClass · 0.50
af_gemmFunction · 0.50
af_get_active_backendFunction · 0.50
af_constantFunction · 0.50
af_retain_arrayFunction · 0.50

Tested by

no test coverage detected