~ubuntu-branches/ubuntu/vivid/atlas/vivid

« back to all changes in this revision

Viewing changes to tune/blas/level1/axpbytest.c

  • Committer: Package Import Robot
  • Author(s): Sébastien Villemot
  • Date: 2013-06-11 15:58:16 UTC
  • mfrom: (1.1.3 upstream)
  • mto: (2.2.21 experimental)
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: package-import@ubuntu.com-20130611155816-b72z8f621tuhbzn0
Tags: upstream-3.10.1
Import upstream version 3.10.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
   int n, i;
27
27
   const int malign = align >= misalign ? align : misalign;
28
28
 
29
 
   n = size + align + malign;
 
29
   n = size + align + align + malign;
30
30
   i = (n >> 3)<<3;
31
31
   if (n != i)
32
32
      n += n - i;
40
40
   ap->memA = align ? (void*) ((((size_t) cp)/align)*align + align) : cp;
41
41
/*
42
42
 * Misalign to misalign
 
43
 * We often need to make sure to unaligned addresses share the same modulo
 
44
 * so that they have the *same* degree of misalignment (so that their alignment
 
45
 * can be fixed by simple peeling), and so in this case force the address
 
46
 * modulo the misalign to be the exact align value.
43
47
 */
44
48
   if (misalign)
45
 
   {
46
 
      if (((size_t)ap->memA)%misalign == 0)
47
 
         ap->memA = ((char*)ap->memA) + align;
48
 
   }
 
49
      ap->memA = (void*)((((size_t)ap->memA)/malign)*malign + malign + align);
49
50
   ap->next = next;
50
51
   return(ap);
51
52
}
116
117
         for (ap=allocQ; ap && ap->memA != ptr; ap = ap->next) prev = ap;
117
118
         if (!ap)
118
119
         {
119
 
            fprintf(stderr, "Couldn't find mem=%ld\nmemQ=\n", ptr);
 
120
            fprintf(stderr, "Couldn't find mem=%ld\nmemQ=\n", (size_t)ptr);
120
121
            for (ap=allocQ; ap; ap = ap->next)
121
 
               fprintf(stderr, "   %ld, %ld\n", ap->memA, ap->mem);
 
122
               fprintf(stderr, "   %ld, %ld\n", (size_t)ap->memA,
 
123
                       (size_t)ap->mem);
122
124
         }
123
125
         assert(ap);
124
126
         if (ap == allocQ)
652
654
      FAy = sizeof(TYPE);
653
655
}
654
656
 
655
 
main(int nargs, char **args)
 
657
int main(int nargs, char **args)
656
658
{
657
659
   int nN, nX, nY, nal, nbe;
658
660
   int *Ns, *incXs, *incYs;
665
667
   if (betas) free(betas);
666
668
   free(incXs);
667
669
   free(incYs);
668
 
   exit(ierr);
 
670
   return(ierr);
669
671
}