[PATCH] Bounds check only if POOMA_BOUNDS_CHECK

Jeffrey D. Oldham oldham at codesourcery.com
Thu Aug 19 21:59:09 UTC 2004


Richard Guenther wrote:

>
> This patch disables GuardLayers boundschecking if not configured with 
> bounds checking on.
>
> Ok?
>
> Richard.
>
>
> 2004Aug19  Richard Guenther <richard.guenther at uni-tuebingen.de>
>
>     * src/Layout/GuardLayers.h: disable bounds-checking if not
>     POOMA_BOUNDS_CHECK.
>
Yes, please commit this change.

>------------------------------------------------------------------------
>
>Index: src/Layout/GuardLayers.h
>===================================================================
>RCS file: /home/pooma/Repository/r2/src/Layout/GuardLayers.h,v
>retrieving revision 1.10
>diff -u -u -r1.10 GuardLayers.h
>--- src/Layout/GuardLayers.h	26 Oct 2003 11:28:11 -0000	1.10
>+++ src/Layout/GuardLayers.h	19 Aug 2004 21:15:39 -0000
>@@ -123,12 +123,16 @@
>   
>   int lower(int i) const
>   { 
>+#if POOMA_BOUNDS_CHECK
>     PInsist(i<Dim&&i>=0," GuardLayers index out of range ");
>+#endif
>     return lower_m[i]; 
>   }
>   int upper(int i) const 
>   {   
>+#if POOMA_BOUNDS_CHECK
>     PInsist(i<Dim&&i>=0," GuardLayers index out of range ");
>+#endif
>     return upper_m[i]; 
>   }
>   
>@@ -138,12 +142,16 @@
>   
>   int &lower(int i) 
>   {    
>+#if POOMA_BOUNDS_CHECK
>     PInsist(i<Dim&&i>=0," GuardLayers index out of range ");
>+#endif
>     return lower_m[i]; 
>   }
>   int &upper(int i) 
>   {    
>+#if POOMA_BOUNDS_CHECK
>     PInsist(i<Dim&&i>=0," GuardLayers index out of range ");
>+#endif
>     return upper_m[i]; 
>   }
>   
>  
>


-- 
Jeffrey D. Oldham
oldham at codesourcery.com




More information about the pooma-dev mailing list