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>;