From 57733404c155980a56daa3358b60da12a3bfc0ab Mon Sep 17 00:00:00 2001 From: Ben Sander Date: Mon, 3 Jul 2017 15:05:30 -0500 Subject: [PATCH] Add hipdbPrintMem - wrapper for hcc memory tracker. [ROCm/clr commit: 18660be8ce392ff8e773306fcf8b5eeb7d157fb3] --- projects/clr/hipamd/CMakeLists.txt | 1 + .../hipamd/include/hip/hcc_detail/hip_db.h | 22 +++++++++++++++++++ projects/clr/hipamd/src/hip_db.cpp | 12 ++++++++++ 3 files changed, 35 insertions(+) create mode 100644 projects/clr/hipamd/include/hip/hcc_detail/hip_db.h create mode 100644 projects/clr/hipamd/src/hip_db.cpp diff --git a/projects/clr/hipamd/CMakeLists.txt b/projects/clr/hipamd/CMakeLists.txt index b3ea5a3ca3..7d4039b4b4 100644 --- a/projects/clr/hipamd/CMakeLists.txt +++ b/projects/clr/hipamd/CMakeLists.txt @@ -179,6 +179,7 @@ if(HIP_PLATFORM STREQUAL "hcc") src/hip_peer.cpp src/hip_stream.cpp src/hip_module.cpp + src/hip_db.cpp src/grid_launch.cpp src/env.cpp) diff --git a/projects/clr/hipamd/include/hip/hcc_detail/hip_db.h b/projects/clr/hipamd/include/hip/hcc_detail/hip_db.h new file mode 100644 index 0000000000..eb5c3c0ac8 --- /dev/null +++ b/projects/clr/hipamd/include/hip/hcc_detail/hip_db.h @@ -0,0 +1,22 @@ +/** + * @defgroup HipDb HCC-specific debug facilities + * @{ + */ + + +/** + * @brief * Print memory tracker information for this pointer. + * + * HIP maintains a table for all memory allocations performed by the application. + * If targetAddress is 0, the entire table is printed to stderr. + * If targetAddress is non-null, this routine will perform some forensic analysis + * to find the pointer + */ +void hipdbPrintMem(void *targetAddress); + + + +// doxygen end HipDb +/** + * @} + */ diff --git a/projects/clr/hipamd/src/hip_db.cpp b/projects/clr/hipamd/src/hip_db.cpp new file mode 100644 index 0000000000..21fa677fe6 --- /dev/null +++ b/projects/clr/hipamd/src/hip_db.cpp @@ -0,0 +1,12 @@ + +#include "hcc/hc_am.hpp" + + + + +void hipdbPrintMem(void *targetAddress) +{ + hc::am_memtracker_print(targetAddress); +}; + +