Add support for hsa_amd_queue_get_info (#752)

* Add support for hsa_amd_queue_get_info

- HSA_AMD_EXT_API_TABLE_STEP_VERSION == 0x02

* Suppress unused-but-set-parameter warnings

[ROCm/rocprofiler-sdk commit: 3c005b81b1]
This commit is contained in:
Jonathan R. Madsen
2024-04-11 18:29:22 -05:00
committed by GitHub
orang tua 6076c751a3
melakukan beec57376a
7 mengubah file dengan 35 tambahan dan 9 penghapusan
@@ -49,6 +49,11 @@ namespace rocprofiler
{
namespace common
{
template <typename... Tp>
void
consume_args(Tp&&...)
{}
uint64_t
get_clock_period_ns_impl(clockid_t _clk_id);
@@ -407,6 +407,15 @@ HSA_API_INFO_DEFINITION_V(ROCPROFILER_HSA_TABLE_ID_AmdExt,
agent,
threshold)
# endif
# if HSA_AMD_EXT_API_TABLE_STEP_VERSION >= 0x02
HSA_API_INFO_DEFINITION_V(ROCPROFILER_HSA_TABLE_ID_AmdExt,
ROCPROFILER_HSA_AMD_EXT_API_ID_hsa_amd_queue_get_info,
hsa_amd_queue_get_info,
hsa_amd_queue_get_info_fn,
queue,
attribute,
value)
# endif
# endif
#elif defined(ROCPROFILER_LIB_ROCPROFILER_HSA_ASYNC_COPY_CPP_IMPL) && \
@@ -484,7 +484,8 @@ impl(Args... args)
const auto tid = common::get_tid();
const auto get_agent_id = [](const hsa_queue_t* hsa_queue) -> rocprofiler_agent_id_t {
[[maybe_unused]] const auto get_agent_id =
[](const hsa_queue_t* hsa_queue) -> rocprofiler_agent_id_t {
rocprofiler_agent_id_t _agent_id{static_cast<uint64_t>(-1)};
bool found_agent{false};
@@ -635,6 +636,9 @@ update_table(const context_array_t& ctxs, hsa_amd_tool_table_t* _orig)
_func = get_hsa_amd_tool_api_impl<TableIdx, OpIdx>(_func);
}
// suppress unused paramter
common::consume_args(ctxs, _orig);
}
template <size_t TableIdx, size_t... OpIdx>
@@ -169,8 +169,10 @@ struct table_size<ROCPROFILER_COMPUTE_VERSION(1, 13, 0)>
// TODO(jomadsen): come up with a better way of handling this
# if HSA_AMD_EXT_API_TABLE_STEP_VERSION == 0x00
static constexpr size_t amd_ext = 552;
# else
# elif HSA_AMD_EXT_API_TABLE_STEP_VERSION == 0x1
static constexpr size_t amd_ext = 560;
# else
static constexpr size_t amd_ext = 568;
# endif
};
@@ -23,15 +23,10 @@
#include <rocprofiler-sdk/fwd.h>
#include <rocprofiler-sdk/pc_sampling.h>
#include "lib/common/utility.hpp"
#include "lib/rocprofiler-sdk/registration.hpp"
namespace
{
template <typename... Tp>
auto
consume_args(Tp&&...)
{}
} // namespace
using ::rocprofiler::common::consume_args;
extern "C" {
rocprofiler_status_t