SWDEV-492625 memory free functions (#11)

* SWDEV-492625: Track free memory HSA functions to help determine total amount of memory allocated on the system at any one time

* Minor fixes to address comments

* Update allocation size description

* Moved get function back to specialization, minor typo fixes

* Removed memory_operation_type field, removed memory_pool allocation enum, converted starting address to hex string for json format.

* Made conversion to hex_string a function, changed address to use union rocprofiler_address_t type, changed VMEM descriptors

* Removed as_hex from the global namespace

* Formatting

* Removed TRACK_EVENT for memory allocation, now TRACK_COUNTER for memory allocation is being performed

* Check if address was recorded before retrieving allocation size in generate Perfetto

* Formatting

* Update source/lib/output/generatePerfetto.cpp

* Explicitly disable app-abort tests

* Remove excluding app-abort test from workflow CI

- redundant bc these tests are explicitly marked as disabled now

---------

Co-authored-by: Madsen, Jonathan <Jonathan.Madsen@amd.com>
Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>

[ROCm/rocprofiler-sdk commit: 79006bb896]
Bu işleme şunda yer alıyor:
Trowbridge, Ian
2024-12-06 00:05:30 -06:00
işlemeyi yapan: GitHub
ebeveyn a79f8a0198
işleme 792329fefd
23 değiştirilmiş dosya ile 564 ekleme ve 248 silme
+7 -1
Dosyayı Görüntüle
@@ -170,6 +170,8 @@ call_hsa_memory_allocate(const size_t i, const size_t base_size, hsa_agent_t age
status = hsa_memory_allocate(region_list[0], base_size, &addr);
RET_IF_HSA_ERR(status)
status = hsa_memory_free(addr);
RET_IF_HSA_ERR(status)
}
}
@@ -199,6 +201,8 @@ call_hsa_memory_pool_allocate(const size_t i, const size_t base_size, hsa_agent_
status = hsa_amd_memory_pool_allocate(memory_pool_list[0], base_size, flags, &addr);
RET_IF_HSA_ERR(status)
status = hsa_amd_memory_pool_free(addr);
RET_IF_HSA_ERR(status)
}
}
@@ -243,6 +247,8 @@ call_hsa_vmem_allocate(const size_t i, hsa_agent_t agent)
status = hsa_amd_vmem_handle_create(
memory_pool_list[0], size, MEMORY_TYPE_NONE, 0, &memory_handle);
RET_IF_HSA_ERR(status)
status = hsa_amd_vmem_handle_release(memory_handle);
RET_IF_HSA_ERR(status)
}
}
@@ -257,7 +263,7 @@ main()
hsa_agent_t cpu_agent = get_cpu_agent(agents);
hsa_agent_t gpu_agent = get_gpu_agent(agents);
call_hsa_memory_allocate(6, 1024, cpu_agent);
call_hsa_memory_pool_allocate(9, 512, gpu_agent);
call_hsa_memory_pool_allocate(9, 2048, gpu_agent);
// Virtual memory API not supported in CI. Will add back if this changes
// call_hsa_vmem_allocate(3, gpu_agent);