libflame  revision_anchor
Functions
FLA_Trsv_external_gpu.c File Reference

(r)

Functions

FLA_Error FLA_Trsv_external_gpu (FLA_Uplo uplo, FLA_Trans trans, FLA_Diag diag, FLA_Obj A, void *A_gpu, FLA_Obj x, void *x_gpu)
 

Function Documentation

◆ FLA_Trsv_external_gpu()

FLA_Error FLA_Trsv_external_gpu ( FLA_Uplo  uplo,
FLA_Trans  trans,
FLA_Diag  diag,
FLA_Obj  A,
void *  A_gpu,
FLA_Obj  x,
void *  x_gpu 
)
18 {
19  FLA_Datatype datatype;
20  int m_A;
21  int ldim_A;
22  int inc_x;
23  char blas_uplo;
24  char blas_trans;
25  char blas_diag;
26 
27  if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
28  FLA_Trsv_check( uplo, trans, diag, A, x );
29 
30  if ( FLA_Obj_has_zero_dim( A ) ) return FLA_SUCCESS;
31 
32  datatype = FLA_Obj_datatype( A );
33 
34  m_A = FLA_Obj_length( A );
35  ldim_A = FLA_Obj_length( A );
36 
37  inc_x = 1;
38 
39  FLA_Param_map_flame_to_netlib_uplo( uplo, &blas_uplo );
40  FLA_Param_map_flame_to_netlib_trans( trans, &blas_trans );
41  FLA_Param_map_flame_to_netlib_diag( diag, &blas_diag );
42 
43 
44  switch( datatype ){
45 
46  case FLA_FLOAT:
47  {
48  strsv_( blas_uplo,
49  blas_trans,
50  blas_diag,
51  m_A,
52  ( float * ) A_gpu, ldim_A,
53  ( float * ) x_gpu, inc_x );
54 
55  break;
56  }
57 
58  case FLA_DOUBLE:
59  {
60  cublasDtrsv( blas_uplo,
61  blas_trans,
62  blas_diag,
63  m_A,
64  ( double * ) A_gpu, ldim_A,
65  ( double * ) x_gpu, inc_x );
66 
67  break;
68  }
69 
70  case FLA_COMPLEX:
71  {
72  cublasCtrsv( blas_uplo,
73  blas_trans,
74  blas_diag,
75  m_A,
76  ( cuComplex * ) A_gpu, ldim_A,
77  ( cuComplex * ) x_gpu, inc_x );
78 
79  break;
80  }
81 
82  case FLA_DOUBLE_COMPLEX:
83  {
84  cublasZtrsv( blas_uplo,
85  blas_trans,
86  blas_diag,
87  m_A,
88  ( cuDoubleComplex * ) A_gpu, ldim_A,
89  ( cuDoubleComplex * ) x_gpu, inc_x );
90 
91  break;
92  }
93 
94  }
95 
96  return FLA_SUCCESS;
97 }
FLA_Error FLA_Trsv_check(FLA_Uplo uplo, FLA_Trans transa, FLA_Diag diag, FLA_Obj A, FLA_Obj x)
Definition: FLA_Trsv_check.c:13
void FLA_Param_map_flame_to_netlib_diag(FLA_Diag diag, void *blas_diag)
Definition: FLA_Param.c:95
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
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
void FLA_Param_map_flame_to_netlib_trans(FLA_Trans trans, void *blas_trans)
Definition: FLA_Param.c:15
void FLA_Param_map_flame_to_netlib_uplo(FLA_Uplo uplo, void *blas_uplo)
Definition: FLA_Param.c:47
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
int FLA_Datatype
Definition: FLA_type_defs.h:49

References FLA_Check_error_level(), FLA_Obj_datatype(), FLA_Obj_has_zero_dim(), FLA_Obj_length(), FLA_Param_map_flame_to_netlib_diag(), FLA_Param_map_flame_to_netlib_trans(), FLA_Param_map_flame_to_netlib_uplo(), and FLA_Trsv_check().

Referenced by FLASH_Queue_exec_task_gpu().