1 #ifndef RELAPACK_INT_H
2 #define RELAPACK_INT_H
3 #include <string.h>
4 #include "../../config.h"
5 #if defined(OS_WINDOWS) && defined(__64BIT__)
6 typedef long long BLASLONG;
7 typedef unsigned long long BLASULONG;
8 #else
9 typedef long BLASLONG;
10 typedef unsigned long BLASULONG;
11 #endif
12 #include "../config.h"
13 
14 #include "../inc/relapack.h"
15 
16 // add an underscore to BLAS routines (or not)
17 #if BLAS_UNDERSCORE
18 #define BLAS(routine) routine ## _
19 #else
20 #define BLAS(routine) routine
21 #endif
22 
23 // add an underscore to LAPACK routines (or not)
24 #if LAPACK_UNDERSCORE
25 #define LAPACK(routine) routine ## _
26 #else
27 #define LAPACK(routine) routine
28 #endif
29 
30 // minimum and maximum macros
31 #define MAX(a, b) ((a) > (b) ? (a) : (b))
32 #define MIN(a, b) ((a) < (b) ? (a) : (b))
33 
34 // REC_SPLIT(n) returns how a problem of size n is split recursively.
35 // If n >= 16, we ensure that the size of at least one of the halves is
36 // divisible by 8 (the cache line size in most CPUs), while both halves are
37 // still as close as possible in size.
38 // If n < 16 the problem is simply split in the middle. (Note that the
39 // crossoversize is usually larger than 16.)
40 #define SREC_SPLIT(n) ((n >= 32) ? ((n + 16) / 32) * 16 : n / 2)
41 #define DREC_SPLIT(n) ((n >= 16) ? ((n + 8) / 16) * 8 : n / 2)
42 #define CREC_SPLIT(n) ((n >= 16) ? ((n + 8) / 16) * 8 : n / 2)
43 #define ZREC_SPLIT(n) ((n >= 8) ? ((n + 4) / 8) * 4 : n / 2)
44 
45 #include "lapack.h"
46 #include "blas.h"
47 
48 // sytrf helper routines
49 void RELAPACK_ssytrf_rec2(const char *, const blasint *, const blasint *, blasint *, float *, const blasint *, blasint *, float *, const blasint *, blasint *);
50 void RELAPACK_dsytrf_rec2(const char *, const blasint *, const blasint *, blasint *, double *, const blasint *, blasint *, double *, const blasint *, blasint *);
51 void RELAPACK_csytrf_rec2(const char *, const blasint *, const blasint *, blasint *, float *, const blasint *, blasint *, float *, const blasint *, blasint *);
52 void RELAPACK_chetrf_rec2(const char *, const blasint *, const blasint *, blasint *, float *, const blasint *, blasint *, float *, const blasint *, blasint *);
53 void RELAPACK_zsytrf_rec2(const char *, const blasint *, const blasint *, blasint *, double *, const blasint *, blasint *, double *, const blasint *, blasint *);
54 void RELAPACK_zhetrf_rec2(const char *, const blasint *, const blasint *, blasint *, double *, const blasint *, blasint *, double *, const blasint *, blasint *);
55 void RELAPACK_ssytrf_rook_rec2(const char *, const blasint *, const blasint *, blasint *, float *, const blasint *, blasint *, float *, const blasint *, blasint *);
56 void RELAPACK_dsytrf_rook_rec2(const char *, const blasint *, const blasint *, blasint *, double *, const blasint *, blasint *, double *, const blasint *, blasint *);
57 void RELAPACK_csytrf_rook_rec2(const char *, const blasint *, const blasint *, blasint *, float *, const blasint *, blasint *, float *, const blasint *, blasint *);
58 void RELAPACK_chetrf_rook_rec2(const char *, const blasint *, const blasint *, blasint *, float *, const blasint *, blasint *, float *, const blasint *, blasint *);
59 void RELAPACK_zsytrf_rook_rec2(const char *, const blasint *, const blasint *, blasint *, double *, const blasint *, blasint *, double *, const blasint *, blasint *);
60 void RELAPACK_zhetrf_rook_rec2(const char *, const blasint *, const blasint *, blasint *, double *, const blasint *, blasint *, double *, const blasint *, blasint *);
61 
62 // trsyl helper routines
63 void RELAPACK_strsyl_rec2(const char *, const char *, const blasint *, const blasint *, const blasint *, const float *, const blasint *, const float *, const blasint *, float *, const blasint *, float *, blasint *);
64 void RELAPACK_dtrsyl_rec2(const char *, const char *, const blasint *, const blasint *, const blasint *, const double *, const blasint *, const double *, const blasint *, double *, const blasint *, double *, blasint *);
65 void RELAPACK_ctrsyl_rec2(const char *, const char *, const blasint *, const blasint *, const blasint *, const float *, const blasint *, const float *, const blasint *, float *, const blasint *, float *, blasint *);
66 void RELAPACK_ztrsyl_rec2(const char *, const char *, const blasint *, const blasint *, const blasint *, const double *, const blasint *, const double *, const blasint *, double *, const blasint *, double *, blasint *);
67 
68 #endif /*  RELAPACK_INT_H */
69