libflame revision_anchor
Functions
FLA_Tridiag_apply_Q_external.c File Reference

(r)

Functions

FLA_Error FLA_Tridiag_apply_Q_external (FLA_Side side, FLA_Uplo uplo, FLA_Trans trans, FLA_Obj A, FLA_Obj t, FLA_Obj B)
 

Function Documentation

◆ FLA_Tridiag_apply_Q_external()

FLA_Error FLA_Tridiag_apply_Q_external ( FLA_Side  side,
FLA_Uplo  uplo,
FLA_Trans  trans,
FLA_Obj  A,
FLA_Obj  t,
FLA_Obj  B 
)
14{
15 int info = 0;
16#ifdef FLA_ENABLE_EXTERNAL_LAPACK_INTERFACES
17 FLA_Datatype datatype;
18 // int m_A, n_A;
19 int m_B, n_B;
20 int cs_A;
21 int cs_B;
22 int k_t;
23 int lwork;
24 char blas_side;
25 char blas_uplo;
26 char blas_trans;
28 int i;
29
30 //if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
31 // FLA_Apply_Q_check( side, trans, storev, A, t, B );
32
33 if ( FLA_Obj_has_zero_dim( A ) ) return FLA_SUCCESS;
34
35 datatype = FLA_Obj_datatype( A );
36
37 // m_A = FLA_Obj_length( A );
38 // n_A = FLA_Obj_width( A );
40
41 m_B = FLA_Obj_length( B );
42 n_B = FLA_Obj_width( B );
44
46
50
51
52 // Make a workspace query the first time through. This will provide us with
53 // and ideal workspace size based on an internal block size.
54 lwork = -1;
55 FLA_Obj_create( datatype, 1, 1, 0, 0, &work );
56
57 for ( i = 0; i < 2; ++i )
58 {
59 if ( i == 1 )
60 {
61 // Grab the queried ideal workspace size from the work array, free the
62 // work object, and then re-allocate the workspace with the ideal size.
63 if ( datatype == FLA_FLOAT || datatype == FLA_COMPLEX )
64 lwork = ( int ) *FLA_FLOAT_PTR( work );
65 else if ( datatype == FLA_DOUBLE || datatype == FLA_DOUBLE_COMPLEX )
66 lwork = ( int ) *FLA_DOUBLE_PTR( work );
67
69 FLA_Obj_create( datatype, lwork, 1, 0, 0, &work );
70 }
71
72 switch( datatype ){
73
74 case FLA_FLOAT:
75 {
76 float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
77 float *buff_t = ( float * ) FLA_FLOAT_PTR( t );
78 float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
79 float *buff_work = ( float * ) FLA_FLOAT_PTR( work );
80
82 &blas_uplo,
84 &m_B,
85 &n_B,
86 buff_A, &cs_A,
87 buff_t,
88 buff_B, &cs_B,
90 &info );
91
92 break;
93 }
94
95 case FLA_DOUBLE:
96 {
97 double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
98 double *buff_t = ( double * ) FLA_DOUBLE_PTR( t );
99 double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
100 double *buff_work = ( double * ) FLA_DOUBLE_PTR( work );
101
103 &blas_uplo,
104 &blas_trans,
105 &m_B,
106 &n_B,
107 buff_A, &cs_A,
108 buff_t,
109 buff_B, &cs_B,
111 &info );
112
113 break;
114 }
115
116 case FLA_COMPLEX:
117 {
122
124 &blas_uplo,
125 &blas_trans,
126 &m_B,
127 &n_B,
128 buff_A, &cs_A,
129 buff_t,
130 buff_B, &cs_B,
132 &info );
133
134 break;
135 }
136
138 {
143
145 &blas_uplo,
146 &blas_trans,
147 &m_B,
148 &n_B,
149 buff_A, &cs_A,
150 buff_t,
151 buff_B, &cs_B,
153 &info );
154
155 break;
156 }
157
158 }
159 }
160
161 FLA_Obj_free( &work );
162#else
164#endif
165
166 return info;
167}
int F77_cunmtr(char *side, char *uplo, char *trans, int *m, int *n, scomplex *a, int *lda, scomplex *tau, scomplex *c, int *ldc, scomplex *work, int *lwork, int *info)
int F77_dormtr(char *side, char *uplo, char *trans, int *m, int *n, double *a, int *lda, double *tau, double *c, int *ldc, double *work, int *lwork, int *info)
int F77_zunmtr(char *side, char *uplo, char *trans, int *m, int *n, dcomplex *a, int *lda, dcomplex *tau, dcomplex *c, int *ldc, dcomplex *work, int *lwork, int *info)
int F77_sormtr(char *side, char *uplo, char *trans, int *m, int *n, float *a, int *lda, float *tau, float *c, int *ldc, float *work, int *lwork, int *info)
dim_t FLA_Obj_width(FLA_Obj obj)
Definition FLA_Query.c:123
FLA_Error FLA_Obj_create(FLA_Datatype datatype, dim_t m, dim_t n, dim_t rs, dim_t cs, FLA_Obj *obj)
Definition FLA_Obj.c:55
FLA_Bool FLA_Obj_has_zero_dim(FLA_Obj A)
Definition FLA_Query.c:400
dim_t FLA_Obj_length(FLA_Obj obj)
Definition FLA_Query.c:116
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition FLA_Query.c:174
void FLA_Param_map_flame_to_netlib_trans(FLA_Trans trans, void *blas_trans)
Definition FLA_Param.c:15
FLA_Error FLA_Obj_free(FLA_Obj *obj)
Definition FLA_Obj.c:588
void FLA_Param_map_flame_to_netlib_side(FLA_Uplo side, void *blas_side)
Definition FLA_Param.c:71
void FLA_Param_map_flame_to_netlib_uplo(FLA_Uplo uplo, void *blas_uplo)
Definition FLA_Param.c:47
dim_t FLA_Obj_vector_dim(FLA_Obj obj)
Definition FLA_Query.c:137
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition FLA_Query.c:13
int FLA_Datatype
Definition FLA_type_defs.h:49
int i
Definition bl1_axmyv2.c:145
Definition FLA_type_defs.h:159
Definition blis_type_defs.h:138
Definition blis_type_defs.h:133

References F77_cunmtr(), F77_dormtr(), F77_sormtr(), F77_zunmtr(), FLA_Obj_col_stride(), FLA_Obj_create(), FLA_Obj_datatype(), FLA_Obj_free(), FLA_Obj_has_zero_dim(), FLA_Obj_length(), FLA_Obj_vector_dim(), FLA_Obj_width(), FLA_Param_map_flame_to_netlib_side(), FLA_Param_map_flame_to_netlib_trans(), FLA_Param_map_flame_to_netlib_uplo(), and i.