1 /*
2 
3     Copyright (C) 2014, The University of Texas at Austin
4 
5     This file is part of libflame and is available under the 3-Clause
6     BSD license, which can be found in the LICENSE file at the top-level
7     directory, or at http://opensource.org/licenses/BSD-3-Clause
8 
9 */
10 
11 #include "FLAME.h"
12 
13 #ifndef FLA_LAPACK2FLAME_RETURN_DEFS_H
14 #define FLA_LAPACK2FLAME_RETURN_DEFS_H
15 
16 // --- LAPACK return values ----
17 
18 #define LAPACK_SUCCESS 512
19 #define LAPACK_FAILURE 312
20 #define LAPACK_QUICK_RETURN 212
21 #define LAPACK_QUERY_RETURN 112
22 
23 #define LAPACK_RETURN_CHECK( r_check )                                  \
24   {                                                                     \
25   int r_val = r_check;                                                  \
26   switch ( r_val )                                                      \
27     {                                                                   \
28     case LAPACK_FAILURE:      return FLA_FAILURE;                       \
29     case LAPACK_QUERY_RETURN: ;                                         \
30     case LAPACK_QUICK_RETURN: return 0;                                 \
31     case LAPACK_SUCCESS: ;                                              \
32     default: ;                                                          \
33       if ( r_val > 0 ) { ; }                                            \
34       else             { FLA_Check_error_code( FLA_LAPAC2FLAME_INVALID_RETURN ); } \
35     }                                                                   \
36   }
37 
38 extern int lsame_(char *, char *);
39 extern int xerbla_(char *, int *);
40 extern int ilaenv_(int *, char *, char *, int *, int *, int *, int *);
41 
42 
43 #endif
44