rocprofiler
rocprofiler copied to clipboard
Multiple variable definition errors if rocprofiler.h is included in multiple C files
The HSA_VEN_AMD_AQLPROFILE_LEGACY_PM4_PACKET_SIZE
is defined in an header file (hsa_ven_amd_aqlprofile.h
) instead of a C file. The header is then included in rocprofiler.h
and causes multiple definition errors at compile time when the rocprofiler header is included in more than one C file.
A possible fix for this problem could be to define the variable as static
in the header file or to declare it extern
in the header and define it another C file.
@ammarwa any update on this? Thanks
This is a reproducer issue-114.tar.gz
@gcongiu Thanks for the reproducer! I was able to reproduce the issue on ROCm-6.2. Since this issue is a duplicate of https://github.com/ROCm/ROCR-Runtime/issues/121, we will be closing this issue and track it there. Thanks!
@mardom1 The correct usage of the header file for v2 would be that instead of '#include <rocprofiler.h>', use '#include <v2/rocprofiler.h>' instead.
Please refer to the documentation for the API here: https://github.com/ROCm/rocprofiler?tab=readme-ov-file#rocprofiler-v1
Along with the example here: ROCProfilerV2 API — rocprofiler 2.0.0 Documentation (amd.com)
Apologies for the confusion. Hope this helps!