HSA memory alloc/copy/free refactoring

[ROCm/rocprofiler commit: d04f7095f4]
This commit is contained in:
Evgeny
2018-04-20 11:15:26 -05:00
parent 12fbe76eab
commit 0a8e945d88
10 changed files with 87 additions and 36 deletions
+2 -2
View File
@@ -446,8 +446,8 @@ class Context {
else EXC_RAISING(HSA_STATUS_ERROR, "SQTT data out of output buffer");
}
hsa_status_t status = hsa_memory_copy(dest, src, size);
if (status == HSA_STATUS_SUCCESS) {
const bool suc = util::HsaRsrcFactory::CopyToHost(dest, src, size);
if (suc) {
*header = size;
callback_data->ptr = dest + align_size(size, sizeof(uint32_t));
rinfo->data.result_bytes.instance_count = sample_id + 1;
+2 -2
View File
@@ -88,8 +88,8 @@ class Profile {
}
virtual ~Profile() {
info_vector_.clear();
if (profile_.command_buffer.ptr) hsa_memory_free(profile_.command_buffer.ptr);
if (profile_.output_buffer.ptr) hsa_memory_free(profile_.output_buffer.ptr);
if (profile_.command_buffer.ptr) util::HsaRsrcFactory::MemoryFree(profile_.command_buffer.ptr);
if (profile_.output_buffer.ptr) util::HsaRsrcFactory::MemoryFree(profile_.output_buffer.ptr);
if (profile_.events) free(const_cast<event_t*>(profile_.events));
if (profile_.parameters) free(const_cast<parameter_t*>(profile_.parameters));
if (completion_signal_.handle) {