Skip to content

Commit e64034f

Browse files
dgaliffiAMDsystems-assistant[bot]
authored andcommitted
[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 [rocm-systems] ROCm/rocm-systems#2948 (commit 4c458fa)
1 parent 1cfaac1 commit e64034f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

source/lib/rocprof-sys/library/rocprofiler-sdk.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,10 @@ uint64_t
569569
get_scratch_mem_alloc_size(
570570
[[maybe_unused]] const rocprofiler_buffer_tracing_scratch_memory_record_t& record)
571571
{
572-
// Scratch memory samples from SDK versions prior to 7.0.2 do not include allocation_size
573-
#if(ROCPROFSYS_USE_ROCM > 0 && ROCPROFSYS_ROCM_VERSION >= 70002)
572+
// The version of rocprofiler_buffer_tracing_scratch_memory_record_t from ROCm < 7.1 does
573+
// not have the allocation_size field. ROCPROFILER_VERSION for both ROCm 7.0 and 7.1
574+
// is 1.0.0, so we need to check the ROCm version.
575+
#if(ROCPROFSYS_USE_ROCM > 0 && ROCPROFSYS_ROCM_VERSION >= 70100)
574576
return record.allocation_size;
575577
#else
576578
return 0;
@@ -1832,9 +1834,10 @@ tool_tracing_buffered(rocprofiler_context_id_t /*context*/,
18321834

18331835
if(get_use_perfetto())
18341836
{
1835-
// Scratch memory samples from SDK versions prior to 7.0.2 do not include
1836-
// allocation_size field, so counter tracks are not needed
1837-
#if(ROCPROFSYS_USE_ROCM > 0 && ROCPROFSYS_ROCM_VERSION >= 70002)
1837+
// The version of rocprofiler_buffer_tracing_scratch_memory_record_t from ROCm < 7.1 does
1838+
// not have the allocation_size field. ROCPROFILER_VERSION for both ROCm 7.0 and 7.1
1839+
// is 1.0.0, so we need to check the ROCm version.
1840+
#if(ROCPROFSYS_USE_ROCM > 0 && ROCPROFSYS_ROCM_VERSION >= 70100)
18381841
using counter_track = perfetto_counter_track<
18391842
rocprofiler_buffer_tracing_scratch_memory_record_t>;
18401843

0 commit comments

Comments
 (0)