Commit dd5ba12a authored by Ture Pålsson's avatar Ture Pålsson
Browse files

Single/double precision choice for accelerate version.

parent 7306da97
......@@ -29,11 +29,25 @@
#include <time.h>
#include <float.h>
#if defined(SP)
#define ZERO 0.0
#define ONE 1.0
#define PREC "Single"
#define BASE10DIG FLT_DIG
typedef float REAL;
#elif defined(DP)
#define ZERO 0.0e0
#define ONE 1.0e0
#define PREC "Double"
#define BASE10DIG DBL_DIG
typedef double REAL;
#endif
#if defined(__LP64__)
typedef int LPLONG;
#define PLF "d"
......@@ -42,15 +56,12 @@ typedef long LPLONG;
#define PLF "ld"
#endif
typedef double REAL;
static REAL linpack (LPLONG nreps,int arsize);
static void matgen (REAL *a,int lda,int n,REAL *b,REAL *norma);
static REAL second (void);
static void *mempool;
int
main(void)
{
......@@ -157,7 +168,11 @@ main(void)
*/
static void dgefa(REAL *a, LPLONG lda, LPLONG n, LPLONG *ipvt, LPLONG *info)
{
#if defined(DP)
dgetrf_(&n, &n, a, &lda, ipvt, info);
#elif defined(SP)
sgetrf_(&n, &n, a, &lda, ipvt, info);
#endif
}
/*
......@@ -228,7 +243,11 @@ dgesl(REAL *a, LPLONG lda, LPLONG n, LPLONG *ipvt, REAL *b, int job)
LPLONG nrhs = 1;
LPLONG ldb = n;
static char trans = 'N';
#if defined(DP)
dgetrs_(&trans, &n, &nrhs, a, &lda, ipvt, b, &ldb, &info);
#elif defined(SP)
sgetrs_(&trans, &n, &nrhs, a, &lda, ipvt, b, &ldb, &info);
#endif
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment