Additional 1.0.0 changes (#317)
* Additional 1.0.0 changes
- Update VERSION
- Add beta compatibility for rocprofiler_agent_set_profile_callback_t
* Fix location of deprecated typedef rocprofiler_agent_set_profile_callback_t
* rocprofiler_record_counter_t -> rocprofiler_counter_record_t
* Experimental + deprecated annotations
* rocprofiler_record_dimension_info_t -> rocprofiler_counter_record_dimension_info_t
---------
Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
[ROCm/rocprofiler-sdk commit: a1fcdf7f83]
This commit is contained in:
@@ -1 +1 @@
|
||||
0.7.0
|
||||
1.0.0
|
||||
|
||||
@@ -74,10 +74,11 @@ get_buffer()
|
||||
return buf;
|
||||
}
|
||||
|
||||
std::unordered_map<uint64_t, std::vector<rocprofiler_record_dimension_info_t>>**
|
||||
std::unordered_map<uint64_t, std::vector<rocprofiler_counter_record_dimension_info_t>>**
|
||||
dimension_cache()
|
||||
{
|
||||
static std::unordered_map<uint64_t, std::vector<rocprofiler_record_dimension_info_t>>* cache;
|
||||
static std::unordered_map<uint64_t, std::vector<rocprofiler_counter_record_dimension_info_t>>*
|
||||
cache;
|
||||
return &cache;
|
||||
}
|
||||
|
||||
@@ -85,7 +86,7 @@ dimension_cache()
|
||||
* For a given counter, query the dimensions that it has. Typically you will
|
||||
* want to call this function once to get the dimensions and cache them.
|
||||
*/
|
||||
std::vector<rocprofiler_record_dimension_info_t>
|
||||
std::vector<rocprofiler_counter_record_dimension_info_t>
|
||||
counter_dimensions(rocprofiler_counter_id_t counter)
|
||||
{
|
||||
if(*dimension_cache() == nullptr) return {};
|
||||
@@ -102,15 +103,15 @@ void
|
||||
fill_dimension_cache(rocprofiler_counter_id_t counter)
|
||||
{
|
||||
assert(*dimension_cache() != nullptr);
|
||||
std::vector<rocprofiler_record_dimension_info_t> dims;
|
||||
rocprofiler_counter_info_v1_t info;
|
||||
std::vector<rocprofiler_counter_record_dimension_info_t> dims;
|
||||
rocprofiler_counter_info_v1_t info;
|
||||
ROCPROFILER_CALL(rocprofiler_query_counter_info(
|
||||
counter, ROCPROFILER_COUNTER_INFO_VERSION_1, static_cast<void*>(&info)),
|
||||
"Could not query info for counter");
|
||||
|
||||
(*dimension_cache())
|
||||
->emplace(counter.handle,
|
||||
std::vector<rocprofiler_record_dimension_info_t>{
|
||||
std::vector<rocprofiler_counter_record_dimension_info_t>{
|
||||
info.dimensions, info.dimensions + info.dimensions_count});
|
||||
}
|
||||
|
||||
@@ -149,7 +150,7 @@ buffered_callback(rocprofiler_context_id_t,
|
||||
header->kind == ROCPROFILER_COUNTER_RECORD_VALUE)
|
||||
{
|
||||
// Print the returned counter data.
|
||||
auto* record = static_cast<rocprofiler_record_counter_t*>(header->payload);
|
||||
auto* record = static_cast<rocprofiler_counter_record_t*>(header->payload);
|
||||
rocprofiler_counter_id_t counter_id = {.handle = 0};
|
||||
|
||||
rocprofiler_query_record_counter_id(record->id, &counter_id);
|
||||
@@ -436,7 +437,8 @@ rocprofiler_configure(uint32_t version,
|
||||
static_cast<void*>(output_stream)};
|
||||
|
||||
*dimension_cache() =
|
||||
new std::unordered_map<uint64_t, std::vector<rocprofiler_record_dimension_info_t>>();
|
||||
new std::unordered_map<uint64_t,
|
||||
std::vector<rocprofiler_counter_record_dimension_info_t>>();
|
||||
|
||||
// return pointer to configure data
|
||||
return &cfg;
|
||||
|
||||
@@ -74,7 +74,7 @@ get_client_ctx()
|
||||
|
||||
void
|
||||
record_callback(rocprofiler_dispatch_counting_service_data_t dispatch_data,
|
||||
rocprofiler_record_counter_t* record_data,
|
||||
rocprofiler_counter_record_t* record_data,
|
||||
size_t record_count,
|
||||
rocprofiler_user_data_t /* user_data */,
|
||||
void* callback_data_args)
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ buffered_callback(rocprofiler_context_id_t,
|
||||
header->kind == ROCPROFILER_COUNTER_RECORD_VALUE)
|
||||
{
|
||||
// Print the returned counter data.
|
||||
auto* record = static_cast<rocprofiler_record_counter_t*>(header->payload);
|
||||
auto* record = static_cast<rocprofiler_counter_record_t*>(header->payload);
|
||||
ss << " (Id: " << record->id << " Value [D]: " << record->counter_value << ","
|
||||
<< " user_data: " << record->user_data.value << "),";
|
||||
|
||||
|
||||
+10
-10
@@ -75,16 +75,16 @@ public:
|
||||
counter_sampler(rocprofiler_agent_id_t agent);
|
||||
|
||||
// Decode the counter name of a record
|
||||
std::string decode_record_name(const rocprofiler_record_counter_t& rec) const;
|
||||
std::string decode_record_name(const rocprofiler_counter_record_t& rec) const;
|
||||
|
||||
// Get the dimensions of a record (what CU/SE/etc the counter is for). High cost operation
|
||||
// should be cached if possible.
|
||||
static std::unordered_map<std::string, size_t> get_record_dimensions(
|
||||
const rocprofiler_record_counter_t& rec);
|
||||
const rocprofiler_counter_record_t& rec);
|
||||
|
||||
// Sample the counter values for a set of counters, returns the records in the out parameter.
|
||||
rocprofiler_status_t sample_counter_values(const std::vector<std::string>& counters,
|
||||
std::vector<rocprofiler_record_counter_t>& out);
|
||||
std::vector<rocprofiler_counter_record_t>& out);
|
||||
|
||||
// Get the available agents on the system
|
||||
static std::vector<rocprofiler_agent_v0_t> get_available_agents();
|
||||
@@ -113,7 +113,7 @@ private:
|
||||
rocprofiler_agent_id_t agent);
|
||||
|
||||
// Get the dimensions of a counter
|
||||
static std::vector<rocprofiler_record_dimension_info_t> get_counter_dimensions(
|
||||
static std::vector<rocprofiler_counter_record_dimension_info_t> get_counter_dimensions(
|
||||
rocprofiler_counter_id_t counter);
|
||||
};
|
||||
|
||||
@@ -162,7 +162,7 @@ counter_sampler::counter_sampler(rocprofiler_agent_id_t agent)
|
||||
}
|
||||
|
||||
std::string
|
||||
counter_sampler::decode_record_name(const rocprofiler_record_counter_t& rec) const
|
||||
counter_sampler::decode_record_name(const rocprofiler_counter_record_t& rec) const
|
||||
{
|
||||
if(id_to_name_.empty())
|
||||
{
|
||||
@@ -184,7 +184,7 @@ counter_sampler::decode_record_name(const rocprofiler_record_counter_t& rec) con
|
||||
}
|
||||
|
||||
std::unordered_map<std::string, size_t>
|
||||
counter_sampler::get_record_dimensions(const rocprofiler_record_counter_t& rec)
|
||||
counter_sampler::get_record_dimensions(const rocprofiler_counter_record_t& rec)
|
||||
{
|
||||
std::unordered_map<std::string, size_t> out;
|
||||
rocprofiler_counter_id_t counter_id = {.handle = 0};
|
||||
@@ -202,7 +202,7 @@ counter_sampler::get_record_dimensions(const rocprofiler_record_counter_t& rec)
|
||||
|
||||
rocprofiler_status_t
|
||||
counter_sampler::sample_counter_values(const std::vector<std::string>& counters,
|
||||
std::vector<rocprofiler_record_counter_t>& out)
|
||||
std::vector<rocprofiler_counter_record_t>& out)
|
||||
{
|
||||
auto profile_cached = cached_profiles_.find(counters);
|
||||
if(profile_cached == cached_profiles_.end())
|
||||
@@ -330,14 +330,14 @@ counter_sampler::get_supported_counters(rocprofiler_agent_id_t agent)
|
||||
return out;
|
||||
}
|
||||
|
||||
std::vector<rocprofiler_record_dimension_info_t>
|
||||
std::vector<rocprofiler_counter_record_dimension_info_t>
|
||||
counter_sampler::get_counter_dimensions(rocprofiler_counter_id_t counter)
|
||||
{
|
||||
rocprofiler_counter_info_v1_t info;
|
||||
ROCPROFILER_CALL(rocprofiler_query_counter_info(
|
||||
counter, ROCPROFILER_COUNTER_INFO_VERSION_1, static_cast<void*>(&info)),
|
||||
"Could not query info for counter");
|
||||
return std::vector<rocprofiler_record_dimension_info_t>{
|
||||
return std::vector<rocprofiler_counter_record_dimension_info_t>{
|
||||
info.dimensions, info.dimensions + info.dimensions_count};
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ tool_init(rocprofiler_client_finalize_t fini_func, void*)
|
||||
|
||||
sampler_thread = new std::thread{[=]() {
|
||||
size_t count = 1;
|
||||
std::vector<rocprofiler_record_counter_t> records;
|
||||
std::vector<rocprofiler_counter_record_t> records;
|
||||
while(sampler && exit_toggle().load() == false)
|
||||
{
|
||||
auto status = sampler->sample_counter_values({"SQ_WAVES"}, records);
|
||||
|
||||
+10
-9
@@ -85,7 +85,7 @@ struct validate_dim_presence
|
||||
{
|
||||
validate_dim_presence() {}
|
||||
|
||||
void maybe_forward(const rocprofiler_record_dimension_info_t& dim)
|
||||
void maybe_forward(const rocprofiler_counter_record_dimension_info_t& dim)
|
||||
{
|
||||
if(sub_vectors.empty())
|
||||
{
|
||||
@@ -118,8 +118,9 @@ struct validate_dim_presence
|
||||
sub_vectors.at(pos)->mark_seen(id);
|
||||
}
|
||||
|
||||
bool check_seen(std::stringstream& out,
|
||||
std::vector<std::pair<rocprofiler_record_dimension_info_t, size_t>>& pos_stack)
|
||||
bool check_seen(
|
||||
std::stringstream& out,
|
||||
std::vector<std::pair<rocprofiler_counter_record_dimension_info_t, size_t>>& pos_stack)
|
||||
{
|
||||
bool ret = true;
|
||||
if(sub_vectors.empty())
|
||||
@@ -150,9 +151,9 @@ struct validate_dim_presence
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::pair<rocprofiler_record_dimension_info_t, size_t> vector_pos;
|
||||
std::vector<std::unique_ptr<validate_dim_presence>> sub_vectors;
|
||||
bool has_value{false};
|
||||
std::pair<rocprofiler_counter_record_dimension_info_t, size_t> vector_pos;
|
||||
std::vector<std::unique_ptr<validate_dim_presence>> sub_vectors;
|
||||
bool has_value{false};
|
||||
};
|
||||
|
||||
struct CaptureRecords
|
||||
@@ -197,7 +198,7 @@ buffered_callback(rocprofiler_context_id_t,
|
||||
// Record the counters we have in the buffer and the number of instances of
|
||||
// the counter we have seen.
|
||||
rocprofiler_counter_id_t counter;
|
||||
auto* record = static_cast<rocprofiler_record_counter_t*>(header->payload);
|
||||
auto* record = static_cast<rocprofiler_counter_record_t*>(header->payload);
|
||||
rocprofiler_query_record_counter_id(record->id, &counter);
|
||||
cap.expected_data_dims.at(counter.handle).mark_seen(record->id);
|
||||
seen_counters.emplace(counter.handle, 0).first->second++;
|
||||
@@ -406,8 +407,8 @@ tool_fini(void*)
|
||||
else
|
||||
{
|
||||
// Counter collected OK
|
||||
std::stringstream ss;
|
||||
std::vector<std::pair<rocprofiler_record_dimension_info_t, size_t>> stack;
|
||||
std::stringstream ss;
|
||||
std::vector<std::pair<rocprofiler_counter_record_dimension_info_t, size_t>> stack;
|
||||
bool passed = cap.expected_data_dims.at(counter_id).check_seen(ss, stack);
|
||||
if(!PRINT_ONLY_FAILING || !passed)
|
||||
{
|
||||
|
||||
+1
-1
@@ -228,7 +228,7 @@ Data from collected counter values is returned through a buffered callback. The
|
||||
header->kind == ROCPROFILER_COUNTER_RECORD_VALUE)
|
||||
{
|
||||
// Print the returned counter data.
|
||||
auto* record = static_cast<rocprofiler_record_counter_t*>(header->payload);
|
||||
auto* record = static_cast<rocprofiler_counter_record_t*>(header->payload);
|
||||
rocprofiler_counter_id_t counter_id = {.handle = 0};
|
||||
|
||||
rocprofiler_query_record_counter_id(record->id, &counter_id);
|
||||
|
||||
@@ -85,7 +85,7 @@ typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_counter_info_v1_t
|
||||
/**
|
||||
* @brief (experimental) Query counter id information from record_id.
|
||||
*
|
||||
* @param [in] id record id from rocprofiler_record_counter_t
|
||||
* @param [in] id record id from rocprofiler_counter_record_t
|
||||
* @param [out] counter_id counter id associated with the record
|
||||
* @return ::rocprofiler_status_t
|
||||
* @retval ROCPROFILER_STATUS_SUCCESS if id decoded
|
||||
@@ -99,7 +99,7 @@ rocprofiler_query_record_counter_id(rocprofiler_counter_instance_id_t id,
|
||||
* @brief (experimental) Query dimension position from record_id. If the dimension does not exist
|
||||
* in the counter, the return will be 0.
|
||||
*
|
||||
* @param [in] id record id from @ref rocprofiler_record_counter_t
|
||||
* @param [in] id record id from @ref rocprofiler_counter_record_t
|
||||
* @param [in] dim dimension for which positional info is requested (currently only
|
||||
* 0 is allowed, i.e. flat array without dimension).
|
||||
* @param [out] pos value of the dimension in id
|
||||
|
||||
@@ -560,7 +560,7 @@ save(ArchiveT& ar, rocprofiler_buffer_tracing_hsa_api_record_t data)
|
||||
|
||||
template <typename ArchiveT>
|
||||
void
|
||||
save(ArchiveT& ar, rocprofiler_record_counter_t data)
|
||||
save(ArchiveT& ar, rocprofiler_counter_record_t data)
|
||||
{
|
||||
ROCP_SDK_SAVE_DATA_FIELD(id);
|
||||
ROCP_SDK_SAVE_DATA_FIELD(counter_value);
|
||||
@@ -1261,7 +1261,7 @@ save(ArchiveT& ar, rocprofiler_counter_info_v1_t data)
|
||||
|
||||
template <typename ArchiveT>
|
||||
void
|
||||
save(ArchiveT& ar, rocprofiler_record_dimension_info_t data)
|
||||
save(ArchiveT& ar, rocprofiler_counter_record_dimension_info_t data)
|
||||
{
|
||||
ROCP_SDK_SAVE_DATA_FIELD(id);
|
||||
ROCP_SDK_SAVE_DATA_FIELD(instance_size);
|
||||
|
||||
@@ -41,10 +41,10 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
ROCPROFILER_SDK_DEPRECATED(
|
||||
"Function using this alias has been deprecated. See rocprofiler_iterate_counter_dimensions")
|
||||
typedef rocprofiler_status_t (*rocprofiler_available_dimensions_cb_t)(
|
||||
rocprofiler_counter_id_t id,
|
||||
const rocprofiler_record_dimension_info_t* dim_info,
|
||||
size_t num_dims,
|
||||
void* user_data);
|
||||
rocprofiler_counter_id_t id,
|
||||
const rocprofiler_counter_record_dimension_info_t* dim_info,
|
||||
size_t num_dims,
|
||||
void* user_data);
|
||||
|
||||
/**
|
||||
* @brief (deprecated) Return information about the dimensions that exists for a specific counter
|
||||
|
||||
+11
-1
@@ -132,9 +132,19 @@ rocprofiler_status_t
|
||||
rocprofiler_sample_device_counting_service(rocprofiler_context_id_t context_id,
|
||||
rocprofiler_user_data_t user_data,
|
||||
rocprofiler_counter_flag_t flags,
|
||||
rocprofiler_record_counter_t* output_records,
|
||||
rocprofiler_counter_record_t* output_records,
|
||||
size_t* rec_count) ROCPROFILER_API;
|
||||
|
||||
#if defined(ROCPROFILER_SDK_BETA_COMPAT) && ROCPROFILER_SDK_BETA_COMPAT > 0
|
||||
|
||||
// "rocprofiler_agent_set_profile_callback_t" renamed to
|
||||
// "rocprofiler_device_counting_agent_cb_t"
|
||||
ROCPROFILER_SDK_DEPRECATED(
|
||||
"rocprofiler_agent_set_profile_callback_t renamed to rocprofiler_device_counting_agent_cb_t")
|
||||
typedef rocprofiler_device_counting_agent_cb_t rocprofiler_agent_set_profile_callback_t;
|
||||
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
ROCPROFILER_EXTERN_C_FINI
|
||||
|
||||
+2
-2
@@ -58,7 +58,7 @@ typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_dispatch_counting_servic
|
||||
typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_dispatch_counting_service_record_t
|
||||
{
|
||||
uint64_t size; ///< Size of this struct
|
||||
uint64_t num_records; ///< number of ::rocprofiler_record_counter_t records
|
||||
uint64_t num_records; ///< number of ::rocprofiler_counter_record_t records
|
||||
rocprofiler_async_correlation_id_t correlation_id; ///< Correlation ID for this dispatch
|
||||
rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
|
||||
rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
|
||||
@@ -98,7 +98,7 @@ typedef void (*rocprofiler_dispatch_counting_service_cb_t)(
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
typedef void (*rocprofiler_dispatch_counting_record_cb_t)(
|
||||
rocprofiler_dispatch_counting_service_data_t dispatch_data,
|
||||
rocprofiler_record_counter_t* record_data,
|
||||
rocprofiler_counter_record_t* record_data,
|
||||
size_t record_count,
|
||||
rocprofiler_user_data_t user_data,
|
||||
void* callback_data_args);
|
||||
|
||||
@@ -806,9 +806,9 @@ typedef struct rocprofiler_kernel_dispatch_info_t
|
||||
} rocprofiler_kernel_dispatch_info_t;
|
||||
|
||||
/**
|
||||
* @brief Details for the dimension, including its size, for a counter record.
|
||||
* @brief (experimental) Details for the dimension, including its size, for a counter record.
|
||||
*/
|
||||
typedef struct rocprofiler_counter_record_dimension_info_t
|
||||
typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_counter_record_dimension_info_t
|
||||
{
|
||||
const char* name;
|
||||
size_t instance_size;
|
||||
@@ -818,12 +818,14 @@ typedef struct rocprofiler_counter_record_dimension_info_t
|
||||
/// @brief Id for this dimension used by ::rocprofiler_query_record_dimension_position
|
||||
} rocprofiler_counter_record_dimension_info_t;
|
||||
|
||||
ROCPROFILER_SDK_DEPRECATED("rocprofiler_counter_record_dimension_info_t was renamed to "
|
||||
"rocprofiler_counter_record_dimension_info_t")
|
||||
typedef rocprofiler_counter_record_dimension_info_t rocprofiler_record_dimension_info_t;
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler Profile Counting Counter Record per instance.
|
||||
* @brief (experimental) ROCProfiler Profile Counting Counter Record per instance.
|
||||
*/
|
||||
typedef struct rocprofiler_counter_record_t
|
||||
typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_counter_record_t
|
||||
{
|
||||
rocprofiler_counter_instance_id_t id; ///< counter identifier
|
||||
double counter_value; ///< counter value
|
||||
@@ -839,25 +841,13 @@ typedef struct rocprofiler_counter_record_t
|
||||
/// ::rocprofiler_kernel_dispatch_info_t) of a ::rocprofiler_dispatch_counting_service_data_t
|
||||
/// instance (provided during callback for profile config) or a
|
||||
/// ::rocprofiler_dispatch_counting_service_record_t records (which will be insert into the
|
||||
/// buffer prior to the associated ::rocprofiler_record_counter_t records).
|
||||
/// buffer prior to the associated ::rocprofiler_counter_record_t records).
|
||||
} rocprofiler_counter_record_t;
|
||||
|
||||
ROCPROFILER_SDK_DEPRECATED(
|
||||
"rocprofiler_record_counter_t was renamed to rocprofiler_counter_record_t")
|
||||
typedef rocprofiler_counter_record_t rocprofiler_record_counter_t;
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler SPM Record.
|
||||
*
|
||||
*/
|
||||
typedef struct rocprofiler_spm_record_t
|
||||
{
|
||||
/**
|
||||
* Counters, including identifiers to get counter information and Counters
|
||||
* values
|
||||
*/
|
||||
rocprofiler_record_counter_t* counters;
|
||||
uint64_t counters_count;
|
||||
} rocprofiler_spm_record_t;
|
||||
|
||||
#if defined(ROCPROFILER_SDK_BETA_COMPAT) && ROCPROFILER_SDK_BETA_COMPAT > 0
|
||||
|
||||
// "profile_config" renamed to "counter_config"
|
||||
|
||||
@@ -34,6 +34,20 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief (experimental) ROCProfiler SPM Record.
|
||||
*
|
||||
*/
|
||||
typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_spm_record_t
|
||||
{
|
||||
/**
|
||||
* Counters, including identifiers to get counter information and Counters
|
||||
* values
|
||||
*/
|
||||
rocprofiler_counter_record_t* counters;
|
||||
uint64_t counters_count;
|
||||
} rocprofiler_spm_record_t;
|
||||
|
||||
/**
|
||||
* @brief Configure SPM Service.
|
||||
*
|
||||
|
||||
@@ -197,7 +197,7 @@ as_pointer()
|
||||
using targeted_kernels_map_t =
|
||||
std::unordered_map<rocprofiler_kernel_id_t, std::unordered_set<size_t>>;
|
||||
using counter_dimension_info_map_t =
|
||||
std::unordered_map<uint64_t, std::vector<rocprofiler_record_dimension_info_t>>;
|
||||
std::unordered_map<uint64_t, std::vector<rocprofiler_counter_record_dimension_info_t>>;
|
||||
using agent_info_map_t = std::unordered_map<rocprofiler_agent_id_t, rocprofiler_agent_t>;
|
||||
using kernel_iteration_t = std::unordered_map<rocprofiler_kernel_id_t, size_t>;
|
||||
using kernel_rename_map_t = std::unordered_map<uint64_t, uint64_t>;
|
||||
@@ -1313,7 +1313,7 @@ dispatch_callback(rocprofiler_dispatch_counting_service_data_t dispatch_data,
|
||||
|
||||
void
|
||||
counter_record_callback(rocprofiler_dispatch_counting_service_data_t dispatch_data,
|
||||
rocprofiler_record_counter_t* record_data,
|
||||
rocprofiler_counter_record_t* record_data,
|
||||
size_t record_count,
|
||||
rocprofiler_user_data_t user_data,
|
||||
void* /*callback_data_args*/)
|
||||
@@ -2163,11 +2163,11 @@ tool_fini(void* /*tool_data*/)
|
||||
#endif
|
||||
}
|
||||
|
||||
std::vector<rocprofiler_record_dimension_info_t>
|
||||
std::vector<rocprofiler_counter_record_dimension_info_t>
|
||||
get_tool_counter_dimension_info()
|
||||
{
|
||||
auto _data = get_agent_counter_info();
|
||||
auto _ret = std::vector<rocprofiler_record_dimension_info_t>{};
|
||||
auto _ret = std::vector<rocprofiler_counter_record_dimension_info_t>{};
|
||||
for(const auto& itr : _data)
|
||||
{
|
||||
for(const auto& iitr : itr.second)
|
||||
@@ -2175,12 +2175,12 @@ get_tool_counter_dimension_info()
|
||||
_ret.emplace_back(ditr);
|
||||
}
|
||||
|
||||
auto _sorter = [](const rocprofiler_record_dimension_info_t& lhs,
|
||||
const rocprofiler_record_dimension_info_t& rhs) {
|
||||
auto _sorter = [](const rocprofiler_counter_record_dimension_info_t& lhs,
|
||||
const rocprofiler_counter_record_dimension_info_t& rhs) {
|
||||
return std::tie(lhs.id, lhs.instance_size) < std::tie(rhs.id, rhs.instance_size);
|
||||
};
|
||||
auto _equiv = [](const rocprofiler_record_dimension_info_t& lhs,
|
||||
const rocprofiler_record_dimension_info_t& rhs) {
|
||||
auto _equiv = [](const rocprofiler_counter_record_dimension_info_t& lhs,
|
||||
const rocprofiler_counter_record_dimension_info_t& rhs) {
|
||||
return std::tie(lhs.id, lhs.instance_size) == std::tie(rhs.id, rhs.instance_size);
|
||||
};
|
||||
|
||||
|
||||
@@ -287,7 +287,7 @@ rocprofiler_iterate_agent_supported_counters(rocprofiler_agent_id_t
|
||||
/**
|
||||
* @brief Query counter id information from record_id
|
||||
*
|
||||
* @param [in] id record id from rocprofiler_record_counter_t
|
||||
* @param [in] id record id from rocprofiler_counter_record_t
|
||||
* @param [out] counter_id counter id associated with the record
|
||||
* @return ::rocprofiler_status_t
|
||||
*/
|
||||
@@ -321,7 +321,8 @@ rocprofiler_iterate_counter_dimensions(rocprofiler_counter_id_t id,
|
||||
if(!dims) return ROCPROFILER_STATUS_ERROR_COUNTER_NOT_FOUND;
|
||||
|
||||
// This is likely faster than a map lookup given the limited number of dims.
|
||||
auto user_dims = common::container::small_vector<rocprofiler_record_dimension_info_t, 6>{};
|
||||
auto user_dims =
|
||||
common::container::small_vector<rocprofiler_counter_record_dimension_info_t, 6>{};
|
||||
for(const auto& internal_dim : *dims)
|
||||
{
|
||||
auto& dim = user_dims.emplace_back();
|
||||
|
||||
+2
-2
@@ -154,7 +154,7 @@ agent_async_handler(hsa_signal_value_t /*signal_v*/, void* data)
|
||||
// Write out the AQL data to the buffer
|
||||
for(auto& ast : prof_config->asts)
|
||||
{
|
||||
std::vector<std::unique_ptr<std::vector<rocprofiler_record_counter_t>>> cache;
|
||||
std::vector<std::unique_ptr<std::vector<rocprofiler_counter_record_t>>> cache;
|
||||
auto* ret = CHECK_NOTNULL(ast.evaluate(decoded_pkt, cache));
|
||||
ast.set_out_id(*ret);
|
||||
for(auto& val : *ret)
|
||||
@@ -266,7 +266,7 @@ rocprofiler_status_t
|
||||
read_agent_ctx(const context::context* ctx,
|
||||
rocprofiler_user_data_t user_data,
|
||||
rocprofiler_counter_flag_t flags,
|
||||
std::vector<rocprofiler_record_counter_t>* out_counters)
|
||||
std::vector<rocprofiler_counter_record_t>* out_counters)
|
||||
{
|
||||
rocprofiler_status_t status = ROCPROFILER_STATUS_SUCCESS;
|
||||
if(!ctx->device_counter_collection)
|
||||
|
||||
+2
-2
@@ -61,7 +61,7 @@ struct agent_callback_data
|
||||
rocprofiler_device_counting_service_cb_t cb = nullptr;
|
||||
rocprofiler_buffer_id_t buffer = {.handle = 0};
|
||||
bool set_profile = false;
|
||||
std::vector<rocprofiler_record_counter_t>* cached_counters = nullptr;
|
||||
std::vector<rocprofiler_counter_record_t>* cached_counters = nullptr;
|
||||
|
||||
agent_callback_data() = default;
|
||||
agent_callback_data(agent_callback_data&& rhs) noexcept
|
||||
@@ -120,7 +120,7 @@ rocprofiler_status_t
|
||||
read_agent_ctx(const context::context* ctx,
|
||||
rocprofiler_user_data_t user_data,
|
||||
rocprofiler_counter_flag_t flags,
|
||||
std::vector<rocprofiler_record_counter_t>* out_counters);
|
||||
std::vector<rocprofiler_counter_record_t>* out_counters);
|
||||
|
||||
uint64_t
|
||||
submitPacket(hsa_queue_t* queue, const void* packet);
|
||||
|
||||
@@ -64,8 +64,8 @@ get_reduce_op_type_from_string(const std::string& op)
|
||||
|
||||
void
|
||||
perform_reduction_to_single_instance(ReduceOperation reduce_op,
|
||||
std::vector<rocprofiler_record_counter_t>* input_array,
|
||||
rocprofiler_record_counter_t* result)
|
||||
std::vector<rocprofiler_counter_record_t>* input_array,
|
||||
rocprofiler_counter_record_t* result)
|
||||
{
|
||||
switch(reduce_op)
|
||||
{
|
||||
@@ -92,13 +92,13 @@ perform_reduction_to_single_instance(ReduceOperation
|
||||
*result = std::accumulate(
|
||||
input_array->begin(),
|
||||
input_array->end(),
|
||||
rocprofiler_record_counter_t{.id = input_array->begin()->id,
|
||||
rocprofiler_counter_record_t{.id = input_array->begin()->id,
|
||||
.counter_value = 0,
|
||||
.dispatch_id = input_array->begin()->dispatch_id,
|
||||
.user_data = input_array->begin()->user_data,
|
||||
.agent_id = input_array->begin()->agent_id},
|
||||
[](auto& a, auto& b) {
|
||||
return rocprofiler_record_counter_t{
|
||||
return rocprofiler_counter_record_t{
|
||||
.id = a.id,
|
||||
.counter_value = a.counter_value + b.counter_value,
|
||||
.dispatch_id = a.dispatch_id,
|
||||
@@ -114,17 +114,17 @@ perform_reduction_to_single_instance(ReduceOperation
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<rocprofiler_record_counter_t>*
|
||||
std::vector<rocprofiler_counter_record_t>*
|
||||
perform_reduction(
|
||||
ReduceOperation reduce_op,
|
||||
std::vector<rocprofiler_record_counter_t>* input_array,
|
||||
std::vector<rocprofiler_counter_record_t>* input_array,
|
||||
const std::unordered_set<rocprofiler_profile_counter_instance_types>& _reduce_dimension_set)
|
||||
{
|
||||
if(input_array->empty()) return input_array;
|
||||
if(_reduce_dimension_set.empty() ||
|
||||
_reduce_dimension_set.size() == ROCPROFILER_DIMENSION_LAST - 1)
|
||||
{
|
||||
rocprofiler_record_counter_t result{.id = 0,
|
||||
rocprofiler_counter_record_t result{.id = 0,
|
||||
.counter_value = 0,
|
||||
.dispatch_id = 0,
|
||||
.user_data = {.value = 0},
|
||||
@@ -136,7 +136,7 @@ perform_reduction(
|
||||
return input_array;
|
||||
}
|
||||
|
||||
std::unordered_map<int64_t, std::vector<rocprofiler_record_counter_t>> rec_groups;
|
||||
std::unordered_map<int64_t, std::vector<rocprofiler_counter_record_t>> rec_groups;
|
||||
size_t bit_length = DIM_BIT_LENGTH / ROCPROFILER_DIMENSION_LAST;
|
||||
|
||||
for(auto& rec : *input_array)
|
||||
@@ -154,7 +154,7 @@ perform_reduction(
|
||||
input_array->clear();
|
||||
for(auto& rec_pair : rec_groups)
|
||||
{
|
||||
rocprofiler_record_counter_t result{.id = 0,
|
||||
rocprofiler_counter_record_t result{.id = 0,
|
||||
.counter_value = 0,
|
||||
.dispatch_id = 0,
|
||||
.user_data = {.value = 0},
|
||||
@@ -208,9 +208,9 @@ get_int_encoded_dimensions_from_string(const std::string& rangeStr)
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<rocprofiler_record_counter_t>*
|
||||
std::vector<rocprofiler_counter_record_t>*
|
||||
perform_selection(std::map<rocprofiler_profile_counter_instance_types, std::string>& dimension_map,
|
||||
std::vector<rocprofiler_record_counter_t>* input_array)
|
||||
std::vector<rocprofiler_counter_record_t>* input_array)
|
||||
{
|
||||
if(input_array->empty()) return input_array;
|
||||
for(auto& dim_pair : dimension_map)
|
||||
@@ -221,7 +221,7 @@ perform_selection(std::map<rocprofiler_profile_counter_instance_types, std::stri
|
||||
|
||||
input_array->erase(std::remove_if(input_array->begin(),
|
||||
input_array->end(),
|
||||
[&](rocprofiler_record_counter_t& rec) {
|
||||
[&](rocprofiler_counter_record_t& rec) {
|
||||
bool should_remove =
|
||||
(encoded_dim_values &
|
||||
(1 << rocprofiler::counters::rec_to_dim_pos(
|
||||
@@ -692,7 +692,7 @@ void
|
||||
EvaluateAST::read_special_counters(
|
||||
const rocprofiler_agent_t& agent,
|
||||
const std::set<counters::Metric>& required_special_counters,
|
||||
std::unordered_map<uint64_t, std::vector<rocprofiler_record_counter_t>>& out_map)
|
||||
std::unordered_map<uint64_t, std::vector<rocprofiler_counter_record_t>>& out_map)
|
||||
{
|
||||
for(const auto& metric : required_special_counters)
|
||||
{
|
||||
@@ -705,19 +705,19 @@ EvaluateAST::read_special_counters(
|
||||
}
|
||||
}
|
||||
|
||||
std::unordered_map<uint64_t, std::vector<rocprofiler_record_counter_t>>
|
||||
std::unordered_map<uint64_t, std::vector<rocprofiler_counter_record_t>>
|
||||
EvaluateAST::read_pkt(const aql::CounterPacketConstruct* pkt_gen, hsa::AQLPacket& pkt)
|
||||
{
|
||||
struct it_data
|
||||
{
|
||||
std::unordered_map<uint64_t, std::vector<rocprofiler_record_counter_t>>* data;
|
||||
std::unordered_map<uint64_t, std::vector<rocprofiler_counter_record_t>>* data;
|
||||
const aql::CounterPacketConstruct* pkt_gen;
|
||||
aqlprofile_agent_handle_t agent;
|
||||
};
|
||||
|
||||
auto aql_agent = *CHECK_NOTNULL(rocprofiler::agent::get_aql_agent(pkt_gen->agent()));
|
||||
|
||||
std::unordered_map<uint64_t, std::vector<rocprofiler_record_counter_t>> ret;
|
||||
std::unordered_map<uint64_t, std::vector<rocprofiler_counter_record_t>> ret;
|
||||
if(pkt.empty) return ret;
|
||||
it_data aql_data{.data = &ret, .pkt_gen = pkt_gen, .agent = aql_agent};
|
||||
|
||||
@@ -730,7 +730,7 @@ EvaluateAST::read_pkt(const aql::CounterPacketConstruct* pkt_gen, hsa::AQLPacket
|
||||
|
||||
if(!metric) return HSA_STATUS_SUCCESS;
|
||||
|
||||
auto& vec = it.data->emplace(metric->id(), std::vector<rocprofiler_record_counter_t>{})
|
||||
auto& vec = it.data->emplace(metric->id(), std::vector<rocprofiler_counter_record_t>{})
|
||||
.first->second;
|
||||
auto& next_rec = vec.emplace_back();
|
||||
set_counter_in_rec(next_rec.id, {.handle = metric->id()});
|
||||
@@ -754,7 +754,7 @@ EvaluateAST::read_pkt(const aql::CounterPacketConstruct* pkt_gen, hsa::AQLPacket
|
||||
}
|
||||
|
||||
void
|
||||
EvaluateAST::set_out_id(std::vector<rocprofiler_record_counter_t>& results) const
|
||||
EvaluateAST::set_out_id(std::vector<rocprofiler_counter_record_t>& results) const
|
||||
{
|
||||
for(auto& record : results)
|
||||
{
|
||||
@@ -799,10 +799,10 @@ EvaluateAST::expand_derived(std::unordered_map<std::string, EvaluateAST>& asts)
|
||||
}
|
||||
|
||||
// convert to buffer at some point
|
||||
std::vector<rocprofiler_record_counter_t>*
|
||||
std::vector<rocprofiler_counter_record_t>*
|
||||
EvaluateAST::evaluate(
|
||||
std::unordered_map<uint64_t, std::vector<rocprofiler_record_counter_t>>& results_map,
|
||||
std::vector<std::unique_ptr<std::vector<rocprofiler_record_counter_t>>>& cache)
|
||||
std::unordered_map<uint64_t, std::vector<rocprofiler_counter_record_t>>& results_map,
|
||||
std::vector<std::unique_ptr<std::vector<rocprofiler_counter_record_t>>>& cache)
|
||||
{
|
||||
auto perform_op = [&](auto&& op) {
|
||||
auto* r1 = _children.at(0).evaluate(results_map, cache);
|
||||
@@ -842,13 +842,13 @@ EvaluateAST::evaluate(
|
||||
case RANGE_NODE: break;
|
||||
case NUMBER_NODE:
|
||||
{
|
||||
cache.emplace_back(std::make_unique<std::vector<rocprofiler_record_counter_t>>());
|
||||
cache.emplace_back(std::make_unique<std::vector<rocprofiler_counter_record_t>>());
|
||||
*cache.back() = _static_value;
|
||||
return cache.back().get();
|
||||
}
|
||||
case ADDITION_NODE:
|
||||
return perform_op([](auto& a, auto& b) {
|
||||
return rocprofiler_record_counter_t{
|
||||
return rocprofiler_counter_record_t{
|
||||
.id = a.id,
|
||||
.counter_value = a.counter_value + b.counter_value,
|
||||
.dispatch_id = a.dispatch_id,
|
||||
@@ -857,7 +857,7 @@ EvaluateAST::evaluate(
|
||||
});
|
||||
case SUBTRACTION_NODE:
|
||||
return perform_op([](auto& a, auto& b) {
|
||||
return rocprofiler_record_counter_t{
|
||||
return rocprofiler_counter_record_t{
|
||||
.id = a.id,
|
||||
.counter_value = a.counter_value - b.counter_value,
|
||||
.dispatch_id = a.dispatch_id,
|
||||
@@ -866,7 +866,7 @@ EvaluateAST::evaluate(
|
||||
});
|
||||
case MULTIPLY_NODE:
|
||||
return perform_op([](auto& a, auto& b) {
|
||||
return rocprofiler_record_counter_t{
|
||||
return rocprofiler_counter_record_t{
|
||||
.id = a.id,
|
||||
.counter_value = a.counter_value * b.counter_value,
|
||||
.dispatch_id = a.dispatch_id,
|
||||
@@ -875,7 +875,7 @@ EvaluateAST::evaluate(
|
||||
});
|
||||
case DIVIDE_NODE:
|
||||
return perform_op([](auto& a, auto& b) {
|
||||
return rocprofiler_record_counter_t{
|
||||
return rocprofiler_counter_record_t{
|
||||
.id = a.id,
|
||||
.counter_value = (b.counter_value == 0 ? 0 : a.counter_value / b.counter_value),
|
||||
.dispatch_id = a.dispatch_id,
|
||||
@@ -891,7 +891,7 @@ EvaluateAST::evaluate(
|
||||
throw std::runtime_error(
|
||||
fmt::format("Unable to lookup results for metric {}", _metric.name()));
|
||||
|
||||
cache.emplace_back(std::make_unique<std::vector<rocprofiler_record_counter_t>>());
|
||||
cache.emplace_back(std::make_unique<std::vector<rocprofiler_counter_record_t>>());
|
||||
*cache.back() = *result;
|
||||
result = cache.back().get();
|
||||
return result;
|
||||
|
||||
@@ -82,12 +82,12 @@ public:
|
||||
* computations. This is needed to avoid destroying data
|
||||
* in the result map that may be used by other evaluate calls.
|
||||
*
|
||||
* @return std::vector<rocprofiler_record_counter_t>* A pointer to the output records.
|
||||
* @return std::vector<rocprofiler_counter_record_t>* A pointer to the output records.
|
||||
* This pointer SHOULD NOT BE FREE'D/DELETED BY THE CALLER.
|
||||
*/
|
||||
std::vector<rocprofiler_record_counter_t>* evaluate(
|
||||
std::unordered_map<uint64_t, std::vector<rocprofiler_record_counter_t>>& results_map,
|
||||
std::vector<std::unique_ptr<std::vector<rocprofiler_record_counter_t>>>& cache);
|
||||
std::vector<rocprofiler_counter_record_t>* evaluate(
|
||||
std::unordered_map<uint64_t, std::vector<rocprofiler_counter_record_t>>& results_map,
|
||||
std::vector<std::unique_ptr<std::vector<rocprofiler_counter_record_t>>>& cache);
|
||||
|
||||
/**
|
||||
* @brief Expand derived counter ASTs contained within this AST to full hardware counter
|
||||
@@ -120,20 +120,20 @@ public:
|
||||
std::set<Metric>& counters) const;
|
||||
|
||||
/**
|
||||
* @brief Read the AQL packet and construct rocprofiler_record_counter_t. This call
|
||||
* @brief Read the AQL packet and construct rocprofiler_counter_record_t. This call
|
||||
* does not perform any evaluation, only dumping the packet contents into
|
||||
* rocprofiler_record_counter_t.
|
||||
* rocprofiler_counter_record_t.
|
||||
*
|
||||
* @param [in] pkt_gen packet generator used to generate the AQL packet. This packet
|
||||
* generator contains information, such as the ordering of instances
|
||||
* contained in the return packet, that is required to decode what
|
||||
* data goes with what base counters.
|
||||
* @param [in] pkt AQL packet structure to decode
|
||||
* @return std::unordered_map<uint64_t, std::vector<rocprofiler_record_counter_t>> map of
|
||||
* @return std::unordered_map<uint64_t, std::vector<rocprofiler_counter_record_t>> map of
|
||||
* {metric->id(), vector<records>}
|
||||
*
|
||||
*/
|
||||
static std::unordered_map<uint64_t, std::vector<rocprofiler_record_counter_t>> read_pkt(
|
||||
static std::unordered_map<uint64_t, std::vector<rocprofiler_counter_record_t>> read_pkt(
|
||||
const aql::CounterPacketConstruct* pkt_gen,
|
||||
hsa::AQLPacket& pkt);
|
||||
|
||||
@@ -148,7 +148,7 @@ public:
|
||||
static void read_special_counters(
|
||||
const rocprofiler_agent_t& agent,
|
||||
const std::set<counters::Metric>& required_special_counters,
|
||||
std::unordered_map<uint64_t, std::vector<rocprofiler_record_counter_t>>& out_map);
|
||||
std::unordered_map<uint64_t, std::vector<rocprofiler_counter_record_t>>& out_map);
|
||||
|
||||
NodeType type() const { return _type; }
|
||||
ReduceOperation reduce_op() const { return _reduce_op; }
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
*
|
||||
* @param [in] results computed results that will have their id modified to be counter _out_id
|
||||
*/
|
||||
void set_out_id(std::vector<rocprofiler_record_counter_t>& results) const;
|
||||
void set_out_id(std::vector<rocprofiler_counter_record_t>& results) const;
|
||||
|
||||
const rocprofiler_counter_id_t& out_id() const { return _out_id; }
|
||||
|
||||
@@ -174,7 +174,7 @@ private:
|
||||
std::vector<EvaluateAST> _children;
|
||||
std::string _agent;
|
||||
std::vector<MetricDimension> _dimension_types{};
|
||||
std::vector<rocprofiler_record_counter_t> _static_value;
|
||||
std::vector<rocprofiler_counter_record_t> _static_value;
|
||||
std::unordered_set<rocprofiler_profile_counter_instance_types> _reduce_dimension_set;
|
||||
std::map<rocprofiler_profile_counter_instance_types, std::string> _select_dimension_map;
|
||||
bool _expanded{false};
|
||||
@@ -214,7 +214,7 @@ get_agent_property(std::string_view property, const rocprofiler_agent_t& agent);
|
||||
namespace fmt
|
||||
{
|
||||
template <>
|
||||
struct formatter<rocprofiler_record_counter_t>
|
||||
struct formatter<rocprofiler_counter_record_t>
|
||||
{
|
||||
template <typename ParseContext>
|
||||
constexpr auto parse(ParseContext& ctx)
|
||||
@@ -223,7 +223,7 @@ struct formatter<rocprofiler_record_counter_t>
|
||||
}
|
||||
|
||||
template <typename Ctx>
|
||||
auto format(rocprofiler_record_counter_t const& data, Ctx& ctx) const
|
||||
auto format(rocprofiler_counter_record_t const& data, Ctx& ctx) const
|
||||
{
|
||||
return fmt::format_to(ctx.out(),
|
||||
"(CounterId: {}, Dimension: {:x}, Value [D]: {})",
|
||||
|
||||
+2
-2
@@ -68,7 +68,7 @@ proccess_completed_cb(completed_cb_params_t&& params)
|
||||
|
||||
prof_config->packets.wlock([&](auto& pkt_vector) { pkt_vector.emplace_back(std::move(pkt)); });
|
||||
|
||||
common::container::small_vector<rocprofiler_record_counter_t, 128> out;
|
||||
common::container::small_vector<rocprofiler_counter_record_t, 128> out;
|
||||
rocprofiler::buffer::instance* buf = nullptr;
|
||||
|
||||
if(info->buffer)
|
||||
@@ -92,7 +92,7 @@ proccess_completed_cb(completed_cb_params_t&& params)
|
||||
auto _dispatch_id = session.callback_record.dispatch_info.dispatch_id;
|
||||
for(auto& ast : prof_config->asts)
|
||||
{
|
||||
std::vector<std::unique_ptr<std::vector<rocprofiler_record_counter_t>>> cache;
|
||||
std::vector<std::unique_ptr<std::vector<rocprofiler_counter_record_t>>> cache;
|
||||
auto* ret = ast.evaluate(decoded_pkt, cache);
|
||||
CHECK(ret);
|
||||
ast.set_out_id(*ret);
|
||||
|
||||
@@ -51,7 +51,7 @@ rocprofiler_status_t
|
||||
rocprofiler_sample_device_counting_service(rocprofiler_context_id_t context_id,
|
||||
rocprofiler_user_data_t user_data,
|
||||
rocprofiler_counter_flag_t flags,
|
||||
rocprofiler_record_counter_t* output_records,
|
||||
rocprofiler_counter_record_t* output_records,
|
||||
size_t* rec_count)
|
||||
{
|
||||
if(context_id == rocprofiler_context_none) return ROCPROFILER_STATUS_ERROR_CONTEXT_NOT_FOUND;
|
||||
@@ -72,7 +72,7 @@ rocprofiler_sample_device_counting_service(rocprofiler_context_id_t context
|
||||
|
||||
if(*rec_count == 0) return ROCPROFILER_STATUS_ERROR_OUT_OF_RESOURCES;
|
||||
|
||||
auto recs = std::vector<rocprofiler_record_counter_t>{};
|
||||
auto recs = std::vector<rocprofiler_counter_record_t>{};
|
||||
auto status = rocprofiler::counters::read_agent_ctx(ctx, user_data, flags, &recs);
|
||||
if(status == ROCPROFILER_STATUS_SUCCESS)
|
||||
{
|
||||
@@ -83,7 +83,7 @@ rocprofiler_sample_device_counting_service(rocprofiler_context_id_t context
|
||||
}
|
||||
*rec_count = recs.size();
|
||||
std::memcpy(
|
||||
output_records, recs.data(), sizeof(rocprofiler_record_counter_t) * recs.size());
|
||||
output_records, recs.data(), sizeof(rocprofiler_counter_record_t) * recs.size());
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
+6
-6
@@ -180,12 +180,12 @@ pc_configuration_callback(const rocprofiler_pc_sampling_configuration_t* configs
|
||||
|
||||
rocprofiler_status_t
|
||||
dimensions_info_callback(rocprofiler_counter_id_t /*id*/,
|
||||
const rocprofiler_record_dimension_info_t* dim_info,
|
||||
long unsigned int num_dims,
|
||||
void* user_data)
|
||||
const rocprofiler_counter_record_dimension_info_t* dim_info,
|
||||
long unsigned int num_dims,
|
||||
void* user_data)
|
||||
{
|
||||
auto* dimensions_info =
|
||||
static_cast<std::vector<rocprofiler_record_dimension_info_t>*>(user_data);
|
||||
static_cast<std::vector<rocprofiler_counter_record_dimension_info_t>*>(user_data);
|
||||
dimensions_info->reserve(num_dims);
|
||||
for(size_t j = 0; j < num_dims; j++)
|
||||
dimensions_info->emplace_back(dim_info[j]);
|
||||
@@ -202,13 +202,13 @@ iterate_agent_counters_callback(rocprofiler_agent_id_t,
|
||||
for(size_t i = 0; i < num_counters; i++)
|
||||
{
|
||||
auto _info = rocprofiler_counter_info_v1_t{};
|
||||
auto dimensions_data = std::vector<rocprofiler_record_dimension_info_t>{};
|
||||
auto dimensions_data = std::vector<rocprofiler_counter_record_dimension_info_t>{};
|
||||
ROCPROFILER_CALL(
|
||||
rocprofiler_query_counter_info(
|
||||
counters[i], ROCPROFILER_COUNTER_INFO_VERSION_1, static_cast<void*>(&_info)),
|
||||
"Could not query counter_id");
|
||||
|
||||
dimensions_data = std::vector<rocprofiler_record_dimension_info_t>{
|
||||
dimensions_data = std::vector<rocprofiler_counter_record_dimension_info_t>{
|
||||
_info.dimensions, _info.dimensions + _info.dimensions_count};
|
||||
auto dimensions_info = std::vector<std::vector<std::string>>{};
|
||||
dimensions_info.reserve(dimensions_data.size());
|
||||
|
||||
مرجع در شماره جدید
Block a user