[rocprofiler-systems] Fix ROCM_VERSION guard used for the scratch_memory_record structure (#2948)

- Fix ROCM_VERSION guard used for the scratch_memory_record structure
- This fixes a rocm/7.0.2 build failure

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
This commit is contained in:
David Galiffi
2026-01-29 09:34:27 -05:00
zatwierdzone przez GitHub
rodzic b5e4074c78
commit 4c458fae9c
@@ -569,8 +569,10 @@ uint64_t
get_scratch_mem_alloc_size( get_scratch_mem_alloc_size(
[[maybe_unused]] const rocprofiler_buffer_tracing_scratch_memory_record_t& record) [[maybe_unused]] const rocprofiler_buffer_tracing_scratch_memory_record_t& record)
{ {
// Scratch memory samples from SDK versions prior to 7.0.2 do not include allocation_size // The version of rocprofiler_buffer_tracing_scratch_memory_record_t from ROCm < 7.1 does
#if(ROCPROFSYS_USE_ROCM > 0 && ROCPROFSYS_ROCM_VERSION >= 70002) // not have the allocation_size field. ROCPROFILER_VERSION for both ROCm 7.0 and 7.1
// is 1.0.0, so we need to check the ROCm version.
#if(ROCPROFSYS_USE_ROCM > 0 && ROCPROFSYS_ROCM_VERSION >= 70100)
return record.allocation_size; return record.allocation_size;
#else #else
return 0; return 0;
@@ -1832,9 +1834,10 @@ tool_tracing_buffered(rocprofiler_context_id_t /*context*/,
if(get_use_perfetto()) if(get_use_perfetto())
{ {
// Scratch memory samples from SDK versions prior to 7.0.2 do not include // The version of rocprofiler_buffer_tracing_scratch_memory_record_t from ROCm < 7.1 does
// allocation_size field, so counter tracks are not needed // not have the allocation_size field. ROCPROFILER_VERSION for both ROCm 7.0 and 7.1
#if(ROCPROFSYS_USE_ROCM > 0 && ROCPROFSYS_ROCM_VERSION >= 70002) // is 1.0.0, so we need to check the ROCm version.
#if(ROCPROFSYS_USE_ROCM > 0 && ROCPROFSYS_ROCM_VERSION >= 70100)
using counter_track = perfetto_counter_track< using counter_track = perfetto_counter_track<
rocprofiler_buffer_tracing_scratch_memory_record_t>; rocprofiler_buffer_tracing_scratch_memory_record_t>;