25 cudaPointerAttributes attr;
27 err = cudaGetDevice( &dev );
29 err = cudaGetDeviceProperties( &prop, dev );
30 if ( ! err and prop.unifiedAddressing ) {
31 err = cudaPointerGetAttributes( &attr, A );
34 return (attr.memoryType == cudaMemoryTypeDevice);
36 else if ( err == cudaErrorInvalidValue ) {
47 #define A(i,j) (A + i + j*lda)
55 fprintf( stderr,
"ERROR: cprint called with device pointer.\n" );
62 for(
int i = 0; i < m; ++i ) {
63 for(
int j = 0; j < n; ++j ) {
84 fprintf( stderr,
"ERROR: cprint_gpu called with host pointer.\n" );
89 cuFloatComplex*
A = (cuFloatComplex*) malloc( lda*n*
sizeof(cuFloatComplex) );
90 cublasGetMatrix( m, n,
sizeof(cuFloatComplex), dA, ldda, A, lda );