toon-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Toon-members] TooN/internal allocator.hh


From: Tom Drummond
Subject: [Toon-members] TooN/internal allocator.hh
Date: Mon, 20 Apr 2009 17:07:48 +0000

CVSROOT:        /cvsroot/toon
Module name:    TooN
Changes by:     Tom Drummond <twd20>    09/04/20 17:07:48

Modified files:
        internal       : allocator.hh 

Log message:
        if using GCC then align double precision data to 8 byte boundary
        necessary for lapack on OS X and probably useful in general

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/internal/allocator.hh?cvsroot=toon&r1=1.26&r2=1.27

Patches:
Index: allocator.hh
===================================================================
RCS file: /cvsroot/toon/TooN/internal/allocator.hh,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- allocator.hh        12 Apr 2009 09:48:55 -0000      1.26
+++ allocator.hh        20 Apr 2009 17:07:47 -0000      1.27
@@ -36,18 +36,38 @@
 //
 // At this level, copy construction is required since it is only known here 
 // whether data or a reference to data should be copied.
+
+#ifdef __GNUC__
+#define ALIGN8 __attribute__ ((aligned(8)))
+#else
+#define ALIGN8
+#endif
+
+
 namespace Internal
 {
 
-template<int Size, class Precision, bool heap> class StackOrHeap
+template<int Size, class Precision, bool heap> class StackOrHeap;
+
+template<int Size, class Precision> class StackOrHeap<Size,Precision,0>
 {
-       public:
+public:
                StackOrHeap()
                {}
 
                Precision my_data[Size];
 };
 
+template<int Size> class StackOrHeap<Size,double,0>
+{
+public:
+               StackOrHeap()
+       {}
+
+       double my_data[Size] ALIGN8 ;
+};
+
+
 template<int Size, class Precision> class StackOrHeap<Size, Precision, 1>
 {
        public:
@@ -372,3 +392,6 @@
 
 
 }
+
+
+#undef ALIGN8




reply via email to

[Prev in Thread] Current Thread [Next in Thread]