diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2011-02-05 19:28:29 -0500 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2011-02-05 19:28:29 -0500 |
commit | f29e62d78c090aca7044c11683bf2c4a0c159046 (patch) | |
tree | 86915a1c208614482a1df4940ff653b504889996 /Carpet/CarpetLib/src/interpolate_3d_4tl.cc | |
parent | d0fb19b12a8db0b85e8d5680e83c08c1b3f29a8a (diff) |
CarpetLib: Introduce gdata::allocated_memory_shape
Introduce a function gdata::allocated_memory_shape that determines from a given grid size how many grid points should be allocated. This allows adding padding to grid sizes, e.g. to improve cache performance.
Use this function when checking grid sizes.
Diffstat (limited to 'Carpet/CarpetLib/src/interpolate_3d_4tl.cc')
-rw-r--r-- | Carpet/CarpetLib/src/interpolate_3d_4tl.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Carpet/CarpetLib/src/interpolate_3d_4tl.cc b/Carpet/CarpetLib/src/interpolate_3d_4tl.cc index c5d44ca82..0e5439893 100644 --- a/Carpet/CarpetLib/src/interpolate_3d_4tl.cc +++ b/Carpet/CarpetLib/src/interpolate_3d_4tl.cc @@ -8,6 +8,7 @@ #include <loopcontrol.h> +#include "gdata.hh" #include "operator_prototypes_3d.hh" #include "typeprops.hh" @@ -72,8 +73,8 @@ namespace CarpetLib { CCTK_WARN (0, "Internal error: region extent is not contained in array extent"); } - if (any (srcext != srcbbox.shape() / srcbbox.stride() or - dstext != dstbbox.shape() / dstbbox.stride())) + if (any (srcext != gdata::allocated_memory_shape(srcbbox.shape() / srcbbox.stride()) or + dstext != gdata::allocated_memory_shape(dstbbox.shape() / dstbbox.stride()))) { CCTK_WARN (0, "Internal error: array sizes don't agree with bounding boxes"); } |