From 4c458fae9c1d7d51aec9823cf7456fdfe93a23f8 Mon Sep 17 00:00:00 2001 From: David Galiffi Date: Thu, 29 Jan 2026 09:34:27 -0500 Subject: [PATCH] [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 --- .../lib/rocprof-sys/library/rocprofiler-sdk.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/rocprofiler-sdk.cpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/rocprofiler-sdk.cpp index 495e10cd50..9ac176e192 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/rocprofiler-sdk.cpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/rocprofiler-sdk.cpp @@ -569,8 +569,10 @@ uint64_t get_scratch_mem_alloc_size( [[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 -#if(ROCPROFSYS_USE_ROCM > 0 && ROCPROFSYS_ROCM_VERSION >= 70002) +// The version of rocprofiler_buffer_tracing_scratch_memory_record_t from ROCm < 7.1 does +// 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; #else return 0; @@ -1832,9 +1834,10 @@ tool_tracing_buffered(rocprofiler_context_id_t /*context*/, if(get_use_perfetto()) { -// Scratch memory samples from SDK versions prior to 7.0.2 do not include -// allocation_size field, so counter tracks are not needed -#if(ROCPROFSYS_USE_ROCM > 0 && ROCPROFSYS_ROCM_VERSION >= 70002) +// The version of rocprofiler_buffer_tracing_scratch_memory_record_t from ROCm < 7.1 does +// 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) using counter_track = perfetto_counter_track< rocprofiler_buffer_tracing_scratch_memory_record_t>;