Add HSA tracing support for hsa_amd_vmem_address_reserve_align (#946)

* Add support for hsa_amd_vmem_address_reserve_align

* Update lib/rocprofiler-sdk/hsa/types.hpp

- support HSA_AMD_EXT_API_TABLE_STEP_VERSION == 0x2 for HSA v1.14.0

---------

Co-authored-by: Gopesh Bhardwaj <gopesh.bhardwaj@amd.com>

[ROCm/rocprofiler-sdk commit: 12785ad365]
This commit is contained in:
Jonathan R. Madsen
2024-06-21 11:58:39 -05:00
committed by GitHub
parent 2e10d7e2fa
commit 0114bcad4b
4 changed files with 43 additions and 2 deletions
@@ -106,6 +106,9 @@ typedef enum // NOLINT(performance-enum-size)
# if HSA_AMD_EXT_API_TABLE_STEP_VERSION >= 0x02
ROCPROFILER_HSA_AMD_EXT_API_ID_hsa_amd_queue_get_info,
# endif
# if HSA_AMD_EXT_API_TABLE_STEP_VERSION >= 0x03
ROCPROFILER_HSA_AMD_EXT_API_ID_hsa_amd_vmem_address_reserve_align,
# endif
#endif
ROCPROFILER_HSA_AMD_EXT_API_ID_LAST,
@@ -1397,6 +1397,16 @@ typedef union rocprofiler_hsa_api_args_t
void* value;
} hsa_amd_queue_get_info;
# endif
# if HSA_AMD_EXT_API_TABLE_STEP_VERSION >= 0x03
struct
{
void** ptr;
size_t size;
uint64_t address;
uint64_t alignment;
uint64_t flags;
} hsa_amd_vmem_address_reserve_align;
# endif
#endif
} rocprofiler_hsa_api_args_t;
@@ -444,6 +444,17 @@ HSA_API_INFO_DEFINITION_V(ROCPROFILER_HSA_TABLE_ID_AmdExt,
attribute,
value)
# endif
# if HSA_AMD_EXT_API_TABLE_STEP_VERSION >= 0x03
HSA_API_INFO_DEFINITION_V(ROCPROFILER_HSA_TABLE_ID_AmdExt,
ROCPROFILER_HSA_AMD_EXT_API_ID_hsa_amd_vmem_address_reserve_align,
hsa_amd_vmem_address_reserve_align,
hsa_amd_vmem_address_reserve_align_fn,
ptr,
size,
address,
alignment,
flags)
# endif
# endif
#elif defined(ROCPROFILER_LIB_ROCPROFILER_HSA_ASYNC_COPY_CPP_IMPL) && \
@@ -134,7 +134,7 @@ struct table_size;
// latest version of hsa runtime that has been updated for support by rocprofiler
// and the current version of hsa runtime during this compilation
constexpr size_t latest_version = ROCPROFILER_COMPUTE_VERSION(1, 13, 0);
constexpr size_t latest_version = ROCPROFILER_COMPUTE_VERSION(1, 14, 0);
constexpr size_t current_version = ROCPROFILER_HSA_RUNTIME_VERSION;
// aliases to the template specializations providing the table size info
@@ -173,8 +173,25 @@ struct table_size<ROCPROFILER_COMPUTE_VERSION(1, 13, 0)>
static constexpr size_t amd_ext = 552;
# elif HSA_AMD_EXT_API_TABLE_STEP_VERSION == 0x1
static constexpr size_t amd_ext = 560;
# else
# elif HSA_AMD_EXT_API_TABLE_STEP_VERSION == 0x2
static constexpr size_t amd_ext = 568;
# elif HSA_AMD_EXT_API_TABLE_STEP_VERSION > 0x2
static constexpr size_t amd_ext = 576;
# endif
};
// specialization for v1.14
template <>
struct table_size<ROCPROFILER_COMPUTE_VERSION(1, 14, 0)>
{
static constexpr size_t finalizer_ext = 64;
static constexpr size_t image_ext = 120;
static constexpr size_t core_api_ext = 1016;
static constexpr size_t amd_tool = 64;
# if HSA_AMD_EXT_API_TABLE_STEP_VERSION == 0x2
static constexpr size_t amd_ext = 568;
# elif HSA_AMD_EXT_API_TABLE_STEP_VERSION > 0x2
static constexpr size_t amd_ext = 576;
# endif
};