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

Use size_t for some sizes

This allows really big matrices on 64-bit systems.
parent 8ea21d9c
......@@ -61,9 +61,8 @@ int
main(void)
{
char buf[80];
int arsize;
LPLONG arsize2d, memreq, nreps;
size_t malloc_arg;
LPLONG nreps;
size_t arsize2d, arsize, malloc_arg, memreq;
while (1)
{
......@@ -82,21 +81,26 @@ main(void)
printf("Too small.\n");
continue;
}
arsize2d = (LPLONG)arsize * (LPLONG)arsize;
arsize2d = arsize * arsize;
memreq = (arsize2d * sizeof(REAL)
+ (LPLONG)arsize * sizeof(REAL)
+ (LPLONG)arsize*sizeof(int));
+ arsize * sizeof(REAL)
+ arsize * sizeof(int));
printf("Memory required: %ldK.\n",(memreq+512L)>>10);
malloc_arg=(size_t)memreq;
if (malloc_arg!=memreq || (mempool=malloc(malloc_arg))==NULL)
printf("Memory required: %"PRIi64"K.\n",
(int64_t)(memreq + 512L) >> 10);
malloc_arg = memreq;
if (malloc_arg != memreq || (mempool = malloc(malloc_arg)) == NULL)
{
printf("Not enough memory available for given array size.\n\n");
continue;
}
printf("\n\nLINPACK benchmark, accelerate version, %s precision.\n",PREC);
printf("Machine precision: %d digits.\n",BASE10DIG);
printf("Array size %d X %d.\n",arsize,arsize);
printf("Array size %"PRIi64" X %"PRIi64".\n",
(int64_t)arsize, (int64_t)arsize);
printf(" Reps Time(s) DGEFA DGESL OVERHEAD KFLOPS\n");
printf("----------------------------------------------------\n");
nreps=1;
......
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