2
0

HSA memory alloc/copy/free refactoring

[ROCm/rocprofiler commit: d04f7095f4]
Este cometimento está contido em:
Evgeny
2018-04-20 11:15:26 -05:00
ascendente 12fbe76eab
cometimento 0a8e945d88
10 ficheiros modificados com 87 adições e 36 eliminações
+8 -1
Ver ficheiro
@@ -31,6 +31,8 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdint.h>
#include <map>
#include "util/hsa_rsrc_factory.h"
// Class implements kernel test
class TestKernel {
public:
@@ -49,7 +51,12 @@ class TestKernel {
typedef mem_map_t::iterator mem_it_t;
typedef mem_map_t::const_iterator mem_const_it_t;
virtual ~TestKernel() {}
virtual ~TestKernel() {
for (auto& entry : mem_map_) {
void* ptr = entry.second.ptr;
if (ptr != NULL) HsaRsrcFactory::MemoryFree(ptr);
}
}
// Initialize method
virtual void Init() = 0;