MAGMA  magma-1.4.0
Matrix Algebra on GPU and Multicore Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
testing_zblas.cpp
Go to the documentation of this file.
1 /*
2  -- MAGMA (version 1.4.0) --
3  Univ. of Tennessee, Knoxville
4  Univ. of California, Berkeley
5  Univ. of Colorado, Denver
6  August 2013
7 
8  @precisions normal z -> c d s
9  @author Mark Gates
10 */
11 #include <stdlib.h>
12 #include <stdio.h>
13 
14 // make sure that asserts are enabled
15 #ifdef NDEBUG
16 #undef NDEBUG
17 #endif
18 #include <assert.h>
19 
20 // includes, project
21 #include "flops.h"
22 #include "magma.h"
23 #include "magma_lapack.h"
24 #include "testings.h"
25 
26 #define A(i,j) &A[ (i) + (j)*ld ]
27 #define dA(i,j) &dA[ (i) + (j)*ld ]
28 #define dB(i,j) &dB[ (i) + (j)*ld ]
29 #define C2(i,j) &C2[ (i) + (j)*ld ]
30 #define LU(i,j) &LU[ (i) + (j)*ld ]
31 
32 int main( int argc, char** argv )
33 {
34  TESTING_INIT();
35 
36  real_Double_t gflops, t1, t2;
37  magmaDoubleComplex c_neg_one = MAGMA_Z_NEG_ONE;
38  magma_int_t ione = 1;
39  const char trans[] = { 'N', 'C', 'T' };
40  const char uplo[] = { 'L', 'U' };
41  const char diag[] = { 'U', 'N' };
42  const char side[] = { 'L', 'R' };
43 
44  magmaDoubleComplex *A, *B, *C, *C2, *LU;
45  magmaDoubleComplex *dA, *dB, *dC1, *dC2;
46  magmaDoubleComplex alpha = MAGMA_Z_MAKE( 0.5, 0.1 );
47  magmaDoubleComplex beta = MAGMA_Z_MAKE( 0.7, 0.2 );
48  double dalpha = 0.6;
49  double dbeta = 0.8;
50  double work[1], error, total_error;
51  magma_int_t ISEED[4] = {0,0,0,1};
52  magma_int_t m, n, k, size, maxn, ld, info;
53  magma_int_t *piv;
54  magma_err_t err;
55 
56  magma_opts opts;
57  parse_opts( argc, argv, &opts );
58 
59  printf( "Compares magma wrapper function to cublas function; all diffs should be exactly 0.\n\n" );
60 
61  total_error = 0.;
62  for( int i = 0; i < opts.ntest; ++i ) {
63  m = opts.msize[i];
64  n = opts.nsize[i];
65  k = opts.ksize[i];
66  printf("=========================================================================\n");
67  printf( "M %d, N %d, K %d\n", (int) m, (int) n, (int) k );
68 
69  // allocate matrices
70  // over-allocate so they can be any combination of {m,n,k} x {m,n,k}.
71  maxn = max( max( m, n ), k );
72  ld = maxn;
73  size = maxn*maxn;
74  err = magma_malloc_cpu( (void**) &piv, maxn*sizeof(magma_int_t) ); assert( err == 0 );
75  err = magma_zmalloc_pinned( &A, size ); assert( err == 0 );
76  err = magma_zmalloc_pinned( &B, size ); assert( err == 0 );
77  err = magma_zmalloc_pinned( &C, size ); assert( err == 0 );
78  err = magma_zmalloc_pinned( &C2, size ); assert( err == 0 );
79  err = magma_zmalloc_pinned( &LU, size ); assert( err == 0 );
80  err = magma_zmalloc( &dA, size ); assert( err == 0 );
81  err = magma_zmalloc( &dB, size ); assert( err == 0 );
82  err = magma_zmalloc( &dC1, size ); assert( err == 0 );
83  err = magma_zmalloc( &dC2, size ); assert( err == 0 );
84 
85  // initialize matrices
86  size = maxn*maxn;
87  lapackf77_zlarnv( &ione, ISEED, &size, A );
88  lapackf77_zlarnv( &ione, ISEED, &size, B );
89  lapackf77_zlarnv( &ione, ISEED, &size, C );
90 
91  printf( "========== Level 1 BLAS ==========\n" );
92 
93  // ----- test ZSWAP
94  // swap 2nd and 3rd columns of dA, then copy to C2 and compare with A
95  assert( n >= 4 );
96  magma_zsetmatrix( m, n, A, ld, dA, ld );
97  magma_zsetmatrix( m, n, A, ld, dB, ld );
98  magma_zswap( m, dA(0,1), 1, dA(0,2), 1 );
99  magma_zswap( m, dB(0,1), 1, dB(0,2), 1 );
100 
101  // check results, storing diff between magma and cuda calls in C2
102  cublasZaxpy( ld*n, c_neg_one, dA, 1, dB, 1 );
103  magma_zgetmatrix( m, n, dB, ld, C2, ld );
104  error = lapackf77_zlange( "F", &m, &k, C2, &ld, work );
105  total_error += error;
106  printf( "zswap diff %.2g\n", error );
107 
108  // ----- test IZAMAX
109  // get argmax of column of A
110  magma_zsetmatrix( m, k, A, ld, dA, ld );
111  error = 0;
112  for( int j = 0; j < k; ++j ) {
113  magma_int_t i1 = magma_izamax( m, dA(0,j), 1 );
114  magma_int_t i2 = cublasIzamax( m, dA(0,j), 1 );
115  assert( i1 == i2 );
116  error += abs( i1 - i2 );
117  }
118  total_error += error;
119  gflops = (double)m * k / 1e9;
120  printf( "izamax diff %.2g\n", error );
121  printf( "\n" );
122 
123  printf( "========== Level 2 BLAS ==========\n" );
124 
125  // ----- test ZGEMV
126  // c = alpha*A*b + beta*c, with A m*n; b,c m or n-vectors
127  // try no-trans/trans
128  for( int ia = 0; ia < 3; ++ia ) {
129  magma_zsetmatrix( m, n, A, ld, dA, ld );
130  magma_zsetvector( maxn, B, 1, dB, 1 );
131  magma_zsetvector( maxn, C, 1, dC1, 1 );
132  magma_zsetvector( maxn, C, 1, dC2, 1 );
133  t1 = magma_sync_wtime( 0 );
134  magma_zgemv( trans[ia], m, n, alpha, dA, ld, dB, 1, beta, dC1, 1 );
135  t1 = magma_sync_wtime( 0 ) - t1;
136  t2 = magma_sync_wtime( 0 );
137  cublasZgemv( trans[ia], m, n, alpha, dA, ld, dB, 1, beta, dC2, 1 );
138  t2 = magma_sync_wtime( 0 ) - t2;
139 
140  // check results, storing diff between magma and cuda call in C2
141  size = (trans[ia] == 'N' ? m : n);
142  cublasZaxpy( size, c_neg_one, dC1, 1, dC2, 1 );
143  magma_zgetvector( size, dC2, 1, C2, 1 );
144  error = lapackf77_zlange( "F", &size, &ione, C2, &ld, work );
145  total_error += error;
146  gflops = FLOPS_ZGEMV( m, n ) / 1e9;
147  printf( "zgemv( %c ) diff %.2g, Gflop/s %6.2f, %6.2f\n",
148  trans[ia], error, gflops/t1, gflops/t2 );
149  }
150  printf( "\n" );
151 
152  // ----- test ZHEMV
153  // c = alpha*A*b + beta*c, with A m*m symmetric; b,c m-vectors
154  // try upper/lower
155  for( int iu = 0; iu < 2; ++iu ) {
156  magma_zsetmatrix( m, m, A, ld, dA, ld );
157  magma_zsetvector( m, B, 1, dB, 1 );
158  magma_zsetvector( m, C, 1, dC1, 1 );
159  magma_zsetvector( m, C, 1, dC2, 1 );
160  t1 = magma_sync_wtime( 0 );
161  magma_zhemv( uplo[iu], m, alpha, dA, ld, dB, 1, beta, dC1, 1 );
162  t1 = magma_sync_wtime( 0 ) - t1;
163  t2 = magma_sync_wtime( 0 );
164  cublasZhemv( uplo[iu], m, alpha, dA, ld, dB, 1, beta, dC2, 1 );
165  t2 = magma_sync_wtime( 0 ) - t2;
166 
167  // check results, storing diff between magma and cuda call in C2
168  cublasZaxpy( m, c_neg_one, dC1, 1, dC2, 1 );
169  magma_zgetvector( m, dC2, 1, C2, 1 );
170  error = lapackf77_zlange( "F", &m, &ione, C2, &ld, work );
171  total_error += error;
172  gflops = FLOPS_ZHEMV( m ) / 1e9;
173  printf( "zhemv( %c ) diff %.2g, Gflop/s %6.2f, %6.2f\n",
174  uplo[iu], error, gflops/t1, gflops/t2 );
175  }
176  printf( "\n" );
177 
178  // ----- test ZTRSV
179  // solve A*c = c, with A m*m triangular; c m-vector
180  // try upper/lower, no-trans/trans, unit/non-unit diag
181  // Factor A into LU to get well-conditioned triangles, else solve yields garbage.
182  // Still can give garbage if solves aren't consistent with LU factors,
183  // e.g., using unit diag for U, so copy lower triangle to upper triangle.
184  // Also used for trsm later.
185  lapackf77_zlacpy( "Full", &maxn, &maxn, A, &ld, LU, &ld );
186  lapackf77_zgetrf( &maxn, &maxn, LU, &ld, piv, &info );
187  for( int j = 0; j < maxn; ++j ) {
188  for( int i = 0; i < j; ++i ) {
189  *LU(i,j) = *LU(j,i);
190  }
191  }
192  for( int iu = 0; iu < 2; ++iu ) {
193  for( int it = 0; it < 3; ++it ) {
194  for( int id = 0; id < 2; ++id ) {
195  magma_zsetmatrix( m, m, LU, ld, dA, ld );
196  magma_zsetvector( m, C, 1, dC1, 1 );
197  magma_zsetvector( m, C, 1, dC2, 1 );
198  t1 = magma_sync_wtime( 0 );
199  magma_ztrsv( uplo[iu], trans[it], diag[id], m, dA, ld, dC1, 1 );
200  t1 = magma_sync_wtime( 0 ) - t1;
201  t2 = magma_sync_wtime( 0 );
202  cublasZtrsv( uplo[iu], trans[it], diag[id], m, dA, ld, dC2, 1 );
203  t2 = magma_sync_wtime( 0 ) - t2;
204 
205  // check results, storing diff between magma and cuda call in C2
206  cublasZaxpy( m, c_neg_one, dC1, 1, dC2, 1 );
207  magma_zgetvector( m, dC2, 1, C2, 1 );
208  error = lapackf77_zlange( "F", &m, &ione, C2, &ld, work );
209  total_error += error;
210  gflops = FLOPS_ZTRSM( MagmaLeft, m, 1 ) / 1e9;
211  printf( "ztrsv( %c, %c, %c ) diff %.2g, Gflop/s %6.2f, %6.2f\n",
212  uplo[iu], trans[it], diag[id], error, gflops/t1, gflops/t2 );
213  }}}
214  printf( "\n" );
215 
216  printf( "========== Level 3 BLAS ==========\n" );
217 
218  // ----- test ZGEMM
219  // C = alpha*A*B + beta*C, with A m*k or k*m; B k*n or n*k; C m*n
220  // try combinations of no-trans/trans
221  for( int ia = 0; ia < 3; ++ia ) {
222  for( int ib = 0; ib < 3; ++ib ) {
223  bool nta = (trans[ia] == 'N');
224  bool ntb = (trans[ib] == 'N');
225  magma_zsetmatrix( (nta ? m : k), (nta ? m : k), A, ld, dA, ld );
226  magma_zsetmatrix( (ntb ? k : n), (ntb ? n : k), B, ld, dB, ld );
227  magma_zsetmatrix( m, n, C, ld, dC1, ld );
228  magma_zsetmatrix( m, n, C, ld, dC2, ld );
229  t1 = magma_sync_wtime( 0 );
230  magma_zgemm( trans[ia], trans[ib], m, n, k, alpha, dA, ld, dB, ld, beta, dC1, ld );
231  t1 = magma_sync_wtime( 0 ) - t1;
232  t2 = magma_sync_wtime( 0 );
233  cublasZgemm( trans[ia], trans[ib], m, n, k, alpha, dA, ld, dB, ld, beta, dC2, ld );
234  t2 = magma_sync_wtime( 0 ) - t2;
235 
236  // check results, storing diff between magma and cuda call in C2
237  cublasZaxpy( ld*n, c_neg_one, dC1, 1, dC2, 1 );
238  magma_zgetmatrix( m, n, dC2, ld, C2, ld );
239  error = lapackf77_zlange( "F", &m, &n, C2, &ld, work );
240  total_error += error;
241  gflops = FLOPS_ZGEMM( m, n, k ) / 1e9;
242  printf( "zgemm( %c, %c ) diff %.2g, Gflop/s %6.2f, %6.2f\n",
243  trans[ia], trans[ib], error, gflops/t1, gflops/t2 );
244  }}
245  printf( "\n" );
246 
247  // ----- test ZHEMM
248  // C = alpha*A*B + beta*C (left) with A m*m symmetric; B,C m*n; or
249  // C = alpha*B*A + beta*C (right) with A n*n symmetric; B,C m*n
250  // try left/right, upper/lower
251  for( int is = 0; is < 2; ++is ) {
252  for( int iu = 0; iu < 2; ++iu ) {
253  magma_zsetmatrix( m, m, A, ld, dA, ld );
254  magma_zsetmatrix( m, n, B, ld, dB, ld );
255  magma_zsetmatrix( m, n, C, ld, dC1, ld );
256  magma_zsetmatrix( m, n, C, ld, dC2, ld );
257  t1 = magma_sync_wtime( 0 );
258  magma_zhemm( side[is], uplo[iu], m, n, alpha, dA, ld, dB, ld, beta, dC1, ld );
259  t1 = magma_sync_wtime( 0 ) - t1;
260  t2 = magma_sync_wtime( 0 );
261  cublasZhemm( side[is], uplo[iu], m, n, alpha, dA, ld, dB, ld, beta, dC2, ld );
262  t2 = magma_sync_wtime( 0 ) - t2;
263 
264  // check results, storing diff between magma and cuda call in C2
265  cublasZaxpy( ld*n, c_neg_one, dC1, 1, dC2, 1 );
266  magma_zgetmatrix( m, n, dC2, ld, C2, ld );
267  error = lapackf77_zlange( "F", &m, &n, C2, &ld, work );
268  total_error += error;
269  gflops = FLOPS_ZHEMM( side[is], m, n ) / 1e9;
270  printf( "zhemm( %c, %c ) diff %.2g, Gflop/s %6.2f, %6.2f\n",
271  side[is], uplo[iu], error, gflops/t1, gflops/t2 );
272  }}
273  printf( "\n" );
274 
275  // ----- test ZHERK
276  // C = alpha*A*A^H + beta*C (no-trans) with A m*k and C m*m symmetric; or
277  // C = alpha*A^H*A + beta*C (trans) with A k*m and C m*m symmetric
278  // try upper/lower, no-trans/trans
279  for( int iu = 0; iu < 2; ++iu ) {
280  for( int it = 0; it < 3; ++it ) {
281  magma_zsetmatrix( n, k, A, ld, dA, ld );
282  magma_zsetmatrix( n, n, C, ld, dC1, ld );
283  magma_zsetmatrix( n, n, C, ld, dC2, ld );
284  t1 = magma_sync_wtime( 0 );
285  magma_zherk( uplo[iu], trans[it], n, k, dalpha, dA, ld, dbeta, dC1, ld );
286  t1 = magma_sync_wtime( 0 ) - t1;
287  t2 = magma_sync_wtime( 0 );
288  cublasZherk( uplo[iu], trans[it], n, k, dalpha, dA, ld, dbeta, dC2, ld );
289  t2 = magma_sync_wtime( 0 ) - t2;
290 
291  // check results, storing diff between magma and cuda call in C2
292  cublasZaxpy( ld*n, c_neg_one, dC1, 1, dC2, 1 );
293  magma_zgetmatrix( n, n, dC2, ld, C2, ld );
294  error = lapackf77_zlange( "F", &n, &n, C2, &ld, work );
295  total_error += error;
296  gflops = FLOPS_ZHERK( k, n ) / 1e9;
297  printf( "zherk( %c, %c ) diff %.2g, Gflop/s %6.2f, %6.2f\n",
298  uplo[iu], trans[it], error, gflops/t1, gflops/t2 );
299  }}
300  printf( "\n" );
301 
302  // ----- test ZHER2K
303  // C = alpha*A*B^H + ^alpha*B*A^H + beta*C (no-trans) with A,B n*k; C n*n symmetric; or
304  // C = alpha*A^H*B + ^alpha*B^H*A + beta*C (trans) with A,B k*n; C n*n symmetric
305  // try upper/lower, no-trans/trans
306  for( int iu = 0; iu < 2; ++iu ) {
307  for( int it = 0; it < 3; ++it ) {
308  bool nt = (trans[it] == 'N');
309  magma_zsetmatrix( (nt ? n : k), (nt ? n : k), A, ld, dA, ld );
310  magma_zsetmatrix( n, n, C, ld, dC1, ld );
311  magma_zsetmatrix( n, n, C, ld, dC2, ld );
312  t1 = magma_sync_wtime( 0 );
313  magma_zher2k( uplo[iu], trans[it], n, k, alpha, dA, ld, dB, ld, dbeta, dC1, ld );
314  t1 = magma_sync_wtime( 0 ) - t1;
315  t2 = magma_sync_wtime( 0 );
316  cublasZher2k( uplo[iu], trans[it], n, k, alpha, dA, ld, dB, ld, dbeta, dC2, ld );
317  t2 = magma_sync_wtime( 0 ) - t2;
318 
319  // check results, storing diff between magma and cuda call in C2
320  cublasZaxpy( ld*n, c_neg_one, dC1, 1, dC2, 1 );
321  magma_zgetmatrix( n, n, dC2, ld, C2, ld );
322  error = lapackf77_zlange( "F", &n, &n, C2, &ld, work );
323  total_error += error;
324  gflops = FLOPS_ZHER2K( k, n ) / 1e9;
325  printf( "zher2k( %c, %c ) diff %.2g, Gflop/s %6.2f, %6.2f\n",
326  uplo[iu], trans[it], error, gflops/t1, gflops/t2 );
327  }}
328  printf( "\n" );
329 
330  // ----- test ZTRMM
331  // C = alpha*A*C (left) with A m*m triangular; C m*n; or
332  // C = alpha*C*A (right) with A n*n triangular; C m*n
333  // try left/right, upper/lower, no-trans/trans, unit/non-unit
334  for( int is = 0; is < 2; ++is ) {
335  for( int iu = 0; iu < 2; ++iu ) {
336  for( int it = 0; it < 3; ++it ) {
337  for( int id = 0; id < 2; ++id ) {
338  bool left = (side[is] == 'L');
339  magma_zsetmatrix( (left ? m : n), (left ? m : n), A, ld, dA, ld );
340  magma_zsetmatrix( m, n, C, ld, dC1, ld );
341  magma_zsetmatrix( m, n, C, ld, dC2, ld );
342  t1 = magma_sync_wtime( 0 );
343  magma_ztrmm( side[is], uplo[iu], trans[it], diag[id], m, n, alpha, dA, ld, dC1, ld );
344  t1 = magma_sync_wtime( 0 ) - t1;
345  t2 = magma_sync_wtime( 0 );
346  cublasZtrmm( side[is], uplo[iu], trans[it], diag[id], m, n, alpha, dA, ld, dC2, ld );
347  t2 = magma_sync_wtime( 0 ) - t2;
348 
349  // check results, storing diff between magma and cuda call in C2
350  cublasZaxpy( ld*n, c_neg_one, dC1, 1, dC2, 1 );
351  magma_zgetmatrix( m, n, dC2, ld, C2, ld );
352  error = lapackf77_zlange( "F", &n, &n, C2, &ld, work );
353  total_error += error;
354  gflops = FLOPS_ZTRMM( side[is], m, n ) / 1e9;
355  printf( "ztrmm( %c, %c ) diff %.2g, Gflop/s %6.2f, %6.2f\n",
356  uplo[iu], trans[it], error, gflops/t1, gflops/t2 );
357  }}}}
358  printf( "\n" );
359 
360  // ----- test ZTRSM
361  // solve A*X = alpha*B (left) with A m*m triangular; B m*n; or
362  // solve X*A = alpha*B (right) with A n*n triangular; B m*n
363  // try left/right, upper/lower, no-trans/trans, unit/non-unit
364  for( int is = 0; is < 2; ++is ) {
365  for( int iu = 0; iu < 2; ++iu ) {
366  for( int it = 0; it < 3; ++it ) {
367  for( int id = 0; id < 2; ++id ) {
368  bool left = (side[is] == 'L');
369  magma_zsetmatrix( (left ? m : n), (left ? m : n), LU, ld, dA, ld );
370  magma_zsetmatrix( m, n, C, ld, dC1, ld );
371  magma_zsetmatrix( m, n, C, ld, dC2, ld );
372  t1 = magma_sync_wtime( 0 );
373  magma_ztrsm( side[is], uplo[iu], trans[it], diag[id], m, n, alpha, dA, ld, dC1, ld );
374  t1 = magma_sync_wtime( 0 ) - t1;
375  t2 = magma_sync_wtime( 0 );
376  cublasZtrsm( side[is], uplo[iu], trans[it], diag[id], m, n, alpha, dA, ld, dC2, ld );
377  t2 = magma_sync_wtime( 0 ) - t2;
378 
379  // check results, storing diff between magma and cuda call in C2
380  cublasZaxpy( ld*n, c_neg_one, dC1, 1, dC2, 1 );
381  magma_zgetmatrix( m, n, dC2, ld, C2, ld );
382  error = lapackf77_zlange( "F", &n, &n, C2, &ld, work );
383  total_error += error;
384  gflops = FLOPS_ZTRSM( side[is], m, n ) / 1e9;
385  printf( "ztrsm( %c, %c ) diff %.2g, Gflop/s %6.2f, %6.2f\n",
386  uplo[iu], trans[it], error, gflops/t1, gflops/t2 );
387  }}}}
388  printf( "\n" );
389 
390  // cleanup
391  magma_free_cpu( piv );
392  magma_free_pinned( A );
393  magma_free_pinned( B );
394  magma_free_pinned( C );
395  magma_free_pinned( C2 );
396  magma_free_pinned( LU );
397  magma_free( dA );
398  magma_free( dB );
399  magma_free( dC1 );
400  magma_free( dC2 );
401  }
402 
403  if ( total_error != 0. ) {
404  printf( "total error %.2g -- ought to be 0 -- some test failed (see above).\n",
405  total_error );
406  }
407  else {
408  printf( "all tests passed\n" );
409  }
410 
412  return 0;
413 }
void parse_opts(int argc, char **argv, magma_opts *opts)
void magma_ztrmm(magma_side_t side, magma_uplo_t uplo, magma_trans_t trans, magma_diag_t diag, magma_int_t m, magma_int_t n, magmaDoubleComplex alpha, magmaDoubleComplex_const_ptr dA, magma_int_t ldda, magmaDoubleComplex_ptr dB, magma_int_t lddb)
magma_int_t ntest
Definition: testings.h:124
#define MAGMA_Z_MAKE(r, i)
Definition: magma.h:123
#define lapackf77_zgetrf
Definition: magma_zlapack.h:64
#define FLOPS_ZTRSM(__side, __m, __n)
Definition: flops.h:215
#define MagmaLeft
Definition: magma.h:68
#define MAGMA_Z_NEG_ONE
Definition: magma.h:134
static magma_err_t magma_zmalloc(magmaDoubleComplex_ptr *ptrPtr, size_t n)
Definition: magma.h:80
#define B(i, j)
Definition: chegst.cpp:17
#define FLOPS_ZGEMM(__m, __n, __k)
Definition: flops.h:181
#define FLOPS_ZHEMM(__side, __m, __n)
Definition: flops.h:186
#define magma_free(ptr)
Definition: magma.h:57
#define magma_free_pinned(ptr)
Definition: magma.h:60
#define TESTING_INIT()
Definition: testings.h:19
#define A(i, j)
#define magma_zgetmatrix(m, n, dA_src, ldda, hB_dst, ldb)
Definition: magmablas_z.h:705
int magma_int_t
Definition: magmablas.h:12
#define C(i, j)
#define magma_zgetvector(n, dx_src, incx, hy_dst, incy)
Definition: magmablas_z.h:637
magma_err_t magma_malloc_cpu(void **ptrPtr, size_t bytes)
#define lapackf77_zlacpy
Definition: magma_zlapack.h:73
void magma_zher2k(magma_uplo_t uplo, magma_trans_t trans, magma_int_t n, magma_int_t k, magmaDoubleComplex alpha, magmaDoubleComplex_const_ptr dA, magma_int_t ldda, magmaDoubleComplex_const_ptr dB, magma_int_t lddb, double beta, magmaDoubleComplex_ptr dC, magma_int_t lddc)
#define magma_zsetvector(n, hx_src, incx, dy_dst, incy)
Definition: magmablas_z.h:634
void magma_zgemm(magma_trans_t transA, magma_trans_t transB, magma_int_t m, magma_int_t n, magma_int_t k, magmaDoubleComplex alpha, magmaDoubleComplex_const_ptr dA, magma_int_t ldda, magmaDoubleComplex_const_ptr dB, magma_int_t lddb, magmaDoubleComplex beta, magmaDoubleComplex_ptr dC, magma_int_t lddc)
#define FLOPS_ZGEMV(__m, __n)
Definition: flops.h:165
void magma_ztrsm(magma_side_t side, magma_uplo_t uplo, magma_trans_t trans, magma_diag_t diag, magma_int_t m, magma_int_t n, magmaDoubleComplex alpha, magmaDoubleComplex_const_ptr dA, magma_int_t ldda, magmaDoubleComplex_ptr dB, magma_int_t lddb)
void magma_ztrsv(magma_uplo_t uplo, magma_trans_t trans, magma_diag_t diag, magma_int_t n, magmaDoubleComplex_const_ptr dA, magma_int_t ldda, magmaDoubleComplex_ptr dx, magma_int_t incx)
void magma_zswap(magma_int_t n, magmaDoubleComplex_ptr dx, magma_int_t incx, magmaDoubleComplex_ptr dy, magma_int_t incy)
#define FLOPS_ZHERK(__k, __n)
Definition: flops.h:194
#define C2(i, j)
magma_int_t magma_izamax(magma_int_t n, magmaDoubleComplex_const_ptr dx, magma_int_t incx)
void magma_zhemm(magma_side_t side, magma_uplo_t uplo, magma_int_t m, magma_int_t n, magmaDoubleComplex alpha, magmaDoubleComplex_const_ptr dA, magma_int_t ldda, magmaDoubleComplex_const_ptr dB, magma_int_t lddb, magmaDoubleComplex beta, magmaDoubleComplex_ptr dC, magma_int_t lddc)
void magma_zhemv(magma_uplo_t uplo, magma_int_t n, magmaDoubleComplex alpha, magmaDoubleComplex_const_ptr dA, magma_int_t ldda, magmaDoubleComplex_const_ptr dx, magma_int_t incx, magmaDoubleComplex beta, magmaDoubleComplex_ptr dy, magma_int_t incy)
static magma_err_t magma_zmalloc_pinned(magmaDoubleComplex **ptrPtr, size_t n)
Definition: magma.h:92
double magma_sync_wtime(magma_queue_t queue)
Definition: timer.cpp:119
#define dB(i, j)
void magma_zgemv(magma_trans_t transA, magma_int_t m, magma_int_t n, magmaDoubleComplex alpha, magmaDoubleComplex_const_ptr dA, magma_int_t ldda, magmaDoubleComplex_const_ptr dx, magma_int_t incx, magmaDoubleComplex beta, magmaDoubleComplex_ptr dy, magma_int_t incy)
magma_int_t nsize[MAX_NTEST]
Definition: testings.h:126
int magma_err_t
Definition: magma_types.h:23
#define lapackf77_zlange
Definition: magma_zlapack.h:75
#define TESTING_FINALIZE()
Definition: testings.h:29
void magma_zherk(magma_uplo_t uplo, magma_trans_t trans, magma_int_t n, magma_int_t k, double alpha, magmaDoubleComplex_const_ptr dA, magma_int_t ldda, double beta, magmaDoubleComplex_ptr dC, magma_int_t lddc)
#define FLOPS_ZHER2K(__k, __n)
Definition: flops.h:202
magma_int_t ksize[MAX_NTEST]
Definition: testings.h:127
double real_Double_t
Definition: magma_types.h:27
#define LU(i, j)
int main()
Definition: sizeptr.c:3
#define magma_zsetmatrix(m, n, hA_src, lda, dB_dst, lddb)
Definition: magmablas_z.h:702
#define max(a, b)
Definition: common_magma.h:82
#define FLOPS_ZHEMV(__n)
Definition: flops.h:170
magma_err_t magma_free_cpu(void *ptr)
#define dA(i, j)
#define lapackf77_zlarnv
Definition: magma_zlapack.h:81
magma_int_t msize[MAX_NTEST]
Definition: testings.h:125
#define FLOPS_ZTRMM(__side, __m, __n)
Definition: flops.h:210