01: /* ///////////////////////////// P /// L /// A /// S /// M /// A /////////////////////////////// */
02: /* ///                    PLASMA auxiliary routines (version 2.1.0)                          ///
03:  * ///                    Author: Bilel Hadri                                                ///
04:  * ///                    Release Date: November, 15th 2009                                  ///
05:  * ///                    PLASMA is a software package provided by Univ. of Tennessee,       ///
06:  * ///                    Univ. of California Berkeley and Univ. of Colorado Denver          /// */
07: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
08: #include "common.h"
09: 
10: #include <stdlib.h>
11: 
12: #ifdef ADD_
13:     #define PLASMA_INIT             plasma_init_
14:     #define PLASMA_FINALIZE         plasma_finalize_
15:     #define PLASMA_ENABLE           plasma_enable_
16:     #define PLASMA_DISABLE          plasma_disable_
17:     #define PLASMA_SET              plasma_set_
18:     #define PLASMA_GET              plasma_get_
19:     #define PLASMA_DEALLOC_HANDLE   plasma_dealloc_handle_
20:     #define PLASMA_VERSION          plasma_version_
21:     #define PLASMA_DESC_CREATE      plasma_desc_create_
22:     #define PLASMA_DESC_DESTROY     plasma_desc_destroy_
23:     #define PLASMA_LAPACK_TO_TILE   plasma_lapack_to_tile_
24:     #define PLASMA_TILE_TO_LAPACK   plasma_tile_to_lapack_
25: #elif defined (NOCHANGE)
26:     #define PLASMA_INIT             plasma_init
27:     #define PLASMA_FINALIZE         plasma_finalize
28:     #define PLASMA_ENABLE           plasma_enable
29:     #define PLASMA_DISABLE          plasma_disable
30:     #define PLASMA_SET              plasma_set
31:     #define PLASMA_GET              plasma_get
32:     #define PLASMA_DEALLOC_HANDLE   plasma_dealloc_handle
33:     #define PLASMA_VERSION          plasma_version
34:     #define PLASMA_DESC_CREATE      plasma_desc_create
35:     #define PLASMA_DESC_DESTROY     plasma_desc_destroy
36: /*  #define PLASMA_LAPACK_TO_TILE   plasma_lapack_to_tile */
37: /*  #define PLASMA_TILE_TO_LAPACK   plasma_tile_to_lapack */
38: #endif
39: 
40: #ifdef __cplusplus
41: extern "C" {
42: #endif
43: 
44: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
45: //  FORTRAN API - auxiliary function prototypes
46: void PLASMA_INIT(int *CORES, int *INFO)
47: {   *INFO = PLASMA_Init(*CORES); }
48: 
49: void PLASMA_FINALIZE(int *INFO)
50: {   *INFO = PLASMA_Finalize(); }
51: 
52: void PLASMA_ENABLE(PLASMA_enum *lever, int *INFO)
53: {   *INFO = PLASMA_Enable(*lever); }
54: 
55: void PLASMA_DISABLE(PLASMA_enum *lever, int *INFO)
56: {   *INFO = PLASMA_Disable(*lever); }
57: 
58: void PLASMA_SET(PLASMA_enum *param, int *value, int *INFO)
59: {   *INFO = PLASMA_Set(*param, *value); }
60: 
61: void PLASMA_GET(PLASMA_enum *param, int *value, int *INFO)
62: {   *INFO = PLASMA_Get(*param, value); }
63: 
64: void PLASMA_DEALLOC_HANDLE(size_t *sp, int *INFO)
65: {   free((void *)(*sp));
66:     *INFO = PLASMA_SUCCESS; }
67: 
68: void PLASMA_VERSION(int *VER_MAJOR, int *VER_MINOR, int *VER_MICRO, int *INFO)
69: {
70:     *VER_MAJOR = PLASMA_VERSION_MAJOR;
71:     *VER_MINOR = PLASMA_VERSION_MINOR;
72:     *VER_MICRO = PLASMA_VERSION_MICRO;
73:     *INFO = PLASMA_SUCCESS;
74: }
75: 
76: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
77: //  FORTRAN API - descriptor allocation and deallocation
78: void PLASMA_DESC_CREATE(PLASMA_desc **desc, void *mat, PLASMA_enum *dtyp, int *mb, int *nb, int *bsiz, int *lm, int *ln, int *i, int *j, int *m, int *n, int *INFO)
79: {   *INFO = PLASMA_Desc_Create(desc, mat, *dtyp, *mb, *nb, *bsiz, *lm, *ln, *i, *j, *m, *n); }
80: 
81: void PLASMA_DESC_DESTROY(PLASMA_desc **desc, int *INFO)
82: {   *INFO = PLASMA_Desc_Destroy(desc); }
83: 
84: //* ///////////////////////////////////////////////////////////////////////////////////////////// */
85: //  FORTRAN API - Conversion from LAPACK F77 matrix layout to tile layout
86: void PLASMA_LAPACK_TO_TILE(long long int *Af77, int *LDA, long long int *A, int *INFO)
87: {   *INFO = PLASMA_Lapack_to_Tile( (void *)(*Af77), *LDA, (PLASMA_desc *)(*A)); }
88: 
89: void PLASMA_TILE_TO_LAPACK(long long int *A, long long int *Af77, int *LDA, int *INFO)
90: {   *INFO = PLASMA_Tile_to_Lapack((PLASMA_desc *)(*A), (void *)(*Af77), *LDA); }
91: 
92: #ifdef __cplusplus
93: }
94: #endif
95: