diff --git a/src/ml/hdcache.hpp b/src/ml/hdcache.hpp index 81d5f882..05355ccd 100644 --- a/src/ml/hdcache.hpp +++ b/src/ml/hdcache.hpp @@ -617,9 +617,11 @@ class HDCache PERFFASPECT() inline void _evaluate(const size_t ndata, bool *is_acceptable) const { - if (cache_location == AMSResourceType::HOST) { + if (cache_location == AMSResourceType::DEVICE) { #ifdef __ENABLE_CUDA__ - random_uq_Device<<<1, 1>>>(is_acceptable, ndata, acceptable_error); + random_uq_device<<<1, 1>>>(is_acceptable, ndata, acceptable_error); +#else + THROW(std::runtime_error, "Random-uq is not configured to use device allocations"); #endif } else { random_uq_host(is_acceptable, ndata, acceptable_error); diff --git a/src/wf/debug.h b/src/wf/debug.h index e50936e0..000db8b4 100644 --- a/src/wf/debug.h +++ b/src/wf/debug.h @@ -97,23 +97,28 @@ inline uint32_t getVerbosityLevel() #define DBG(id, ...) CDEBUG(id, true, __VA_ARGS__) -#define REPORT_MEM_USAGE(id, phase) \ - do { \ - double vm, rs; \ - size_t watermark, current_size, actual_size; \ - memUsage(vm, rs); \ - ams::ResourceManager::getAllocatorStats(AMSResourceType::HOST, \ - watermark, \ - current_size, \ - actual_size); \ - DBG(id, \ - "Memory usage at %s is VM:%g RS:%g HWM:%lu CS:%lu AS:%lu) ", \ - phase, \ - vm, \ - rs, \ - watermark, \ - current_size, \ - actual_size); \ +#define REPORT_MEM_USAGE(id, phase) \ + do { \ + double vm, rs; \ + size_t watermark, current_size, actual_size; \ + memUsage(vm, rs); \ + DBG(id, "Memory usage at %s is VM:%g RS:%g\n", phase, \ + vm, \ + rs); \ + \ + for (int i = 0; i < AMSResourceType::RSEND; i++){ \ + if ( ams::ResourceManager::isActive((AMSResourceType) i) ){ \ + ams::ResourceManager::getAllocatorStats((AMSResourceType) i, \ + watermark, \ + current_size, \ + actual_size); \ + DBG(id, "Allocator: %s HWM:%lu CS:%lu AS:%lu) ", \ + ams::ResourceManager::getAllocatorName((AMSResourceType) i).c_str(),\ + watermark, \ + current_size, \ + actual_size); \ + } \ + } \ } while (0); #define THROW(exception, msg) \ diff --git a/src/wf/resource_manager.hpp b/src/wf/resource_manager.hpp index a16eadd6..a26b7d9f 100644 --- a/src/wf/resource_manager.hpp +++ b/src/wf/resource_manager.hpp @@ -175,6 +175,10 @@ class ResourceManager RMAllocators[resource]->getName().c_str()); } + static bool isActive(AMSResourceType resource){ + return RMAllocators[resource] != nullptr; + } + /** @brief Returns the memory consumption of the given resource as measured from Umpire. * @param[in] resource The memory pool to get the consumption from. * @param[out] wm the highest memory allocation that umpire has performed until now.