FLA_Copyt_external.c File Reference

(r)


Functions

FLA_Error FLA_Copyt_external (FLA_Trans trans, FLA_Obj A, FLA_Obj B)
void FLA_F2C() fla_copyt_external_f (F_INT *trans, F_INT *A, F_INT *B, F_INT *IERROR)

Function Documentation

FLA_Error FLA_Copyt_external ( FLA_Trans  trans,
FLA_Obj  A,
FLA_Obj  B 
)

References cblas_ccopy(), cblas_dcopy(), cblas_scopy(), cblas_zcopy(), ccopy(), dcopy(), FLA_Check_error_level(), FLA_Conjugate(), FLA_Copyt_check(), FLA_Obj_datatype(), FLA_Obj_has_zero_dim(), FLA_Obj_is_vector(), FLA_Obj_ldim(), FLA_Obj_length(), FLA_Obj_vector_dim(), FLA_Obj_width(), scopy(), and zcopy().

Referenced by FLA_Accum_T_UT_fc_unb_var1(), FLA_Axpys_external(), FLA_Axpyt_external(), FLA_Copy_global_to_submatrix(), FLA_Copy_submatrix_to_global(), FLA_Copyt(), fla_copyt_external_f(), FLA_Gemm_external(), FLA_Gemv_external(), FLA_Gemvc_external(), FLA_Gerc_external(), FLA_Hemvc_external(), FLA_Her2c_external(), FLA_Herc_external(), FLA_LQ_UT_Accum_T_blk_var1(), FLA_QR_UT_Accum_T_blk_var1(), FLA_QR_UT_Accum_T_unb_var1(), FLA_Trmm_external(), FLA_Trmv_external(), FLA_Trsm_external(), and FLA_Trsv_external().

00036 {
00037   FLA_Datatype datatype;
00038   int          j, n_iter;
00039   int          num_elem;
00040   int          m_A, n_A, inc_A, ldim_A;
00041   int          m_B,      inc_B, ldim_B;
00042   int          ldim_B_trans, inc_B_trans;
00043 
00044   if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING ) 
00045     FLA_Copyt_check( trans, A, B );
00046 
00047   if ( FLA_Obj_has_zero_dim( A ) ) return FLA_SUCCESS;
00048 
00049   datatype = FLA_Obj_datatype( A );
00050 
00051   m_A      = FLA_Obj_length( A );
00052   n_A      = FLA_Obj_width( A );
00053   ldim_A   = FLA_Obj_ldim( A );
00054 
00055   m_B      = FLA_Obj_length( B );
00056   ldim_B   = FLA_Obj_ldim( B );
00057 
00058   if ( FLA_Obj_is_vector( A ) )
00059   {
00060     inc_A    = ( m_A == 1 ? ldim_A : 1 );
00061     inc_B    = ( m_B == 1 ? ldim_B : 1 );
00062     n_iter   = 1;
00063     num_elem = FLA_Obj_vector_dim( A );
00064 
00065     ldim_B_trans = ldim_B;
00066     inc_B_trans  = inc_B;
00067   }
00068   else
00069   {
00070     inc_A    = 1;
00071     inc_B    = 1;
00072     n_iter   = n_A;
00073     num_elem = m_A;
00074 
00075     if ( trans == FLA_NO_TRANSPOSE || trans == FLA_CONJ_NO_TRANSPOSE )
00076     {
00077       ldim_B_trans = ldim_B;
00078       inc_B_trans  = inc_B;
00079     }
00080     else // ( trans == FLA_TRANSPOSE || trans == FLA_CONJ_TRANSPOSE )
00081     {
00082       ldim_B_trans = inc_B;
00083       inc_B_trans  = ldim_B;
00084     }
00085   }
00086 
00087 
00088   switch ( datatype ){
00089 
00090   case FLA_INT:
00091   case FLA_FLOAT:
00092   {
00093     float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
00094     float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
00095 
00096     for ( j = 0; j < n_iter; j++ )
00097     {
00098 #ifdef FLA_ENABLE_CBLAS_INTERFACE
00099       cblas_scopy( num_elem,
00100                    buff_A + j*ldim_A,       inc_A, 
00101                    buff_B + j*ldim_B_trans, inc_B_trans );
00102 #else
00103       FLA_C2F( scopy )( &num_elem,
00104                         buff_A + j*ldim_A,       &inc_A, 
00105                         buff_B + j*ldim_B_trans, &inc_B_trans );
00106 #endif
00107     }
00108 
00109     break;
00110   }
00111 
00112   case FLA_DOUBLE:
00113   {
00114     double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
00115     double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
00116 
00117     for ( j = 0; j < n_iter; j++ )
00118     {
00119 #ifdef FLA_ENABLE_CBLAS_INTERFACE
00120       cblas_dcopy( num_elem,
00121                    buff_A + j*ldim_A,       inc_A, 
00122                    buff_B + j*ldim_B_trans, inc_B_trans );
00123 #else
00124       FLA_C2F( dcopy )( &num_elem,
00125                         buff_A + j*ldim_A,       &inc_A, 
00126                         buff_B + j*ldim_B_trans, &inc_B_trans );
00127 #endif
00128     }
00129 
00130     break;
00131   }
00132 
00133   case FLA_COMPLEX:
00134   {
00135     scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
00136     scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
00137 
00138     for ( j = 0; j < n_iter; j++ )
00139     {
00140 #ifdef FLA_ENABLE_CBLAS_INTERFACE
00141       cblas_ccopy( num_elem,
00142                    buff_A + j*ldim_A,       inc_A, 
00143                    buff_B + j*ldim_B_trans, inc_B_trans );
00144 #else
00145       FLA_C2F( ccopy )( &num_elem,
00146                         buff_A + j*ldim_A,       &inc_A, 
00147                         buff_B + j*ldim_B_trans, &inc_B_trans );
00148 #endif
00149     }
00150 
00151     break;
00152   }
00153 
00154   case FLA_DOUBLE_COMPLEX:
00155   {
00156     dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
00157     dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
00158 
00159     for ( j = 0; j < n_iter; j++ )
00160     {
00161 #ifdef FLA_ENABLE_CBLAS_INTERFACE
00162       cblas_zcopy( num_elem,
00163                    buff_A + j*ldim_A,       inc_A, 
00164                    buff_B + j*ldim_B_trans, inc_B_trans );
00165 #else
00166       FLA_C2F( zcopy )( &num_elem,
00167                         buff_A + j*ldim_A,       &inc_A, 
00168                         buff_B + j*ldim_B_trans, &inc_B_trans );
00169 #endif
00170     }
00171 
00172     break;
00173   }
00174 
00175   }
00176   
00177   if ( trans == FLA_CONJ_NO_TRANSPOSE || trans == FLA_CONJ_TRANSPOSE )
00178     FLA_Conjugate( B );
00179   
00180   return FLA_SUCCESS;
00181 }

void FLA_F2C() fla_copyt_external_f ( F_INT *  trans,
F_INT *  A,
F_INT *  B,
F_INT *  IERROR 
)

References FLA_Copyt_external().

00185 {
00186   *IERROR = FLA_Copyt_external( *( ( FLA_Trans * ) trans ),
00187                                 *( ( FLA_Obj   * ) A     ),
00188                                 *( ( FLA_Obj   * ) B     ) );
00189 }


Generated on Mon Jul 6 05:45:53 2009 for libflame by  doxygen 1.5.9