diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-06-22 12:48:43 -0400 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-06-22 12:48:43 -0400 |
commit | 63c05fd32134820b13fa37cd142aaf1cb86f384e (patch) | |
tree | ae251e484ba0f04f913025fd35066d19ef150da6 | |
parent | ff65161ae1244f9dab8d84b673923e57aead40ee (diff) |
LoopControl: Update GetCacheInfo1 API
-rw-r--r-- | Carpet/LoopControl/interface.ccl | 11 | ||||
-rw-r--r-- | Carpet/LoopControl/src/loopcontrol.cc | 13 |
2 files changed, 17 insertions, 7 deletions
diff --git a/Carpet/LoopControl/interface.ccl b/Carpet/LoopControl/interface.ccl index 85173c162..39f6d9672 100644 --- a/Carpet/LoopControl/interface.ccl +++ b/Carpet/LoopControl/interface.ccl @@ -14,9 +14,14 @@ USES INCLUDE HEADER: vectors.h CCTK_INT FUNCTION GetNumSMTThreads() USES FUNCTION GetNumSMTThreads -CCTK_INT FUNCTION GetCacheInfo1(CCTK_INT ARRAY OUT linesizes, \ - CCTK_INT ARRAY OUT strides, \ - CCTK_INT IN max_num_cache_levels) +CCTK_INT FUNCTION GetCacheInfo1 \ + (CCTK_POINTER_TO_CONST ARRAY OUT names, \ + CCTK_INT ARRAY OUT types, \ + CCTK_POINTER_TO_CONST ARRAY OUT sizes, \ + CCTK_INT ARRAY OUT linesizes, \ + CCTK_INT ARRAY OUT strides, \ + CCTK_INT ARRAY OUT num_puss, \ + CCTK_INT IN max_num_cache_levels) USES FUNCTION GetCacheInfo1 CCTK_INT FUNCTION IO_TruncateOutputFiles(CCTK_POINTER_TO_CONST IN cctkGH) diff --git a/Carpet/LoopControl/src/loopcontrol.cc b/Carpet/LoopControl/src/loopcontrol.cc index c25bd6f07..ac214e836 100644 --- a/Carpet/LoopControl/src/loopcontrol.cc +++ b/Carpet/LoopControl/src/loopcontrol.cc @@ -571,13 +571,18 @@ void lc_control_init(lc_control_t *restrict const control, { max_cache_linesize = 1; if (CCTK_IsFunctionAliased("GetCacheInfo1")) { - const int num_levels = GetCacheInfo1(NULL, NULL, 0); + const int num_levels = + GetCacheInfo1(NULL, NULL, NULL, NULL, NULL, NULL, 0); + vector<int> types (num_levels); vector<int> linesizes(num_levels); vector<int> strides (num_levels); - GetCacheInfo1(&linesizes[0], &strides[0], num_levels); + GetCacheInfo1(NULL, &types[0], NULL, &linesizes[0], &strides[0], NULL, + num_levels); for (int level=0; level<num_levels; ++level) { - max_cache_linesize = - max(max_cache_linesize, ptrdiff_t(linesizes[level])); + if (types[level]==0) { // if this is a cache + max_cache_linesize = + max(max_cache_linesize, ptrdiff_t(linesizes[level])); + } } } } |