01: /* ///////////////////////////// P /// L /// A /// S /// M /// A /////////////////////////////// */
02: /* ///                    PLASMA computational routine (version 2.0.0)                       ///
03:  * ///                    Release Date: July, 4th 2009                                       ///
04:  * ///                    PLASMA is a software package provided by Univ. of Tennessee,       ///
05:  * ///                    Univ. of California Berkeley and Univ. of Colorado Denver          /// */
06: 
07: /* /////////////////////////// P /// U /// R /// P /// O /// S /// E /////////////////////////// */
08: // PLASMA_sgetrs_Tile - Solves a system of linear equations A * X = B, with a general N-by-N
09: // matrix A using the tile LU factorization computed by PLASMA_sgetrf.
10: // All matrices are passed through descriptors. All dimensions are taken from the descriptors.
11: 
12: /* ///////////////////// A /// R /// G /// U /// M /// E /// N /// T /// S ///////////////////// */
13: // A        float* (IN)
14: //          The tile factors L and U from the factorization, computed by PLASMA_sgetrf.
15: //
16: // L        float* (IN)
17: //          Auxiliary factorization data, related to the tile L factor, computed by PLASMA_sgetrf.
18: //
19: // IPIV     int* (IN)
20: //          The pivot indices from PLASMA_sgetrf (not equivalent to LAPACK).
21: //
22: // B        float* (INOUT)
23: //          On entry, the N-by-NRHS matrix of right hand side matrix B.
24: //          On exit, the solution matrix X.
25: 
26: /* ///////////// R /// E /// T /// U /// R /// N /////// V /// A /// L /// U /// E ///////////// */
27: //          = 0: successful exit
28: 
29: /* //////////////////////////////////// C /// O /// D /// E //////////////////////////////////// */
30: #include "common.h"
31: 
32: int PLASMA_sgetrs_Tile(PLASMA_desc *A, PLASMA_desc *L, int *IPIV, PLASMA_desc *B)
33: {
34:     PLASMA_desc descA = *A;
35:     PLASMA_desc descL = *L;
36:     PLASMA_desc descB = *B;
37:     plasma_context_t *plasma;
38: 
39:     plasma = plasma_context_self();
40:     if (plasma == NULL) {
41:         plasma_fatal_error("PLASMA_sgetrs_Tile", "PLASMA not initialized");
42:         return PLASMA_ERR_NOT_INITIALIZED;
43:     }
44:     /* Check descriptors for correctness */
45:     if (plasma_desc_check(&descA) != PLASMA_SUCCESS) {
46:         plasma_error("PLASMA_sgetrs_Tile", "invalid first descriptor");
47:         return PLASMA_ERR_ILLEGAL_VALUE;
48:     }
49:     if (plasma_desc_check(&descL) != PLASMA_SUCCESS) {
50:         plasma_error("PLASMA_sgetrs_Tile", "invalid second descriptor");
51:         return PLASMA_ERR_ILLEGAL_VALUE;
52:     }
53:     if (plasma_desc_check(&descB) != PLASMA_SUCCESS) {
54:         plasma_error("PLASMA_sgetrs_Tile", "invalid third descriptor");
55:         return PLASMA_ERR_ILLEGAL_VALUE;
56:     }
57:     /* Check input arguments */
58:     /* Quick return */
59: /*
60:     if (min(N, NRHS) == 0)
61:         return PLASMA_SUCCESS;
62: */
63:     plasma_parallel_call_4(plasma_pstrsmpl,
64:         PLASMA_desc, descA,
65:         PLASMA_desc, descB,
66:         PLASMA_desc, descL,
67:         int*, IPIV);
68: 
69:     plasma_parallel_call_7(plasma_pstrsm,
70:         PLASMA_enum, PlasmaLeft,
71:         PLASMA_enum, PlasmaUpper,
72:         PLASMA_enum, PlasmaNoTrans,
73:         PLASMA_enum, PlasmaNonUnit,
74:         float, 1.0,
75:         PLASMA_desc, descA,
76:         PLASMA_desc, descB);
77: 
78:     return PLASMA_SUCCESS;
79: }