[PATCH] Guard PInsist with POOMA_BOUNDS_CHECK

Richard Guenther rguenth at tat.physik.uni-tuebingen.de
Thu Nov 6 21:56:20 UTC 2003


Hi!

The following patch removes PInsist calls from taking centering views of
Fields.  This allows for better optimized code here.

Ok?

Richard.

===== FieldCentering.h 1.6 vs edited =====
--- 1.6/r2/src/Field/FieldCentering.h	Mon Oct 27 11:25:15 2003
+++ edited/FieldCentering.h	Thu Nov  6 22:54:48 2003
@@ -244,8 +244,10 @@
   /// Return a centering with one specified value.
   const Centering<Dim> operator[](int iSubField) const
   {
+#if POOMA_BOUNDS_CHECK
     PInsist(iSubField >= 0 && iSubField < size(),
 	    "Illegal attempt to extract a non-existent centering.");
+#endif
     return Centering<Dim>(centering_type_m, discontinuous_m,
 			  Orientations(1, orientations_m[iSubField]),
 			  Positions(1, positions_m[iSubField]));
@@ -303,8 +305,10 @@

   inline int size() const
   {
+#if POOMA_BOUNDS_CHECK
     PInsist(orientations_m.size() == positions_m.size(),
 	    "In a centering, the number of orientations must match the number of positions.");
+#endif
     return orientations_m.size();
   }




More information about the pooma-dev mailing list