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
Bu işleme şunda yer alıyor:
işlemeyi yapan:
GitHub
ebeveyn
348d740388
işleme
3c005b81b1
@@ -103,6 +103,9 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
# if HSA_AMD_EXT_API_TABLE_STEP_VERSION >= 0x01
|
||||
ROCPROFILER_HSA_AMD_EXT_API_ID_hsa_amd_agent_set_async_scratch_limit,
|
||||
# endif
|
||||
# if HSA_AMD_EXT_API_TABLE_STEP_VERSION >= 0x02
|
||||
ROCPROFILER_HSA_AMD_EXT_API_ID_hsa_amd_queue_get_info,
|
||||
# endif
|
||||
#endif
|
||||
|
||||
ROCPROFILER_HSA_AMD_EXT_API_ID_LAST,
|
||||
|
||||
@@ -1389,6 +1389,14 @@ typedef union rocprofiler_hsa_api_args_t
|
||||
size_t threshold;
|
||||
} hsa_amd_agent_set_async_scratch_limit;
|
||||
# endif
|
||||
# if HSA_AMD_EXT_API_TABLE_STEP_VERSION >= 0x02
|
||||
struct
|
||||
{
|
||||
hsa_queue_t* queue;
|
||||
hsa_queue_info_attribute_t attribute;
|
||||
void* value;
|
||||
} hsa_amd_queue_get_info;
|
||||
# endif
|
||||
#endif
|
||||
} rocprofiler_hsa_api_args_t;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Yeni konuda referans
Bir kullanıcı engelle