[SDK] Release 1.0 Public API Modifications (#277)
* Make sure all structs/enums can be forward declared
* Updates to counter collection
- consistency updates and cleanup
* Conversion of dimension information to info struct
* Added deprecated folder
* Testing changes
* merge changes
* Fix shadowed variable
* Source code formatting
* Fix shadowed variable
* Update rocprofiler_counter_info_v1_t member names
* Split version.h into version.h and ext_version.h
- ext_version.h contains external version info, e.g. ROCPROFILER_HSA_API_TABLE_MAJOR_VERSION, ROCPROFILER_HSA_RUNTIME_VERSION
- this reduces amount of recompilation after a commit since version.h gets updated with the git revision
* profile_config -> counter_config
* EOF new line
* [Samples] Reduce header includes + reorg counter collection samples
* Misc compilation fixes
- shadowed variables
- use of [[deprecated("...")]] in C code
- unused variables
* Minor misc modifications
- use common:: instead of rocprofiler::common:: when inside rocprofiler namespace
- counters.cpp
- move local anon namespace functions into rocprofiler::counters:: anon namespace
- use std::string_view for get_static_string
- const ref for get_static_ptr
- misc namespace shortening
* [Public API] rocprofiler_get_version_triplet + rocprofiler_version_triplet_t
- struct rocprofiler_version_triplet_t containing fields for the major, minor, and patch version
- public API function: rocprofiler_get_version_triplet
- define C++ operators for rocprofiler_version_triplet_t
- C++ function compute_version_triplet
* [Tests] Improve async-copy-testing test
- relax constraints
- improve logging
* Update counter_config.h doxygen docs
* ROCPROFILER_SDK_BETA_COMPAT
- ppdef which helps with renaming when set to 1
* Remove spurious include
* Fix includes for cxx/version.hpp
* Doxygen fixes for rocprofiler_get_version and rocprofiler_get_version_triplet
* Public API Experimental Designation
- ROCPROFILER_SDK_EXPERIMENTAL added to experimental function
- "(experimental)" added to doxygen @brief entries
* Fix use of assert instead of static_assert in hip/stream.cpp
* Use typedef instead of define for rocprofiler_profile_config_id_t
* Use inline rocprofiler_{create,destroy}_profile_config instead of ppdef
- added <rocprofiler-sdk/deprecated/profile_config.h>
* Doxygen for rocprofiler_{create,destroy}_profile_config
* ROCPROFILER_SDK_DEPRECATED_WARNINGS
* Temporarily comment out ROCPROFILER_SDK_DEPRECATED_WARNINGS=1
* cmake formatting
* Misc variable renaming in samples and tests
* Fix declarations of types
* Fix hip stream tracing service struct name
- rocprofiler_callback_tracing_stream_handle_data_t renamed to rocprofiler_callback_tracing_hip_stream_api_data_t
* Rename "HIP_STREAM_API" to "HIP_STREAM"
---------
Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
Co-authored-by: Benjamin Welton <bewelton@amd.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
cd4676ae6f
Коммит
4cd121e27b
@@ -6,18 +6,22 @@
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/version.h.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/version.h @ONLY)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/ext_version.h.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ext_version.h @ONLY)
|
||||
|
||||
set(ROCPROFILER_HEADER_FILES
|
||||
# core headers
|
||||
rocprofiler.h
|
||||
# secondary headers
|
||||
agent.h
|
||||
device_counting_service.h
|
||||
buffer.h
|
||||
buffer_tracing.h
|
||||
callback_tracing.h
|
||||
context.h
|
||||
counter_config.h
|
||||
counters.h
|
||||
defines.h
|
||||
device_counting_service.h
|
||||
dispatch_counting_service.h
|
||||
external_correlation.h
|
||||
fwd.h
|
||||
@@ -28,13 +32,13 @@ set(ROCPROFILER_HEADER_FILES
|
||||
marker.h
|
||||
ompt.h
|
||||
pc_sampling.h
|
||||
profile_config.h
|
||||
registration.h
|
||||
rccl.h
|
||||
registration.h
|
||||
rocdecode.h
|
||||
rocjpeg.h
|
||||
spm.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/version.h)
|
||||
${CMAKE_CURRENT_BINARY_DIR}/version.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ext_version.h)
|
||||
|
||||
install(
|
||||
FILES ${ROCPROFILER_HEADER_FILES}
|
||||
@@ -52,3 +56,4 @@ add_subdirectory(cxx)
|
||||
add_subdirectory(kfd)
|
||||
add_subdirectory(amd_detail)
|
||||
add_subdirectory(experimental)
|
||||
add_subdirectory(deprecated)
|
||||
|
||||
@@ -36,7 +36,7 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
typedef enum rocprofiler_att_parameter_type_t
|
||||
{
|
||||
ROCPROFILER_ATT_PARAMETER_TARGET_CU = 0, ///< Select the Target CU or WGP
|
||||
ROCPROFILER_ATT_PARAMETER_SHADER_ENGINE_MASK, ///< Bitmask of shader engines.
|
||||
@@ -48,7 +48,7 @@ typedef enum
|
||||
ROCPROFILER_ATT_PARAMETER_LAST
|
||||
} rocprofiler_att_parameter_type_t;
|
||||
|
||||
typedef struct
|
||||
typedef struct rocprofiler_att_parameter_t
|
||||
{
|
||||
rocprofiler_att_parameter_type_t type;
|
||||
union
|
||||
|
||||
@@ -37,7 +37,7 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
typedef enum rocprofiler_att_control_flags_t
|
||||
{
|
||||
ROCPROFILER_ATT_CONTROL_NONE = 0,
|
||||
ROCPROFILER_ATT_CONTROL_START_AND_STOP = 3
|
||||
|
||||
@@ -42,7 +42,7 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
/**
|
||||
* @brief ROCProfiler Buffer HSA API Tracer Record.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_buffer_tracing_hsa_api_record_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_buffer_tracing_kind_t kind;
|
||||
@@ -66,7 +66,7 @@ typedef struct
|
||||
/**
|
||||
* @brief ROCProfiler Buffer HIP API Tracer Record.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_buffer_tracing_hip_api_record_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_buffer_tracing_kind_t kind;
|
||||
@@ -87,7 +87,7 @@ typedef struct
|
||||
/**
|
||||
* @brief ROCProfiler Buffer HIP API Tracer Record.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_buffer_tracing_hip_api_ext_record_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_buffer_tracing_kind_t kind;
|
||||
@@ -167,7 +167,7 @@ typedef struct rocprofiler_buffer_tracing_ompt_record_t
|
||||
/**
|
||||
* @brief ROCProfiler Buffer Marker Tracer Record.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_buffer_tracing_marker_api_record_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_buffer_tracing_kind_t kind;
|
||||
@@ -190,7 +190,7 @@ typedef struct
|
||||
/**
|
||||
* @brief ROCProfiler Buffer RCCL API Record.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_buffer_tracing_rccl_api_record_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_buffer_tracing_kind_t kind;
|
||||
@@ -247,7 +247,7 @@ typedef struct rocprofiler_buffer_tracing_rocjpeg_api_record_t
|
||||
/**
|
||||
* @brief ROCProfiler Buffer Memory Copy Tracer Record.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_buffer_tracing_memory_copy_record_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_buffer_tracing_kind_t kind;
|
||||
@@ -272,7 +272,7 @@ typedef struct
|
||||
/**
|
||||
* @brief ROCProfiler Buffer Memory Allocation Tracer Record.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_buffer_tracing_memory_allocation_record_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_buffer_tracing_kind_t kind;
|
||||
@@ -328,7 +328,7 @@ typedef struct rocprofiler_buffer_tracing_page_migration_record_t
|
||||
/**
|
||||
* @brief ROCProfiler Buffer Scratch Memory Tracer Record
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_buffer_tracing_scratch_memory_record_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_buffer_tracing_kind_t kind; ///< ::ROCPROFILER_BUFFER_TRACING_SCRATCH_MEMORY
|
||||
@@ -345,7 +345,7 @@ typedef struct
|
||||
/**
|
||||
* @brief ROCProfiler Buffer Correlation ID Retirement Tracer Record.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_buffer_tracing_correlation_id_retirement_record_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_buffer_tracing_kind_t kind;
|
||||
|
||||
@@ -52,7 +52,7 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
* @brief ROCProfiler Enumeration for code object storage types (identical values to
|
||||
* `hsa_ven_amd_loader_code_object_storage_type_t` enumeration)
|
||||
*/
|
||||
typedef enum
|
||||
typedef enum rocprofiler_code_object_storage_type_t
|
||||
{
|
||||
ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_NONE = HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_NONE,
|
||||
ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_FILE = HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_FILE,
|
||||
@@ -64,7 +64,7 @@ typedef enum
|
||||
/**
|
||||
* @brief ROCProfiler HSA API Callback Data.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_callback_tracing_hsa_api_data_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_hsa_api_args_t args;
|
||||
@@ -74,7 +74,7 @@ typedef struct
|
||||
/**
|
||||
* @brief ROCProfiler HIP runtime and compiler API Tracer Callback Data.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_callback_tracing_hip_api_data_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_hip_api_args_t args;
|
||||
@@ -89,7 +89,7 @@ typedef struct
|
||||
/**
|
||||
* @brief ROCProfiler OMPT Callback Data
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_callback_tracing_ompt_data_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_ompt_args_t args;
|
||||
@@ -98,7 +98,7 @@ typedef struct
|
||||
/**
|
||||
* @brief ROCProfiler Marker Tracer Callback Data.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_callback_tracing_marker_api_data_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_marker_api_args_t args;
|
||||
@@ -108,7 +108,7 @@ typedef struct
|
||||
/**
|
||||
* @brief ROCProfiler RCCL API Callback Data.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_callback_tracing_rccl_api_data_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_rccl_api_args_t args;
|
||||
@@ -138,7 +138,7 @@ typedef struct rocprofiler_callback_tracing_rocjpeg_api_data_t
|
||||
/**
|
||||
* @brief ROCProfiler Code Object Load Tracer Callback Record.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_callback_tracing_code_object_load_data_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
uint64_t code_object_id; ///< unique code object identifier
|
||||
@@ -245,7 +245,7 @@ typedef struct rocprofiler_callback_tracing_code_object_kernel_symbol_register_d
|
||||
} rocprofiler_callback_tracing_code_object_kernel_symbol_register_data_t;
|
||||
// rename struct
|
||||
|
||||
typedef struct
|
||||
typedef struct rocprofiler_callback_tracing_code_object_host_kernel_symbol_register_data_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
uint64_t host_function_id; ///< unique host function identifier value
|
||||
@@ -283,7 +283,7 @@ typedef struct rocprofiler_callback_tracing_kernel_dispatch_data_t
|
||||
* The timestamps in this record will only be non-zero in the ::ROCPROFILER_CALLBACK_PHASE_EXIT
|
||||
* callback
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_callback_tracing_memory_copy_data_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
|
||||
@@ -298,7 +298,7 @@ typedef struct
|
||||
/**
|
||||
* @brief ROCProfiler Memory Allocation Tracer Record.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_callback_tracing_memory_allocation_data_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
|
||||
@@ -339,11 +339,11 @@ typedef struct rocprofiler_callback_tracing_runtime_initialization_data_t
|
||||
/**
|
||||
* @brief ROCProfiler Stream Handle Callback Data.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_callback_tracing_hip_stream_data_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_stream_id_t stream_id; ///< HIP stream ID
|
||||
} rocprofiler_callback_tracing_stream_handle_data_t;
|
||||
} rocprofiler_callback_tracing_hip_stream_data_t;
|
||||
|
||||
/**
|
||||
* @brief API Tracing callback function. This function is invoked twice per API function: once
|
||||
|
||||
+20
-18
@@ -29,51 +29,53 @@
|
||||
ROCPROFILER_EXTERN_C_INIT
|
||||
|
||||
/**
|
||||
* @defgroup PROFILE_CONFIG Profile Configurations
|
||||
* @defgroup COUNTER_CONFIG HW Counter Configurations
|
||||
* @brief Group one or more hardware counters into a unique handle
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Create Profile Configuration. A profile is bound to an agent but can
|
||||
* be used across many contexts. The profile has a fixed set of counters
|
||||
* @brief (experimental) Create Counter Configuration. A config is bound to an agent but can
|
||||
* be used across many contexts. The config has a fixed set of counters
|
||||
* that are collected (and specified by counter_list). The available
|
||||
* counters for an agent can be queried using
|
||||
* @ref rocprofiler_iterate_agent_supported_counters. An existing profile
|
||||
* may be supplied via config_id to use as a base for the new profile.
|
||||
* All counters in the existing profile will be copied over to the new
|
||||
* profile. The existing profile will remain unmodified and usable with
|
||||
* the new profile id being returned in config_id.
|
||||
* @ref rocprofiler_iterate_agent_supported_counters. An existing config
|
||||
* may be supplied via config_id to use as a base for the new config.
|
||||
* All counters in the existing config will be copied over to the new
|
||||
* config. The existing config will remain unmodified and usable with
|
||||
* the new config id being returned in config_id.
|
||||
*
|
||||
* @param [in] agent_id Agent identifier
|
||||
* @param [in] counters_list List of GPU counters
|
||||
* @param [in] counters_count Size of counters list
|
||||
* @param [in,out] config_id Identifier for GPU counters group. If an existing
|
||||
profile is supplied, that profiles counters will be copied
|
||||
over to a new profile (returned via this id)
|
||||
config is supplied, that profiles counters will be copied
|
||||
over to a new config (returned via this id)
|
||||
* @return ::rocprofiler_status_t
|
||||
* @retval ROCPROFILER_STATUS_SUCCESS if profile created
|
||||
* @retval ROCPROFILER_STATUS_ERROR if profile could not be created
|
||||
* @retval ROCPROFILER_STATUS_SUCCESS if config created
|
||||
* @retval ROCPROFILER_STATUS_ERROR if config could not be created
|
||||
*
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
rocprofiler_status_t
|
||||
rocprofiler_create_profile_config(rocprofiler_agent_id_t agent_id,
|
||||
rocprofiler_create_counter_config(rocprofiler_agent_id_t agent_id,
|
||||
rocprofiler_counter_id_t* counters_list,
|
||||
size_t counters_count,
|
||||
rocprofiler_profile_config_id_t* config_id) ROCPROFILER_API
|
||||
rocprofiler_counter_config_id_t* config_id) ROCPROFILER_API
|
||||
ROCPROFILER_NONNULL(4);
|
||||
|
||||
/**
|
||||
* @brief Destroy Profile Configuration.
|
||||
* @brief (experimental) Destroy Profile Configuration.
|
||||
*
|
||||
* @param [in] config_id
|
||||
* @return ::rocprofiler_status_t
|
||||
* @retval ROCPROFILER_STATUS_SUCCESS if profile destroyed
|
||||
* @retval ROCPROFILER_STATUS_ERROR if profile could not be destroyed
|
||||
* @retval ROCPROFILER_STATUS_SUCCESS if config destroyed
|
||||
* @retval ROCPROFILER_STATUS_ERROR if config could not be destroyed
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
rocprofiler_status_t
|
||||
rocprofiler_destroy_profile_config(rocprofiler_profile_config_id_t config_id) ROCPROFILER_API;
|
||||
rocprofiler_destroy_counter_config(rocprofiler_counter_config_id_t config_id) ROCPROFILER_API;
|
||||
|
||||
/** @} */
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#include <rocprofiler-sdk/defines.h>
|
||||
#include <rocprofiler-sdk/fwd.h>
|
||||
|
||||
#include <rocprofiler-sdk/deprecated/counters.h>
|
||||
|
||||
ROCPROFILER_EXTERN_C_INIT
|
||||
|
||||
/**
|
||||
@@ -35,20 +37,66 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Query counter id information from record_id.
|
||||
* @brief (experimental) Counter info struct version 0
|
||||
*/
|
||||
typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_counter_info_v0_t
|
||||
{
|
||||
rocprofiler_counter_id_t id; ///< Id of this counter
|
||||
const char* name; ///< Name of the counter
|
||||
const char* description; ///< Description of the counter
|
||||
const char* block; ///< Block of the counter (non-derived only)
|
||||
const char* expression; ///< Counter expression (derived counters only)
|
||||
uint8_t is_constant : 1; ///< If this counter is HW constant
|
||||
uint8_t is_derived : 1; ///< If this counter is a derived counter
|
||||
} rocprofiler_counter_info_v0_t;
|
||||
|
||||
/**
|
||||
* @brief (experimental) Counter info struct version 1. Combines information from
|
||||
* ::rocprofiler_counter_info_v0_t with the dimension information.
|
||||
*/
|
||||
typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_counter_info_v1_t
|
||||
{
|
||||
rocprofiler_counter_id_t id; ///< Id of this counter
|
||||
const char* name; ///< Name of the counter
|
||||
const char* description; ///< Description of the counter
|
||||
const char* block; ///< Block of the counter (non-derived only)
|
||||
const char* expression; ///< Counter expression (derived counters only)
|
||||
uint8_t is_constant : 1; ///< If this counter is HW constant
|
||||
uint8_t is_derived : 1; ///< If this counter is a derived counter
|
||||
|
||||
uint64_t dimensions_count;
|
||||
const rocprofiler_counter_record_dimension_info_t* dimensions;
|
||||
uint64_t instance_ids_count;
|
||||
const rocprofiler_counter_instance_id_t* instance_ids;
|
||||
|
||||
/// @var dimensions_count
|
||||
/// @brief Number of dimensions for the counter
|
||||
///
|
||||
/// @var dimensions
|
||||
/// @brief Dimension information of the counter
|
||||
///
|
||||
/// @var instance_ids_count
|
||||
/// @brief Number of instance ids for the counter
|
||||
///
|
||||
/// @var instance_ids
|
||||
/// @brief Instance ids that can be generated by the counter
|
||||
} 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 [out] counter_id counter id associated with the record
|
||||
* @return ::rocprofiler_status_t
|
||||
* @retval ROCPROFILER_STATUS_SUCCESS if id decoded
|
||||
*/
|
||||
rocprofiler_status_t
|
||||
ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_status_t
|
||||
rocprofiler_query_record_counter_id(rocprofiler_counter_instance_id_t id,
|
||||
rocprofiler_counter_id_t* counter_id) ROCPROFILER_API
|
||||
ROCPROFILER_NONNULL(2);
|
||||
|
||||
/**
|
||||
* @brief Query dimension position from record_id. If the dimension does not exist
|
||||
* @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
|
||||
@@ -58,46 +106,13 @@ rocprofiler_query_record_counter_id(rocprofiler_counter_instance_id_t id,
|
||||
* @return ::rocprofiler_status_t
|
||||
* @retval ROCPROFILER_STATUS_SUCCESS if dimension decoded
|
||||
*/
|
||||
rocprofiler_status_t
|
||||
ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_status_t
|
||||
rocprofiler_query_record_dimension_position(rocprofiler_counter_instance_id_t id,
|
||||
rocprofiler_counter_dimension_id_t dim,
|
||||
size_t* pos) ROCPROFILER_API ROCPROFILER_NONNULL(3);
|
||||
|
||||
/**
|
||||
* @brief Callback that gives a list of available dimensions for a counter
|
||||
*
|
||||
* @param [in] id Counter id the dimension data is for
|
||||
* @param [in] dim_info An array of dimensions for the counter
|
||||
* @ref rocprofiler_iterate_counter_dimensions was called on.
|
||||
* @param [in] num_dims Number of dimensions
|
||||
* @param [in] user_data User data supplied by
|
||||
* @ref rocprofiler_iterate_agent_supported_counters
|
||||
*/
|
||||
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);
|
||||
|
||||
/**
|
||||
* @brief Return information about the dimensions that exists for a specific counter
|
||||
* and the extent of each dimension.
|
||||
*
|
||||
* @param [in] id counter id to query dimension info for.
|
||||
* @param [in] info_cb Callback to return dimension information for counter
|
||||
* @param [in] user_data data to pass into the callback
|
||||
* @return ::rocprofiler_status_t
|
||||
* @retval ROCPROFILER_STATUS_SUCCESS if dimension exists
|
||||
* @retval ROCPROFILER_STATUS_ERROR_COUNTER_NOT_FOUND if counter is not found
|
||||
* @retval ROCPROFILER_STATUS_ERROR_DIM_NOT_FOUND if counter does not have this dimension
|
||||
*/
|
||||
rocprofiler_status_t
|
||||
rocprofiler_iterate_counter_dimensions(rocprofiler_counter_id_t id,
|
||||
rocprofiler_available_dimensions_cb_t info_cb,
|
||||
void* user_data) ROCPROFILER_API;
|
||||
|
||||
/**
|
||||
* @brief Query Counter info such as name or description.
|
||||
* @brief (experimental) Query Counter info such as name or description.
|
||||
*
|
||||
* @param [in] counter_id counter to get info for
|
||||
* @param [in] version Version of struct in info, see @ref rocprofiler_counter_info_version_id_t for
|
||||
@@ -108,29 +123,13 @@ rocprofiler_iterate_counter_dimensions(rocprofiler_counter_id_t id,
|
||||
* @retval ROCPROFILER_STATUS_ERROR_COUNTER_NOT_FOUND if counter not found
|
||||
* @retval ROCPROFILER_STATUS_ERROR_INCOMPATIBLE_ABI Version is not supported
|
||||
*/
|
||||
rocprofiler_status_t
|
||||
ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_status_t
|
||||
rocprofiler_query_counter_info(rocprofiler_counter_id_t counter_id,
|
||||
rocprofiler_counter_info_version_id_t version,
|
||||
void* info) ROCPROFILER_API ROCPROFILER_NONNULL(3);
|
||||
|
||||
/**
|
||||
* @brief This call returns the number of instances specific counter contains.
|
||||
*
|
||||
* @param [in] agent_id rocprofiler agent identifier
|
||||
* @param [in] counter_id counter id (obtained from iterate_agent_supported_counters)
|
||||
* @param [out] instance_count number of instances the counter has
|
||||
* @return ::rocprofiler_status_t
|
||||
* @retval ROCPROFILER_STATUS_SUCCESS if counter found
|
||||
* @retval ROCPROFILER_STATUS_ERROR_COUNTER_NOT_FOUND if counter not found
|
||||
*/
|
||||
rocprofiler_status_t
|
||||
rocprofiler_query_counter_instance_count(rocprofiler_agent_id_t agent_id,
|
||||
rocprofiler_counter_id_t counter_id,
|
||||
size_t* instance_count) ROCPROFILER_API
|
||||
ROCPROFILER_NONNULL(3);
|
||||
|
||||
/**
|
||||
* @brief Callback that gives a list of counters available on an agent. The
|
||||
* @brief (experimental) Callback that gives a list of counters available on an agent. The
|
||||
* counters variable is owned by rocprofiler and should not be free'd.
|
||||
*
|
||||
* @param [in] agent_id Agent ID of the current callback
|
||||
@@ -140,14 +139,14 @@ rocprofiler_query_counter_instance_count(rocprofiler_agent_id_t agent_id,
|
||||
* @param [in] user_data User data supplied by
|
||||
* @ref rocprofiler_iterate_agent_supported_counters
|
||||
*/
|
||||
typedef rocprofiler_status_t (*rocprofiler_available_counters_cb_t)(
|
||||
ROCPROFILER_SDK_EXPERIMENTAL typedef rocprofiler_status_t (*rocprofiler_available_counters_cb_t)(
|
||||
rocprofiler_agent_id_t agent_id,
|
||||
rocprofiler_counter_id_t* counters,
|
||||
size_t num_counters,
|
||||
void* user_data);
|
||||
|
||||
/**
|
||||
* @brief Query Agent Counters Availability.
|
||||
* @brief (experimental) Query Agent Counters Availability.
|
||||
*
|
||||
* @param [in] agent_id GPU agent identifier
|
||||
* @param [in] cb callback to caller to get counters
|
||||
@@ -156,20 +155,17 @@ typedef rocprofiler_status_t (*rocprofiler_available_counters_cb_t)(
|
||||
* @retval ROCPROFILER_STATUS_SUCCESS if counters found for agent
|
||||
* @retval ROCPROFILER_STATUS_ERROR if no counters found for agent
|
||||
*/
|
||||
rocprofiler_status_t
|
||||
ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_status_t
|
||||
rocprofiler_iterate_agent_supported_counters(rocprofiler_agent_id_t agent_id,
|
||||
rocprofiler_available_counters_cb_t cb,
|
||||
void* user_data) ROCPROFILER_API
|
||||
ROCPROFILER_NONNULL(2);
|
||||
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Creates a new counter based on a derived metric provided. The counter will only
|
||||
* be available for counter collection profiles created after the addition of this counter.
|
||||
* Due to the regeneration of internal ASTs and dimension cache, this call may be slow and
|
||||
* should generally be avoided in performance sensitive code blocks (i.e. dispatch
|
||||
* callbacks).
|
||||
* @brief (experimental) Creates a new counter based on a derived metric provided. The counter will
|
||||
* only be available for counter collection profiles created after the addition of this counter. Due
|
||||
* to the regeneration of internal ASTs and dimension cache, this call may be slow and should
|
||||
* generally be avoided in performance sensitive code blocks (i.e. dispatch callbacks).
|
||||
*
|
||||
* @param [in] name The name of the new counter.
|
||||
* @param [in] name_len The length of the counter name.
|
||||
@@ -186,7 +182,7 @@ rocprofiler_iterate_agent_supported_counters(rocprofiler_agent_id_t
|
||||
* @retval ROCPROFILER_STATUS_ERROR_INVALID_ARGUMENT if a counter argument is incorrect
|
||||
* @retval ROCPROFILER_STATUS_ERROR_AGENT_NOT_FOUND if the agent is not found
|
||||
*/
|
||||
rocprofiler_status_t
|
||||
ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_status_t
|
||||
rocprofiler_create_counter(const char* name,
|
||||
size_t name_len,
|
||||
const char* expr,
|
||||
@@ -196,4 +192,6 @@ rocprofiler_create_counter(const char* name,
|
||||
rocprofiler_agent_id_t agent,
|
||||
rocprofiler_counter_id_t* counter_id) ROCPROFILER_NONNULL(1, 3, 8);
|
||||
|
||||
/** @} */
|
||||
|
||||
ROCPROFILER_EXTERN_C_FINI
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
#
|
||||
set(ROCPROFILER_CXX_HEADER_FILES hash.hpp name_info.hpp operators.hpp perfetto.hpp
|
||||
utility.hpp serialization.hpp)
|
||||
utility.hpp serialization.hpp version.hpp)
|
||||
|
||||
install(
|
||||
FILES ${ROCPROFILER_CXX_HEADER_FILES}
|
||||
|
||||
@@ -63,7 +63,7 @@ ROCPROFILER_CXX_SPECIALIZE_HANDLE_HASHER(rocprofiler_queue_id_t)
|
||||
ROCPROFILER_CXX_SPECIALIZE_HANDLE_HASHER(rocprofiler_stream_id_t)
|
||||
ROCPROFILER_CXX_SPECIALIZE_HANDLE_HASHER(rocprofiler_buffer_id_t)
|
||||
ROCPROFILER_CXX_SPECIALIZE_HANDLE_HASHER(rocprofiler_counter_id_t)
|
||||
ROCPROFILER_CXX_SPECIALIZE_HANDLE_HASHER(rocprofiler_profile_config_id_t)
|
||||
ROCPROFILER_CXX_SPECIALIZE_HANDLE_HASHER(rocprofiler_counter_config_id_t)
|
||||
ROCPROFILER_CXX_SPECIALIZE_HANDLE_HASHER(rocprofiler_callback_thread_t)
|
||||
ROCPROFILER_CXX_SPECIALIZE_HANDLE_HASHER(hsa_agent_t)
|
||||
ROCPROFILER_CXX_SPECIALIZE_HANDLE_HASHER(hsa_signal_t)
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <rocprofiler-sdk/fwd.h>
|
||||
#include <rocprofiler-sdk/hsa.h>
|
||||
#include <rocprofiler-sdk/internal_threading.h>
|
||||
#include <rocprofiler-sdk/rocprofiler.h>
|
||||
|
||||
#include <tuple>
|
||||
|
||||
@@ -100,7 +101,7 @@ ROCPROFILER_CXX_DECLARE_OPERATORS(rocprofiler_queue_id_t)
|
||||
ROCPROFILER_CXX_DECLARE_OPERATORS(rocprofiler_stream_id_t)
|
||||
ROCPROFILER_CXX_DECLARE_OPERATORS(rocprofiler_buffer_id_t)
|
||||
ROCPROFILER_CXX_DECLARE_OPERATORS(rocprofiler_counter_id_t)
|
||||
ROCPROFILER_CXX_DECLARE_OPERATORS(rocprofiler_profile_config_id_t)
|
||||
ROCPROFILER_CXX_DECLARE_OPERATORS(rocprofiler_counter_config_id_t)
|
||||
ROCPROFILER_CXX_DECLARE_OPERATORS(rocprofiler_callback_thread_t)
|
||||
ROCPROFILER_CXX_DECLARE_OPERATORS(hsa_agent_t)
|
||||
ROCPROFILER_CXX_DECLARE_OPERATORS(hsa_signal_t)
|
||||
@@ -109,6 +110,8 @@ ROCPROFILER_CXX_DECLARE_OPERATORS(const rocprofiler_agent_v0_t&)
|
||||
ROCPROFILER_CXX_DECLARE_OPERATORS(rocprofiler_dim3_t)
|
||||
ROCPROFILER_CXX_DECLARE_OPERATORS(hsa_region_t)
|
||||
ROCPROFILER_CXX_DECLARE_OPERATORS(hsa_amd_memory_pool_t)
|
||||
ROCPROFILER_CXX_DECLARE_OPERATORS(const rocprofiler_counter_record_dimension_info_t&)
|
||||
ROCPROFILER_CXX_DECLARE_OPERATORS(rocprofiler_version_triplet_t)
|
||||
|
||||
// definitions of operator==
|
||||
ROCPROFILER_CXX_DEFINE_EQ_HANDLE_OPERATOR(rocprofiler_context_id_t)
|
||||
@@ -118,7 +121,7 @@ ROCPROFILER_CXX_DEFINE_EQ_HANDLE_OPERATOR(rocprofiler_queue_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_EQ_HANDLE_OPERATOR(rocprofiler_stream_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_EQ_HANDLE_OPERATOR(rocprofiler_buffer_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_EQ_HANDLE_OPERATOR(rocprofiler_counter_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_EQ_HANDLE_OPERATOR(rocprofiler_profile_config_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_EQ_HANDLE_OPERATOR(rocprofiler_counter_config_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_EQ_HANDLE_OPERATOR(rocprofiler_callback_thread_t)
|
||||
ROCPROFILER_CXX_DEFINE_EQ_HANDLE_OPERATOR(hsa_agent_t)
|
||||
ROCPROFILER_CXX_DEFINE_EQ_HANDLE_OPERATOR(hsa_signal_t)
|
||||
@@ -138,6 +141,20 @@ operator==(rocprofiler_dim3_t lhs, rocprofiler_dim3_t rhs)
|
||||
return std::tie(lhs.x, lhs.y, lhs.z) == std::tie(rhs.x, rhs.y, rhs.z);
|
||||
}
|
||||
|
||||
inline bool
|
||||
operator==(rocprofiler_counter_record_dimension_info_t lhs,
|
||||
rocprofiler_counter_record_dimension_info_t rhs)
|
||||
{
|
||||
return std::tie(lhs.id, lhs.instance_size, lhs.name) ==
|
||||
std::tie(rhs.id, rhs.instance_size, rhs.name);
|
||||
}
|
||||
|
||||
inline bool
|
||||
operator==(rocprofiler_version_triplet_t lhs, rocprofiler_version_triplet_t rhs)
|
||||
{
|
||||
return std::tie(lhs.major, lhs.minor, lhs.patch) == std::tie(rhs.major, rhs.minor, rhs.patch);
|
||||
}
|
||||
|
||||
// definitions of operator!=
|
||||
ROCPROFILER_CXX_DEFINE_NE_OPERATOR(rocprofiler_context_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_NE_OPERATOR(rocprofiler_address_t)
|
||||
@@ -146,7 +163,7 @@ ROCPROFILER_CXX_DEFINE_NE_OPERATOR(rocprofiler_queue_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_NE_OPERATOR(rocprofiler_stream_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_NE_OPERATOR(rocprofiler_buffer_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_NE_OPERATOR(rocprofiler_counter_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_NE_OPERATOR(rocprofiler_profile_config_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_NE_OPERATOR(rocprofiler_counter_config_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_NE_OPERATOR(rocprofiler_callback_thread_t)
|
||||
ROCPROFILER_CXX_DEFINE_NE_OPERATOR(hsa_agent_t)
|
||||
ROCPROFILER_CXX_DEFINE_NE_OPERATOR(hsa_signal_t)
|
||||
@@ -155,6 +172,7 @@ ROCPROFILER_CXX_DEFINE_NE_OPERATOR(const rocprofiler_agent_v0_t&)
|
||||
ROCPROFILER_CXX_DEFINE_NE_OPERATOR(rocprofiler_dim3_t)
|
||||
ROCPROFILER_CXX_DEFINE_NE_OPERATOR(hsa_region_t)
|
||||
ROCPROFILER_CXX_DEFINE_NE_OPERATOR(hsa_amd_memory_pool_t)
|
||||
ROCPROFILER_CXX_DEFINE_NE_OPERATOR(rocprofiler_version_triplet_t)
|
||||
|
||||
// definitions of operator<
|
||||
ROCPROFILER_CXX_DEFINE_LT_HANDLE_OPERATOR(rocprofiler_context_id_t)
|
||||
@@ -164,7 +182,7 @@ ROCPROFILER_CXX_DEFINE_LT_HANDLE_OPERATOR(rocprofiler_queue_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_LT_HANDLE_OPERATOR(rocprofiler_stream_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_LT_HANDLE_OPERATOR(rocprofiler_buffer_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_LT_HANDLE_OPERATOR(rocprofiler_counter_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_LT_HANDLE_OPERATOR(rocprofiler_profile_config_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_LT_HANDLE_OPERATOR(rocprofiler_counter_config_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_LT_HANDLE_OPERATOR(rocprofiler_callback_thread_t)
|
||||
ROCPROFILER_CXX_DEFINE_LT_HANDLE_OPERATOR(hsa_agent_t)
|
||||
ROCPROFILER_CXX_DEFINE_LT_HANDLE_OPERATOR(hsa_signal_t)
|
||||
@@ -172,6 +190,14 @@ ROCPROFILER_CXX_DEFINE_LT_HANDLE_OPERATOR(hsa_executable_t)
|
||||
ROCPROFILER_CXX_DEFINE_LT_HANDLE_OPERATOR(hsa_region_t)
|
||||
ROCPROFILER_CXX_DEFINE_LT_HANDLE_OPERATOR(hsa_amd_memory_pool_t)
|
||||
|
||||
inline bool
|
||||
operator<(const rocprofiler_counter_record_dimension_info_t& lhs,
|
||||
const rocprofiler_counter_record_dimension_info_t& rhs)
|
||||
{
|
||||
return std::tie(lhs.id, lhs.instance_size, lhs.name) <
|
||||
std::tie(rhs.id, rhs.instance_size, rhs.name);
|
||||
}
|
||||
|
||||
inline bool
|
||||
operator<(const rocprofiler_agent_v0_t& lhs, const rocprofiler_agent_v0_t& rhs)
|
||||
{
|
||||
@@ -189,6 +215,12 @@ operator<(rocprofiler_dim3_t lhs, rocprofiler_dim3_t rhs)
|
||||
: (lhs_m < rhs_m);
|
||||
}
|
||||
|
||||
inline bool
|
||||
operator<(rocprofiler_version_triplet_t lhs, rocprofiler_version_triplet_t rhs)
|
||||
{
|
||||
return std::tie(lhs.major, lhs.minor, lhs.patch) < std::tie(rhs.major, rhs.minor, rhs.patch);
|
||||
}
|
||||
|
||||
// definitions of operator>, operator<=, operator>=
|
||||
ROCPROFILER_CXX_DEFINE_COMPARE_OPERATORS(rocprofiler_context_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_COMPARE_OPERATORS(rocprofiler_address_t)
|
||||
@@ -197,7 +229,7 @@ ROCPROFILER_CXX_DEFINE_COMPARE_OPERATORS(rocprofiler_queue_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_COMPARE_OPERATORS(rocprofiler_stream_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_COMPARE_OPERATORS(rocprofiler_buffer_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_COMPARE_OPERATORS(rocprofiler_counter_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_COMPARE_OPERATORS(rocprofiler_profile_config_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_COMPARE_OPERATORS(rocprofiler_counter_config_id_t)
|
||||
ROCPROFILER_CXX_DEFINE_COMPARE_OPERATORS(rocprofiler_callback_thread_t)
|
||||
ROCPROFILER_CXX_DEFINE_COMPARE_OPERATORS(hsa_agent_t)
|
||||
ROCPROFILER_CXX_DEFINE_COMPARE_OPERATORS(hsa_signal_t)
|
||||
@@ -206,6 +238,7 @@ ROCPROFILER_CXX_DEFINE_COMPARE_OPERATORS(const rocprofiler_agent_v0_t&)
|
||||
ROCPROFILER_CXX_DEFINE_COMPARE_OPERATORS(rocprofiler_dim3_t)
|
||||
ROCPROFILER_CXX_DEFINE_COMPARE_OPERATORS(hsa_region_t)
|
||||
ROCPROFILER_CXX_DEFINE_COMPARE_OPERATORS(hsa_amd_memory_pool_t)
|
||||
ROCPROFILER_CXX_DEFINE_COMPARE_OPERATORS(rocprofiler_version_triplet_t)
|
||||
|
||||
// cleanup defines
|
||||
#undef ROCPROFILER_CXX_DECLARE_OPERATORS
|
||||
|
||||
@@ -1235,6 +1235,30 @@ save(ArchiveT& ar, rocprofiler_counter_info_v0_t data)
|
||||
ROCP_SDK_SAVE_DATA_CSTR(expression);
|
||||
}
|
||||
|
||||
template <typename ArchiveT>
|
||||
void
|
||||
save(ArchiveT& ar, rocprofiler_counter_info_v1_t data)
|
||||
{
|
||||
ROCP_SDK_SAVE_DATA_FIELD(id);
|
||||
ROCP_SDK_SAVE_DATA_BITFIELD("is_constant", is_constant);
|
||||
ROCP_SDK_SAVE_DATA_BITFIELD("is_derived", is_derived);
|
||||
ROCP_SDK_SAVE_DATA_CSTR(name);
|
||||
ROCP_SDK_SAVE_DATA_CSTR(description);
|
||||
ROCP_SDK_SAVE_DATA_CSTR(block);
|
||||
ROCP_SDK_SAVE_DATA_CSTR(expression);
|
||||
|
||||
auto convert = [](const auto* val, uint64_t sz) {
|
||||
using data_type = std::remove_cv_t<std::remove_pointer_t<decltype(val)>>;
|
||||
auto retval = std::vector<data_type>{};
|
||||
for(uint64_t i = 0; i < sz; ++i)
|
||||
retval.emplace_back(val[i]);
|
||||
return retval;
|
||||
};
|
||||
|
||||
ROCP_SDK_SAVE_VALUE("dims", convert(data.dimensions, data.dimensions_count));
|
||||
ROCP_SDK_SAVE_VALUE("instances", convert(data.instance_ids, data.instance_ids_count));
|
||||
}
|
||||
|
||||
template <typename ArchiveT>
|
||||
void
|
||||
save(ArchiveT& ar, rocprofiler_record_dimension_info_t data)
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
// MIT License
|
||||
//
|
||||
// Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/fwd.h>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace rocprofiler
|
||||
{
|
||||
namespace sdk
|
||||
{
|
||||
namespace version
|
||||
{
|
||||
/**
|
||||
* @brief This function extracts the `<major>.<minor>.<patch>` from a single integer which encodes
|
||||
* this triplet by a factor of `N`. E.g. version 3.2.1 using N=100 is represented by the value of
|
||||
* 30201; version 3.2.1 using N=1000 is represented by the value of 3002001.
|
||||
*
|
||||
* For a given factor `N`, the major version can be extracted by
|
||||
* dividing the version value by (N * N); the minor version can be extracted via
|
||||
* computing the modulus of (N * N) and then divided by N; the patch version is simply the modulus
|
||||
* of N.
|
||||
*/
|
||||
template <uint64_t FactorV = 100>
|
||||
constexpr rocprofiler_version_triplet_t
|
||||
compute_version_triplet(uint64_t version)
|
||||
{
|
||||
constexpr auto factor = FactorV;
|
||||
|
||||
return rocprofiler_version_triplet_t{
|
||||
.major = static_cast<uint32_t>(version / (factor * factor)),
|
||||
.minor = static_cast<uint32_t>((version % (factor * factor)) / factor),
|
||||
.patch = static_cast<uint32_t>(version % factor)};
|
||||
}
|
||||
} // namespace version
|
||||
} // namespace sdk
|
||||
} // namespace rocprofiler
|
||||
@@ -48,6 +48,40 @@
|
||||
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @def ROCPROFILER_SDK_BETA_COMPAT
|
||||
* @brief rocprofiler-sdk clients (i.e. tool using rocprofiler-sdk) should set this definition to 1
|
||||
* before including any rocprofiler-sdk header if it wants rocprofiler-sdk to provide preprocessor
|
||||
* definitions to help with compilation support for tools prior to v1.0.0 release. Note: for v1.0.0
|
||||
* release, rocprofiler-sdk sets the ppdef to 1 by default. Eventually, rocprofiler-sdk will remove
|
||||
* defining this value and it will be up to the tools to define this value.
|
||||
*
|
||||
* For example in version 0.6.0, there was a function `rocprofiler_create_profile_config` and, prior
|
||||
* to the 1.0.0 release, this function was renamed to `rocprofiler_create_counter_config`.
|
||||
* @addtogroup VERSIONING_GROUP
|
||||
*
|
||||
* @def ROCPROFILER_SDK_BETA_COMPAT_SUPPORTED
|
||||
* @brief rocprofiler-sdk will set this preprocessor definition to 1 if it can honor
|
||||
* ::ROCPROFILER_SDK_BETA_COMPAT set to 1. Once backwards compatibility with the beta
|
||||
* rocprofiler-sdk can no longer be supported, this will always be set to 0.
|
||||
* @addtogroup VERSIONING_GROUP
|
||||
*
|
||||
* @def ROCPROFILER_SDK_DEPRECATED_WARNINGS
|
||||
* @brief Set this preprocessor definition to 0 to silent compiler warnings when using features that
|
||||
* are marked as deprecated. By default, rocprofiler-sdk defines this to equal to 1.
|
||||
* @addtogroup VERSIONING_GROUP
|
||||
*
|
||||
* @def ROCPROFILER_SDK_EXPERIMENTAL_WARNINGS
|
||||
* @brief Set this preprocessor definition to 1 to enable compiler warnings when using experimental
|
||||
* features. @see ::ROCPROFILER_SDK_EXPERIMENTAL
|
||||
* @addtogroup VERSIONING_GROUP
|
||||
*
|
||||
* @def ROCPROFILER_SDK_EXPERIMENTAL
|
||||
* @brief When this attribute is added to a type, object, expression, etc., the developer should be
|
||||
* aware that the API and/or ABI is subject to change in subsequent releases.
|
||||
* @addtogroup VERSIONING_GROUP
|
||||
*/
|
||||
|
||||
#if !defined(ROCPROFILER_ATTRIBUTE)
|
||||
# if defined(_MSC_VER)
|
||||
# define ROCPROFILER_ATTRIBUTE(...) __declspec(__VA_ARGS__)
|
||||
@@ -137,3 +171,47 @@
|
||||
#else
|
||||
# define ROCPROFILER_UINT64_C(value) UINT64_C(value)
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && __cplusplus >= 201402L
|
||||
# define ROCPROFILER_SDK_DEPRECATED_MESSAGE(...) [[deprecated(__VA_ARGS__)]]
|
||||
#elif !defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
|
||||
# define ROCPROFILER_SDK_DEPRECATED_MESSAGE(...) [[deprecated(__VA_ARGS__)]]
|
||||
#else
|
||||
# define ROCPROFILER_SDK_DEPRECATED_MESSAGE(...) ROCPROFILER_ATTRIBUTE(deprecated)
|
||||
#endif
|
||||
|
||||
// TODO(jomadsen): uncomment below code before v1.0.0
|
||||
// #if !defined(ROCPROFILER_SDK_DEPRECATED_WARNINGS)
|
||||
// # define ROCPROFILER_SDK_DEPRECATED_WARNINGS 1
|
||||
// #endif
|
||||
|
||||
#if defined(ROCPROFILER_SDK_DEPRECATED_WARNINGS) && ROCPROFILER_SDK_DEPRECATED_WARNINGS > 0
|
||||
# define ROCPROFILER_SDK_DEPRECATED(...) ROCPROFILER_SDK_DEPRECATED_MESSAGE(__VA_ARGS__)
|
||||
#else
|
||||
# define ROCPROFILER_SDK_DEPRECATED(...)
|
||||
#endif
|
||||
|
||||
#define ROCPROFILER_SDK_EXPERIMENTAL_MESSAGE \
|
||||
ROCPROFILER_SDK_DEPRECATED_MESSAGE( \
|
||||
"Note: this feature has been marked as experimental. Define " \
|
||||
"ROCPROFILER_SDK_EXPERIMENTAL_WARNINGS=0 to silence this message.")
|
||||
|
||||
#if defined(ROCPROFILER_SDK_EXPERIMENTAL_WARNINGS) && ROCPROFILER_SDK_EXPERIMENTAL_WARNINGS > 0
|
||||
# define ROCPROFILER_SDK_EXPERIMENTAL ROCPROFILER_SDK_EXPERIMENTAL_MESSAGE
|
||||
#else
|
||||
# define ROCPROFILER_SDK_EXPERIMENTAL
|
||||
#endif
|
||||
|
||||
//
|
||||
// if ROCPROFILER_SDK_BETA_COMPAT is > 0, provide some macros to help with compatibility.
|
||||
// For 1.0.0 release, we define this by default
|
||||
//
|
||||
#if !defined(ROCPROFILER_SDK_BETA_COMPAT)
|
||||
# define ROCPROFILER_SDK_BETA_COMPAT 1
|
||||
#endif
|
||||
|
||||
// rocprofiler-sdk will set ROCPROFILER_SDK_BETA_COMPAT_SUPPORTED to 1 if it can support
|
||||
// compatibility with rocprofiler-sdk < v1.0.0
|
||||
#if defined(ROCPROFILER_SDK_BETA_COMPAT) && ROCPROFILER_SDK_BETA_COMPAT > 0
|
||||
# define ROCPROFILER_SDK_BETA_COMPAT_SUPPORTED 1
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# headers containing deprecated functions, types, etc.
|
||||
#
|
||||
set(ROCPROFILER_DEPRECATED_HEADER_FILES counters.h profile_config.h)
|
||||
|
||||
install(
|
||||
FILES ${ROCPROFILER_DEPRECATED_HEADER_FILES}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk/deprecated
|
||||
COMPONENT development)
|
||||
@@ -0,0 +1,87 @@
|
||||
// MIT License
|
||||
//
|
||||
// Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/agent.h>
|
||||
#include <rocprofiler-sdk/defines.h>
|
||||
#include <rocprofiler-sdk/fwd.h>
|
||||
|
||||
ROCPROFILER_EXTERN_C_INIT
|
||||
|
||||
/**
|
||||
* @brief (deprecated) Callback that gives a list of available dimensions for a counter
|
||||
*
|
||||
* @param [in] id Counter id the dimension data is for
|
||||
* @param [in] dim_info An array of dimensions for the counter
|
||||
* ::rocprofiler_iterate_counter_dimensions was called on.
|
||||
* @param [in] num_dims Number of dimensions
|
||||
* @param [in] user_data User data supplied by
|
||||
* ::rocprofiler_iterate_agent_supported_counters
|
||||
*/
|
||||
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);
|
||||
|
||||
/**
|
||||
* @brief (deprecated) Return information about the dimensions that exists for a specific counter
|
||||
* and the extent of each dimension.
|
||||
*
|
||||
* @param [in] id counter id to query dimension info for.
|
||||
* @param [in] info_cb Callback to return dimension information for counter
|
||||
* @param [in] user_data data to pass into the callback
|
||||
* @return ::rocprofiler_status_t
|
||||
* @retval ROCPROFILER_STATUS_SUCCESS if dimension exists
|
||||
* @retval ROCPROFILER_STATUS_ERROR_COUNTER_NOT_FOUND if counter is not found
|
||||
* @retval ROCPROFILER_STATUS_ERROR_DIM_NOT_FOUND if counter does not have this dimension
|
||||
*/
|
||||
ROCPROFILER_SDK_DEPRECATED("Information now available in rocprofiler_counter_info_v1_t. "
|
||||
"This function will be removed in the future.")
|
||||
rocprofiler_status_t
|
||||
rocprofiler_iterate_counter_dimensions(rocprofiler_counter_id_t id,
|
||||
rocprofiler_available_dimensions_cb_t info_cb,
|
||||
void* user_data) ROCPROFILER_API;
|
||||
|
||||
/**
|
||||
* @brief (deprecated) This call returns the number of instances specific counter contains.
|
||||
*
|
||||
* @param [in] agent_id rocprofiler agent identifier
|
||||
* @param [in] counter_id counter id (obtained from iterate_agent_supported_counters)
|
||||
* @param [out] instance_count number of instances the counter has
|
||||
* @return ::rocprofiler_status_t
|
||||
* @retval ROCPROFILER_STATUS_SUCCESS if counter found
|
||||
* @retval ROCPROFILER_STATUS_ERROR_COUNTER_NOT_FOUND if counter not found
|
||||
*/
|
||||
ROCPROFILER_SDK_DEPRECATED("Information now available in rocprofiler_counter_info_v1_t. "
|
||||
"This function will be removed in the future.")
|
||||
rocprofiler_status_t
|
||||
rocprofiler_query_counter_instance_count(rocprofiler_agent_id_t agent_id,
|
||||
rocprofiler_counter_id_t counter_id,
|
||||
size_t* instance_count) ROCPROFILER_API
|
||||
ROCPROFILER_NONNULL(3);
|
||||
|
||||
/** @} */
|
||||
ROCPROFILER_EXTERN_C_FINI
|
||||
@@ -0,0 +1,56 @@
|
||||
// MIT License
|
||||
//
|
||||
// Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/counter_config.h>
|
||||
#include <rocprofiler-sdk/defines.h>
|
||||
#include <rocprofiler-sdk/fwd.h>
|
||||
|
||||
ROCPROFILER_EXTERN_C_INIT
|
||||
|
||||
/**
|
||||
* @brief (deprecated) Replaced by ::rocprofiler_create_counter_config.
|
||||
*
|
||||
*/
|
||||
ROCPROFILER_SDK_DEPRECATED("profile_config renamed to counter_config")
|
||||
static inline rocprofiler_status_t
|
||||
rocprofiler_create_profile_config(rocprofiler_agent_id_t agent_id,
|
||||
rocprofiler_counter_id_t* counters_list,
|
||||
size_t counters_count,
|
||||
rocprofiler_profile_config_id_t* config_id)
|
||||
{
|
||||
return rocprofiler_create_counter_config(agent_id, counters_list, counters_count, config_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief (deprecated) Replaced by ::rocprofiler_destroy_counter_config.
|
||||
*
|
||||
*/
|
||||
ROCPROFILER_SDK_DEPRECATED("profile_config renamed to counter_config")
|
||||
static inline rocprofiler_status_t
|
||||
rocprofiler_destroy_profile_config(rocprofiler_profile_config_id_t config_id)
|
||||
{
|
||||
return rocprofiler_destroy_counter_config(config_id);
|
||||
}
|
||||
|
||||
ROCPROFILER_EXTERN_C_FINI
|
||||
@@ -25,16 +25,17 @@
|
||||
#include <rocprofiler-sdk/defines.h>
|
||||
#include <rocprofiler-sdk/fwd.h>
|
||||
|
||||
ROCPROFILER_EXTERN_C_INIT
|
||||
|
||||
/**
|
||||
* @defgroup device_counting_service Agent Profile Counting Service
|
||||
* @brief needs brief description
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
ROCPROFILER_EXTERN_C_INIT
|
||||
|
||||
/**
|
||||
* @brief Callback to set the profile config for the agent.
|
||||
* @brief (experimental) Callback to set the profile config for the agent.
|
||||
*
|
||||
* @param [in] context_id context id
|
||||
* @param [in] config_id Profile config detailing the counters to collect for this kernel
|
||||
@@ -47,31 +48,33 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
* context.
|
||||
* @retval ::ROCPROFILER_STATUS_SUCCESS Returned if succesfully configured
|
||||
*/
|
||||
typedef rocprofiler_status_t (*rocprofiler_agent_set_profile_callback_t)(
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
typedef rocprofiler_status_t (*rocprofiler_device_counting_agent_cb_t)(
|
||||
rocprofiler_context_id_t context_id,
|
||||
rocprofiler_profile_config_id_t config_id);
|
||||
rocprofiler_counter_config_id_t config_id);
|
||||
|
||||
/**
|
||||
* @brief Configure Profile Counting Service for agent. Called when the context is started.
|
||||
* Selects the counters to be used for agent profiling.
|
||||
* @brief (experimental) Configure Profile Counting Service for agent. Called when the context is
|
||||
* started. Selects the counters to be used for agent profiling.
|
||||
*
|
||||
* @param [in] context_id context id
|
||||
* @param [in] agent_id agent id
|
||||
* @param [in] set_config Function to call to set the profile config (see
|
||||
* rocprofiler_agent_set_profile_callback_t)
|
||||
* rocprofiler_device_counting_agent_cb_t)
|
||||
* @param [in] user_data Data supplied to rocprofiler_configure_device_counting_service
|
||||
*/
|
||||
typedef void (*rocprofiler_device_counting_service_callback_t)(
|
||||
rocprofiler_context_id_t context_id,
|
||||
rocprofiler_agent_id_t agent_id,
|
||||
rocprofiler_agent_set_profile_callback_t set_config,
|
||||
void* user_data);
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
typedef void (*rocprofiler_device_counting_service_cb_t)(
|
||||
rocprofiler_context_id_t context_id,
|
||||
rocprofiler_agent_id_t agent_id,
|
||||
rocprofiler_device_counting_agent_cb_t set_config,
|
||||
void* user_data);
|
||||
|
||||
/**
|
||||
* @brief Configure Device Counting Service for agent. There may only be one counting service
|
||||
* configured per agent in a context and can be only one active context that is profiling a single
|
||||
* agent at a time. Multiple agent contexts can be started at the same time if they are profiling
|
||||
* different agents.
|
||||
* @brief (experimental) Configure Device Counting Service for agent. There may only be one counting
|
||||
* service configured per agent in a context and can be only one active context that is profiling a
|
||||
* single agent at a time. Multiple agent contexts can be started at the same time if they are
|
||||
* profiling different agents.
|
||||
*
|
||||
* @param [in] context_id context id
|
||||
* @param [in] buffer_id id of the buffer to use for the counting service. When
|
||||
@@ -81,7 +84,7 @@ typedef void (*rocprofiler_device_counting_service_callback_t)(
|
||||
* rocprofiler_sample_device_counting_service
|
||||
* @param [in] agent_id agent to configure profiling on.
|
||||
* @param [in] cb Callback called when the context is started for the tool to specify what
|
||||
* counters to collect (rocprofiler_profile_config_id_t).
|
||||
* counters to collect (rocprofiler_counter_config_id_t).
|
||||
* @param [in] user_data User supplied data to be passed to the callback cb when triggered
|
||||
* @return ::rocprofiler_status_t
|
||||
* @retval ::ROCPROFILER_STATUS_ERROR_CONTEXT_INVALID Returned if the context does not exist.
|
||||
@@ -90,28 +93,28 @@ typedef void (*rocprofiler_device_counting_service_callback_t)(
|
||||
* profiling configured for agent_id.
|
||||
* @retval ::ROCPROFILER_STATUS_SUCCESS Returned if succesfully configured
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
rocprofiler_status_t
|
||||
rocprofiler_configure_device_counting_service(rocprofiler_context_id_t context_id,
|
||||
rocprofiler_buffer_id_t buffer_id,
|
||||
rocprofiler_agent_id_t agent_id,
|
||||
rocprofiler_device_counting_service_callback_t cb,
|
||||
void* user_data)
|
||||
rocprofiler_configure_device_counting_service(rocprofiler_context_id_t context_id,
|
||||
rocprofiler_buffer_id_t buffer_id,
|
||||
rocprofiler_agent_id_t agent_id,
|
||||
rocprofiler_device_counting_service_cb_t cb,
|
||||
void* user_data)
|
||||
ROCPROFILER_NONNULL(4) ROCPROFILER_API;
|
||||
|
||||
/**
|
||||
* @brief Trigger a read of the counter data for the agent profile. The counter data will be
|
||||
* written to the buffer specified in rocprofiler_configure_device_counting_service.
|
||||
* The data in rocprofiler_user_data_t will be written to the buffer along with the counter data.
|
||||
* flags can be used to specify if this call should be performed asynchronously (default is
|
||||
* synchronous).
|
||||
* @brief (experimental) Trigger a read of the counter data for the agent profile. The counter data
|
||||
* will be written to the buffer specified in rocprofiler_configure_device_counting_service. The
|
||||
* data in rocprofiler_user_data_t will be written to the buffer along with the counter data. flags
|
||||
* can be used to specify if this call should be performed asynchronously (default is synchronous).
|
||||
*
|
||||
* @param [in] context_id context id
|
||||
* @param [in] user_data User supplied data, included in records outputted to buffer.
|
||||
* @param [in] flags Flags to specify how the counter data should be collected (defaults to sync).
|
||||
* @param [in] output_records Output records collected via sampling (output is also written to
|
||||
* buffer). Must be allocated by caller.
|
||||
* @param [in] rec_count On entry, this is the maximum number of records rocprof can store in
|
||||
* output_records. On exit, contains the number of actual records.
|
||||
* @param [in] output_records (Optional) Provides the values immediately instead of outputting to
|
||||
* buffer. Must be allocated by caller.
|
||||
* @param [in] rec_count (Optional) On entry, this is the maximum number of records rocprof can
|
||||
* store in output_records. On exit, contains the number of actual records.
|
||||
* @return ::rocprofiler_status_t
|
||||
* @retval ::ROCPROFILER_STATUS_ERROR_CONTEXT_INVALID Returned if the context does not exist or
|
||||
* the context is not configured for agent profiling.
|
||||
@@ -124,6 +127,7 @@ rocprofiler_configure_device_counting_service(rocprofiler_context_id_t context_i
|
||||
* @retval ::ROCPROFILER_STATUS_ERROR_INVALID_ARGUMENT Returned If ASYNC is being used while
|
||||
* output_records is not null.
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
rocprofiler_status_t
|
||||
rocprofiler_sample_device_counting_service(rocprofiler_context_id_t context_id,
|
||||
rocprofiler_user_data_t user_data,
|
||||
|
||||
@@ -23,10 +23,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/agent.h>
|
||||
#include <rocprofiler-sdk/counter_config.h>
|
||||
#include <rocprofiler-sdk/defines.h>
|
||||
#include <rocprofiler-sdk/fwd.h>
|
||||
#include <rocprofiler-sdk/hsa.h>
|
||||
#include <rocprofiler-sdk/profile_config.h>
|
||||
|
||||
ROCPROFILER_EXTERN_C_INIT
|
||||
|
||||
@@ -38,10 +38,10 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Kernel dispatch data for profile counting callbacks.
|
||||
* @brief (experimental) Kernel dispatch data for profile counting callbacks.
|
||||
*
|
||||
*/
|
||||
typedef struct rocprofiler_dispatch_counting_service_data_t
|
||||
typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_dispatch_counting_service_data_t
|
||||
{
|
||||
uint64_t size; ///< Size of this struct
|
||||
rocprofiler_async_correlation_id_t correlation_id; ///< Correlation ID for this dispatch
|
||||
@@ -51,11 +51,11 @@ typedef struct rocprofiler_dispatch_counting_service_data_t
|
||||
} rocprofiler_dispatch_counting_service_data_t;
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler Profile Counting Counter Record Header Information
|
||||
* @brief (experimental) ROCProfiler Profile Counting Counter Record Header Information
|
||||
*
|
||||
* This is buffer equivalent of ::rocprofiler_dispatch_counting_service_data_t
|
||||
*/
|
||||
typedef struct rocprofiler_dispatch_counting_service_record_t
|
||||
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
|
||||
@@ -66,27 +66,27 @@ typedef struct rocprofiler_dispatch_counting_service_record_t
|
||||
} rocprofiler_dispatch_counting_service_record_t;
|
||||
|
||||
/**
|
||||
* @brief Kernel Dispatch Callback. This is a callback that is invoked before the kernel
|
||||
* is enqueued into the HSA queue. What counters to collect for a kernel are set
|
||||
* via passing back a profile config (config) in this callback. These counters
|
||||
* will be collected and emplaced in the buffer with @ref rocprofiler_buffer_id_t used when
|
||||
* setting up this callback.
|
||||
* @brief (experimental) Kernel Dispatch Callback. This is a callback that is invoked before the
|
||||
* kernel is enqueued into the HSA queue. What counters to collect for a kernel are set via passing
|
||||
* back a profile config (config) in this callback. These counters will be collected and emplaced in
|
||||
* the buffer with @ref rocprofiler_buffer_id_t used when setting up this callback.
|
||||
*
|
||||
* @param [in] dispatch_data @see ::rocprofiler_dispatch_counting_service_data_t
|
||||
* @param [out] config Profile config detailing the counters to collect for this kernel
|
||||
* @param [out] user_data User data unique to this dispatch. Returned in record callback
|
||||
* @param [in] callback_data_args Callback supplied via buffered_dispatch_counting_service
|
||||
*/
|
||||
typedef void (*rocprofiler_dispatch_counting_service_callback_t)(
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
typedef void (*rocprofiler_dispatch_counting_service_cb_t)(
|
||||
rocprofiler_dispatch_counting_service_data_t dispatch_data,
|
||||
rocprofiler_profile_config_id_t* config,
|
||||
rocprofiler_counter_config_id_t* config,
|
||||
rocprofiler_user_data_t* user_data,
|
||||
void* callback_data_args);
|
||||
|
||||
/**
|
||||
* @brief Counting record callback. This is a callback is invoked when the kernel
|
||||
* @brief (experimental) Counting record callback. This is a callback is invoked when the kernel
|
||||
* execution is complete and contains the counter profile data requested in
|
||||
* @ref rocprofiler_dispatch_counting_service_callback_t. Only used with
|
||||
* @ref rocprofiler_dispatch_counting_service_cb_t. Only used with
|
||||
* @ref rocprofiler_configure_callback_dispatch_counting_service.
|
||||
*
|
||||
* @param [in] dispatch_data @see ::rocprofiler_dispatch_counting_service_data_t
|
||||
@@ -95,7 +95,8 @@ typedef void (*rocprofiler_dispatch_counting_service_callback_t)(
|
||||
* @param [in] user_data User data instance from dispatch callback
|
||||
* @param [in] callback_data_args Callback supplied via buffered_dispatch_counting_service
|
||||
*/
|
||||
typedef void (*rocprofiler_profile_counting_record_callback_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,
|
||||
size_t record_count,
|
||||
@@ -103,7 +104,7 @@ typedef void (*rocprofiler_profile_counting_record_callback_t)(
|
||||
void* callback_data_args);
|
||||
|
||||
/**
|
||||
* @brief Configure buffered dispatch profile Counting Service.
|
||||
* @brief (experimental) Configure buffered dispatch profile Counting Service.
|
||||
* Collects the counters in dispatch packets and stores them
|
||||
* in a buffer with @p buffer_id. The buffer may contain packets from more than
|
||||
* one dispatch (denoted by correlation id). Will trigger the
|
||||
@@ -112,14 +113,14 @@ typedef void (*rocprofiler_profile_counting_record_callback_t)(
|
||||
* NOTE: Interface is up for comment as to whether restrictions
|
||||
* on agent should be made here (limiting the CB based on agent)
|
||||
* or if the restriction should be performed by the tool in
|
||||
* @ref rocprofiler_dispatch_counting_service_callback_t (i.e.
|
||||
* @ref rocprofiler_dispatch_counting_service_cb_t (i.e.
|
||||
* tool code checking the agent param to see if they want to profile
|
||||
* it).
|
||||
*
|
||||
* Interface is up for comment as to whether restrictions
|
||||
* on agent should be made here (limiting the CB based on agent)
|
||||
* or if the restriction should be performed by the tool in
|
||||
* @ref rocprofiler_dispatch_counting_service_callback_t (i.e.
|
||||
* @ref rocprofiler_dispatch_counting_service_cb_t (i.e.
|
||||
* tool code checking the agent param to see if they want to profile
|
||||
* it).
|
||||
*
|
||||
@@ -129,15 +130,16 @@ typedef void (*rocprofiler_profile_counting_record_callback_t)(
|
||||
* @param [in] callback_data_args callback data
|
||||
* @return ::rocprofiler_status_t
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
rocprofiler_status_t
|
||||
rocprofiler_configure_buffered_dispatch_counting_service(
|
||||
rocprofiler_context_id_t context_id,
|
||||
rocprofiler_buffer_id_t buffer_id,
|
||||
rocprofiler_dispatch_counting_service_callback_t callback,
|
||||
void* callback_data_args) ROCPROFILER_API;
|
||||
rocprofiler_configure_buffer_dispatch_counting_service(
|
||||
rocprofiler_context_id_t context_id,
|
||||
rocprofiler_buffer_id_t buffer_id,
|
||||
rocprofiler_dispatch_counting_service_cb_t callback,
|
||||
void* callback_data_args) ROCPROFILER_API;
|
||||
|
||||
/**
|
||||
* @brief Configure buffered dispatch profile Counting Service.
|
||||
* @brief (experimental) Configure buffered dispatch profile Counting Service.
|
||||
* Collects the counters in dispatch packets and calls a callback
|
||||
* with the counters collected during that dispatch.
|
||||
*
|
||||
@@ -148,13 +150,15 @@ rocprofiler_configure_buffered_dispatch_counting_service(
|
||||
* @param [in] record_callback_args Callback args for record callback
|
||||
* @return ::rocprofiler_status_t
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
rocprofiler_status_t
|
||||
rocprofiler_configure_callback_dispatch_counting_service(
|
||||
rocprofiler_context_id_t context_id,
|
||||
rocprofiler_dispatch_counting_service_callback_t dispatch_callback,
|
||||
void* dispatch_callback_args,
|
||||
rocprofiler_profile_counting_record_callback_t record_callback,
|
||||
void* record_callback_args) ROCPROFILER_API;
|
||||
rocprofiler_context_id_t context_id,
|
||||
rocprofiler_dispatch_counting_service_cb_t dispatch_callback,
|
||||
void* dispatch_callback_args,
|
||||
rocprofiler_dispatch_counting_record_cb_t record_callback,
|
||||
void* record_callback_args) ROCPROFILER_API;
|
||||
|
||||
/** @} */
|
||||
|
||||
ROCPROFILER_EXTERN_C_FINI
|
||||
|
||||
@@ -29,10 +29,10 @@
|
||||
ROCPROFILER_EXTERN_C_INIT
|
||||
|
||||
/**
|
||||
* @brief Apply a custom counter definition (YAML). This function must be called before
|
||||
* counter iteration functions like @ref rocprofiler_iterate_agent_supported_counters
|
||||
* if custom counter definitions are to be used. This function will return an error
|
||||
* if the definition has already been loaded.
|
||||
* @brief (experimental) Apply a custom counter definition (YAML). This function must be called
|
||||
* before counter iteration functions like @ref rocprofiler_iterate_agent_supported_counters if
|
||||
* custom counter definitions are to be used. This function will return an error if the definition
|
||||
* has already been loaded.
|
||||
* @param [in] yaml YAML string containing counter definitions
|
||||
* @param [in] size Size of the YAML string
|
||||
* @param [in] flags Flags to apply to the counter definition
|
||||
@@ -40,6 +40,7 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
* @retval ROCPROFILER_STATUS_SUCCESS if counter definition applied
|
||||
* @retval ROCPROFILER_STATUS_ERROR if counter definition already loaded
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
rocprofiler_status_t
|
||||
rocprofiler_load_counter_definition(const char* yaml,
|
||||
size_t size,
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
// MIT License
|
||||
//
|
||||
// Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* @file rocprofiler-sdk/ext_version.h
|
||||
* @brief Defines versions for external dependencies
|
||||
*
|
||||
*/
|
||||
|
||||
// clang-format off
|
||||
#define ROCPROFILER_HSA_RUNTIME_VERSION_MAJOR @HSA_RUNTIME_VERSION_MAJOR@
|
||||
#define ROCPROFILER_HSA_RUNTIME_VERSION_MINOR @HSA_RUNTIME_VERSION_MINOR@
|
||||
|
||||
#cmakedefine ROCPROFILER_HSA_API_TABLE_MAJOR_VERSION @ROCPROFILER_HSA_API_TABLE_MAJOR_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_CORE_API_TABLE_MAJOR_VERSION @ROCPROFILER_HSA_CORE_API_TABLE_MAJOR_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_AMD_EXT_API_TABLE_MAJOR_VERSION @ROCPROFILER_HSA_AMD_EXT_API_TABLE_MAJOR_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_FINALIZER_API_TABLE_MAJOR_VERSION @ROCPROFILER_HSA_FINALIZER_API_TABLE_MAJOR_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_IMAGE_API_TABLE_MAJOR_VERSION @ROCPROFILER_HSA_IMAGE_API_TABLE_MAJOR_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_AQLPROFILE_API_TABLE_MAJOR_VERSION @ROCPROFILER_HSA_AQLPROFILE_API_TABLE_MAJOR_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_TOOLS_API_TABLE_MAJOR_VERSION @ROCPROFILER_HSA_TOOLS_API_TABLE_MAJOR_VERSION@
|
||||
|
||||
#cmakedefine ROCPROFILER_HSA_API_TABLE_STEP_VERSION @ROCPROFILER_HSA_API_TABLE_STEP_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_CORE_API_TABLE_STEP_VERSION @ROCPROFILER_HSA_CORE_API_TABLE_STEP_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_AMD_EXT_API_TABLE_STEP_VERSION @ROCPROFILER_HSA_AMD_EXT_API_TABLE_STEP_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_FINALIZER_API_TABLE_STEP_VERSION @ROCPROFILER_HSA_FINALIZER_API_TABLE_STEP_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_IMAGE_API_TABLE_STEP_VERSION @ROCPROFILER_HSA_IMAGE_API_TABLE_STEP_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_AQLPROFILE_API_TABLE_STEP_VERSION @ROCPROFILER_HSA_AQLPROFILE_API_TABLE_STEP_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_TOOLS_API_TABLE_STEP_VERSION @ROCPROFILER_HSA_TOOLS_API_TABLE_STEP_VERSION@
|
||||
// clang-format on
|
||||
|
||||
// latest hsa-runtime version supported
|
||||
#define ROCPROFILER_HSA_RUNTIME_VERSION \
|
||||
((10000 * ROCPROFILER_HSA_RUNTIME_VERSION_MAJOR) + \
|
||||
(100 * ROCPROFILER_HSA_RUNTIME_VERSION_MINOR))
|
||||
@@ -35,7 +35,7 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler External Correlation ID Operations.
|
||||
* @brief (experimental) ROCProfiler External Correlation ID Operations.
|
||||
*
|
||||
* These kinds correspond to callback and buffered tracing kinds (@see
|
||||
* ::rocprofiler_callback_tracing_kind_t and ::rocprofiler_buffer_tracing_kind_t) which generate
|
||||
@@ -51,7 +51,8 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
* where the external correlation ID value is not important while also getting a request for an
|
||||
* external correlation ID for other tracing kinds.
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
// NOLINTNEXTLINE(performance-enum-size)
|
||||
typedef enum ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_external_correlation_id_request_kind_t
|
||||
{
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_NONE = 0, ///< Unknown kind
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_HSA_CORE_API, ///<
|
||||
@@ -75,7 +76,7 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
} rocprofiler_external_correlation_id_request_kind_t;
|
||||
|
||||
/**
|
||||
* @brief Callback requesting a value for the external correlation id.
|
||||
* @brief (experimental) Callback requesting a value for the external correlation id.
|
||||
*
|
||||
* @param [in] thread_id Id of the thread making the request
|
||||
* @param [in] context_id Id of the context making the request
|
||||
@@ -95,6 +96,7 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
* correlation ID value and the thread-local value for the most recently pushed external correlation
|
||||
* ID should be used instead
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
typedef int (*rocprofiler_external_correlation_id_request_cb_t)(
|
||||
rocprofiler_thread_id_t thread_id,
|
||||
rocprofiler_context_id_t context_id,
|
||||
@@ -105,7 +107,7 @@ typedef int (*rocprofiler_external_correlation_id_request_cb_t)(
|
||||
void* data);
|
||||
|
||||
/**
|
||||
* @brief Configure External Correlation ID Request Service.
|
||||
* @brief (experimental) Configure External Correlation ID Request Service.
|
||||
*
|
||||
* @param [in] context_id Context to associate the service with
|
||||
* @param [in] kinds Array of ::rocprofiler_external_correlation_id_request_kind_t values. If
|
||||
@@ -117,13 +119,14 @@ typedef int (*rocprofiler_external_correlation_id_request_cb_t)(
|
||||
* @param [in] callback_args Data provided to every invocation of the callback function
|
||||
* @return ::rocprofiler_status_t
|
||||
* @retval ::ROCPROFILER_STATUS_ERROR_CONFIGURATION_LOCKED Invoked outside of the initialization
|
||||
* function in @ref rocprofiler_tool_configure_result_t provided to rocprofiler via @ref
|
||||
* rocprofiler_configure function
|
||||
* function in ::rocprofiler_tool_configure_result_t provided to rocprofiler via
|
||||
* ::rocprofiler_configure function
|
||||
* @retval ::ROCPROFILER_STATUS_ERROR_CONTEXT_NOT_FOUND The provided context is not valid/registered
|
||||
* @retval ::ROCPROFILER_STATUS_ERROR_SERVICE_ALREADY_CONFIGURED if the same @ref
|
||||
* rocprofiler_callback_tracing_kind_t value is provided more than once (per context) -- in
|
||||
* other words, we do not support overriding or combining the kinds in separate function calls.
|
||||
* @retval ::ROCPROFILER_STATUS_ERROR_SERVICE_ALREADY_CONFIGURED if the same
|
||||
* ::rocprofiler_callback_tracing_kind_t value is provided more than once (per context) -- in other
|
||||
* words, we do not support overriding or combining the kinds in separate function calls.
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
rocprofiler_status_t
|
||||
rocprofiler_configure_external_correlation_id_request_service(
|
||||
rocprofiler_context_id_t context_id,
|
||||
@@ -133,7 +136,7 @@ rocprofiler_configure_external_correlation_id_request_service(
|
||||
void* callback_args) ROCPROFILER_API ROCPROFILER_NONNULL(4);
|
||||
|
||||
/**
|
||||
* @brief Push default value for `external` field in @ref rocprofiler_correlation_id_t onto stack.
|
||||
* @brief Push default value for `external` field in ::rocprofiler_correlation_id_t onto stack.
|
||||
*
|
||||
* External correlation ids are thread-local values. However, if rocprofiler internally requests an
|
||||
* external correlation id on a non-main thread and an external correlation id has not been pushed
|
||||
@@ -144,8 +147,8 @@ rocprofiler_configure_external_correlation_id_request_service(
|
||||
*
|
||||
* @param [in] context Associated context
|
||||
* @param [in] tid thread identifier. @see rocprofiler_get_thread_id
|
||||
* @param [in] external_correlation_id User data to place in external field in @ref
|
||||
* rocprofiler_correlation_id_t
|
||||
* @param [in] external_correlation_id User data to place in external field in
|
||||
* ::rocprofiler_correlation_id_t
|
||||
* @return ::rocprofiler_status_t
|
||||
* @retval ::ROCPROFILER_STATUS_ERROR_CONTEXT_NOT_FOUND Context does not exist
|
||||
* @retval ::ROCPROFILER_STATUS_ERROR_INVALID_ARGUMENT Thread id is not valid
|
||||
@@ -157,7 +160,7 @@ rocprofiler_push_external_correlation_id(rocprofiler_context_id_t context,
|
||||
ROCPROFILER_API;
|
||||
|
||||
/**
|
||||
* @brief Pop default value for `external` field in @ref rocprofiler_correlation_id_t off of stack
|
||||
* @brief Pop default value for `external` field in ::rocprofiler_correlation_id_t off of stack.
|
||||
*
|
||||
* @param [in] context Associated context
|
||||
* @param [in] tid thread identifier. @see rocprofiler_get_thread_id
|
||||
|
||||
@@ -42,14 +42,10 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
* @{
|
||||
*/
|
||||
|
||||
// TODO(aelwazir): Do we need to add a null (way) for every handle?
|
||||
// TODO(aelwazir): Remove API Data args from the doxygen?
|
||||
// TODO(aelwazir): Not everything in bin needs to be installed bin, use libexec or share?
|
||||
|
||||
/**
|
||||
* @brief Status codes.
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_status_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_STATUS_SUCCESS = 0, ///< No error occurred
|
||||
ROCPROFILER_STATUS_ERROR, ///< Generalized error
|
||||
@@ -111,10 +107,10 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
} rocprofiler_status_t;
|
||||
|
||||
/**
|
||||
* @brief Buffer record categories. This enumeration type is encoded in @ref
|
||||
* rocprofiler_record_header_t category field
|
||||
* @brief Buffer record categories. This enumeration type is encoded in
|
||||
* ::rocprofiler_record_header_t category field
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_buffer_category_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_BUFFER_CATEGORY_NONE = 0,
|
||||
ROCPROFILER_BUFFER_CATEGORY_TRACING,
|
||||
@@ -126,7 +122,7 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
/**
|
||||
* @brief Agent type.
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_agent_type_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_AGENT_TYPE_NONE = 0, ///< Agent type is unknown
|
||||
ROCPROFILER_AGENT_TYPE_CPU, ///< Agent type is a CPU
|
||||
@@ -137,7 +133,7 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
/**
|
||||
* @brief Service Callback Phase.
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_callback_phase_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_CALLBACK_PHASE_NONE = 0, ///< Callback has no phase
|
||||
ROCPROFILER_CALLBACK_PHASE_ENTER, ///< Callback invoked prior to function execution
|
||||
@@ -152,7 +148,7 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
/**
|
||||
* @brief Service Callback Tracing Kind. @see rocprofiler_configure_callback_tracing_service.
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_callback_tracing_kind_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_CALLBACK_TRACING_NONE = 0,
|
||||
ROCPROFILER_CALLBACK_TRACING_HSA_CORE_API, ///< @see ::rocprofiler_hsa_core_api_id_t
|
||||
@@ -178,15 +174,14 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
///< library has been initialized
|
||||
ROCPROFILER_CALLBACK_TRACING_ROCDECODE_API, ///< rocDecode API Tracing
|
||||
ROCPROFILER_CALLBACK_TRACING_ROCJPEG_API, ///< rocJPEG API Tracing
|
||||
ROCPROFILER_CALLBACK_TRACING_HIP_STREAM_API, ///< @see
|
||||
///< ::rocprofiler_hip_stream_operation_t
|
||||
ROCPROFILER_CALLBACK_TRACING_HIP_STREAM, ///< @see ::rocprofiler_hip_stream_operation_t
|
||||
ROCPROFILER_CALLBACK_TRACING_LAST,
|
||||
} rocprofiler_callback_tracing_kind_t;
|
||||
|
||||
/**
|
||||
* @brief Service Buffer Tracing Kind. @see rocprofiler_configure_buffer_tracing_service.
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_buffer_tracing_kind_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_BUFFER_TRACING_NONE = 0,
|
||||
ROCPROFILER_BUFFER_TRACING_HSA_CORE_API, ///< @see ::rocprofiler_hsa_core_api_id_t
|
||||
@@ -211,9 +206,9 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
ROCPROFILER_BUFFER_TRACING_RUNTIME_INITIALIZATION, ///< Record indicating a runtime library has
|
||||
///< been initialized. @see
|
||||
///< ::rocprofiler_runtime_initialization_operation_t
|
||||
ROCPROFILER_BUFFER_TRACING_ROCDECODE_API, ///< rocDecode tracing
|
||||
ROCPROFILER_BUFFER_TRACING_ROCJPEG_API, ///< rocJPEG tracing
|
||||
ROCPROFILER_BUFFER_TRACING_HIP_STREAM_API, ///< Display HIP Stream
|
||||
ROCPROFILER_BUFFER_TRACING_ROCDECODE_API, ///< rocDecode tracing
|
||||
ROCPROFILER_BUFFER_TRACING_ROCJPEG_API, ///< rocJPEG tracing
|
||||
ROCPROFILER_BUFFER_TRACING_HIP_STREAM, ///< @see ::rocprofiler_hip_stream_operation_t
|
||||
ROCPROFILER_BUFFER_TRACING_HIP_RUNTIME_API_EXT,
|
||||
ROCPROFILER_BUFFER_TRACING_HIP_COMPILER_API_EXT,
|
||||
ROCPROFILER_BUFFER_TRACING_LAST,
|
||||
@@ -229,7 +224,7 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
/**
|
||||
* @brief ROCProfiler Code Object Tracer Operations.
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_code_object_operation_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_CODE_OBJECT_NONE = 0, ///< Unknown code object operation
|
||||
ROCPROFILER_CODE_OBJECT_LOAD, ///< Code object containing kernel symbols
|
||||
@@ -239,9 +234,10 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
} rocprofiler_code_object_operation_t;
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler Stream Handle Operations.
|
||||
* @brief ROCProfiler HIP Stream Operations. These operations can be used to associate subsequent
|
||||
* information with a HIP stream
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_hip_stream_operation_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_HIP_STREAM_NONE = 0, ///< Unknown stream handle operation
|
||||
ROCPROFILER_HIP_STREAM_CREATE, ///< A stream handle is created
|
||||
@@ -258,7 +254,7 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
/**
|
||||
* @brief Memory Copy Operations.
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_memory_copy_operation_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_MEMORY_COPY_NONE = 0, ///< Unknown memory copy direction
|
||||
ROCPROFILER_MEMORY_COPY_HOST_TO_HOST, ///< Memory copy from host to host
|
||||
@@ -271,7 +267,7 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
/**
|
||||
* @brief Memory Allocation Operation.
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_memory_allocation_operation_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_MEMORY_ALLOCATION_NONE = 0, ///< Unknown memory allocation function
|
||||
ROCPROFILER_MEMORY_ALLOCATION_ALLOCATE, ///< Allocate memory function
|
||||
@@ -284,7 +280,7 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
/**
|
||||
* @brief ROCProfiler Kernel Dispatch Tracing Operation Types.
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_kernel_dispatch_operation_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_KERNEL_DISPATCH_NONE = 0, ///< Unknown kernel dispatch operation
|
||||
ROCPROFILER_KERNEL_DISPATCH_ENQUEUE = 1,
|
||||
@@ -330,7 +326,7 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
/**
|
||||
* @brief PC Sampling Method.
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_pc_sampling_method_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_PC_SAMPLING_METHOD_NONE = 0, ///< Unknown sampling type
|
||||
ROCPROFILER_PC_SAMPLING_METHOD_STOCHASTIC, ///< Stochastic sampling (MI300+)
|
||||
@@ -341,7 +337,7 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
/**
|
||||
* @brief PC Sampling Unit.
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_pc_sampling_unit_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_PC_SAMPLING_UNIT_NONE = 0, ///< Sample interval has unspecified units
|
||||
ROCPROFILER_PC_SAMPLING_UNIT_INSTRUCTIONS, ///< Sample interval is in instructions
|
||||
@@ -353,7 +349,7 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
/**
|
||||
* @brief Actions when Buffer is full.
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_buffer_policy_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_BUFFER_POLICY_NONE = 0, ///< No policy has been set
|
||||
ROCPROFILER_BUFFER_POLICY_DISCARD, ///< Drop records when buffer is full
|
||||
@@ -364,7 +360,7 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
/**
|
||||
* @brief Page migration event.
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_page_migration_operation_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_PAGE_MIGRATION_NONE = 0, ///< Unknown event
|
||||
ROCPROFILER_PAGE_MIGRATION_PAGE_MIGRATE_START,
|
||||
@@ -381,7 +377,7 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
/**
|
||||
* @brief Scratch event kind
|
||||
*/
|
||||
typedef enum
|
||||
typedef enum rocprofiler_scratch_memory_operation_t
|
||||
{
|
||||
ROCPROFILER_SCRATCH_MEMORY_NONE = 0, ///< Unknown scratch operation
|
||||
ROCPROFILER_SCRATCH_MEMORY_ALLOC, ///< Scratch memory allocation event
|
||||
@@ -394,7 +390,7 @@ typedef enum
|
||||
* @brief Enumeration for specifying runtime libraries supported by rocprofiler. This enumeration is
|
||||
* used for thread creation callbacks. @see INTERNAL_THREADING.
|
||||
*/
|
||||
typedef enum
|
||||
typedef enum rocprofiler_runtime_library_t
|
||||
{
|
||||
ROCPROFILER_LIBRARY = (1 << 0),
|
||||
ROCPROFILER_HSA_LIBRARY = (1 << 1),
|
||||
@@ -410,7 +406,7 @@ typedef enum
|
||||
* @brief Enumeration for specifying intercept tables supported by rocprofiler. This enumeration is
|
||||
* used for intercept tables. @see INTERCEPT_TABLE.
|
||||
*/
|
||||
typedef enum
|
||||
typedef enum rocprofiler_intercept_table_t
|
||||
{
|
||||
ROCPROFILER_HSA_TABLE = (1 << 0),
|
||||
ROCPROFILER_HIP_RUNTIME_TABLE = (1 << 1),
|
||||
@@ -427,7 +423,7 @@ typedef enum
|
||||
/**
|
||||
* @brief ROCProfiler Runtime Initialization Tracer Operations.
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_runtime_initialization_operation_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_RUNTIME_INITIALIZATION_NONE = 0, ///< Unknown runtime initialization
|
||||
ROCPROFILER_RUNTIME_INITIALIZATION_HSA, ///< Application loaded HSA runtime
|
||||
@@ -442,10 +438,11 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
/**
|
||||
* @brief Enumeration for specifying the counter info struct version you want.
|
||||
*/
|
||||
typedef enum
|
||||
typedef enum rocprofiler_counter_info_version_id_t
|
||||
{
|
||||
ROCPROFILER_COUNTER_INFO_VERSION_NONE,
|
||||
ROCPROFILER_COUNTER_INFO_VERSION_0, ///< @see ::rocprofiler_counter_info_v0_t
|
||||
ROCPROFILER_COUNTER_INFO_VERSION_1, ///< @see ::rocprofiler_counter_info_v1_t
|
||||
ROCPROFILER_COUNTER_INFO_VERSION_LAST,
|
||||
} rocprofiler_counter_info_version_id_t;
|
||||
|
||||
@@ -453,7 +450,7 @@ typedef enum
|
||||
* @brief Enumeration for distinguishing different buffer record kinds within the
|
||||
* ::ROCPROFILER_BUFFER_CATEGORY_COUNTERS category
|
||||
*/
|
||||
typedef enum
|
||||
typedef enum rocprofiler_counter_record_kind_t
|
||||
{
|
||||
ROCPROFILER_COUNTER_RECORD_NONE = 0,
|
||||
ROCPROFILER_COUNTER_RECORD_PROFILE_COUNTING_DISPATCH_HEADER, ///< ::rocprofiler_dispatch_counting_service_record_t
|
||||
@@ -468,7 +465,7 @@ typedef enum
|
||||
/**
|
||||
* @brief Enumeration of flags that can be used with some counter api calls
|
||||
*/
|
||||
typedef enum
|
||||
typedef enum rocprofiler_counter_flag_t
|
||||
{
|
||||
ROCPROFILER_COUNTER_FLAG_NONE = 0,
|
||||
ROCPROFILER_COUNTER_FLAG_ASYNC, ///< Do not wait for completion before returning.
|
||||
@@ -481,7 +478,7 @@ typedef enum
|
||||
* @brief Enumeration for distinguishing different buffer record kinds within the
|
||||
* ::ROCPROFILER_BUFFER_CATEGORY_PC_SAMPLING category
|
||||
*/
|
||||
typedef enum
|
||||
typedef enum rocprofiler_pc_sampling_record_kind_t
|
||||
{
|
||||
ROCPROFILER_PC_SAMPLING_RECORD_NONE = 0,
|
||||
ROCPROFILER_PC_SAMPLING_RECORD_INVALID_SAMPLE, ///< ::rocprofiler_pc_sampling_record_invalid_t
|
||||
@@ -584,6 +581,16 @@ typedef union rocprofiler_uuid_t
|
||||
//
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
/**
|
||||
* @brief Versioning info.
|
||||
*/
|
||||
typedef struct rocprofiler_version_triplet_t
|
||||
{
|
||||
uint32_t major;
|
||||
uint32_t minor;
|
||||
uint32_t patch;
|
||||
} rocprofiler_version_triplet_t;
|
||||
|
||||
/**
|
||||
* @brief Context ID.
|
||||
*/
|
||||
@@ -679,12 +686,12 @@ typedef struct rocprofiler_counter_id_t
|
||||
|
||||
/**
|
||||
* @brief Profile Configurations
|
||||
* @see rocprofiler_create_profile_config for how to create.
|
||||
* @see rocprofiler_create_counter_config for how to create.
|
||||
*/
|
||||
typedef struct rocprofiler_profile_config_id_t
|
||||
typedef struct rocprofiler_counter_config_id_t
|
||||
{
|
||||
uint64_t handle; // Opaque handle
|
||||
} rocprofiler_profile_config_id_t;
|
||||
} rocprofiler_counter_config_id_t;
|
||||
|
||||
/**
|
||||
* @brief Multi-dimensional struct of data used to describe GPU workgroup and grid sizes
|
||||
@@ -740,13 +747,13 @@ typedef struct rocprofiler_callback_tracing_record_t
|
||||
*
|
||||
* @endcode
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_record_header_t
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint32_t category; ///< rocprofiler_buffer_category_t
|
||||
uint32_t category; ///< ::rocprofiler_buffer_category_t
|
||||
uint32_t kind; ///< domain
|
||||
};
|
||||
uint64_t hash; ///< generic identifier. You can compute this via: `uint64_t hash = category
|
||||
@@ -756,12 +763,12 @@ typedef struct
|
||||
} rocprofiler_record_header_t;
|
||||
|
||||
/**
|
||||
* @brief Function for computing the unsigned 64-bit hash value in @ref rocprofiler_record_header_t
|
||||
* @brief Function for computing the unsigned 64-bit hash value in ::rocprofiler_record_header_t
|
||||
* from a category and kind (two unsigned 32-bit values)
|
||||
*
|
||||
* @param [in] category a value from @ref rocprofiler_buffer_category_t
|
||||
* @param [in] kind depending on the category, this is the domain value, e.g., @ref
|
||||
* rocprofiler_buffer_tracing_kind_t value
|
||||
* @param [in] category a value from ::rocprofiler_buffer_category_t
|
||||
* @param [in] kind depending on the category, this is the domain value, e.g.,
|
||||
* ::rocprofiler_buffer_tracing_kind_t value
|
||||
* @return uint64_t hash value of category and kind
|
||||
*/
|
||||
static inline uint64_t
|
||||
@@ -801,20 +808,22 @@ typedef struct rocprofiler_kernel_dispatch_info_t
|
||||
/**
|
||||
* @brief Details for the dimension, including its size, for a counter record.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_counter_record_dimension_info_t
|
||||
{
|
||||
const char* name;
|
||||
size_t instance_size;
|
||||
rocprofiler_counter_dimension_id_t id;
|
||||
|
||||
/// @var id
|
||||
/// @brief Id for this dimension used by @ref rocprofiler_query_record_dimension_position
|
||||
} rocprofiler_record_dimension_info_t;
|
||||
/// @brief Id for this dimension used by ::rocprofiler_query_record_dimension_position
|
||||
} 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.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_counter_record_t
|
||||
{
|
||||
rocprofiler_counter_instance_id_t id; ///< counter identifier
|
||||
double counter_value; ///< counter value
|
||||
@@ -831,27 +840,15 @@ typedef struct
|
||||
/// 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).
|
||||
} rocprofiler_record_counter_t;
|
||||
} rocprofiler_counter_record_t;
|
||||
|
||||
/**
|
||||
* @brief Counter info struct version 0
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
rocprofiler_counter_id_t id; ///< Id of this counter
|
||||
const char* name; ///< Name of the counter
|
||||
const char* description; ///< Description of the counter
|
||||
const char* block; ///< Block of the counter (non-derived only)
|
||||
const char* expression; ///< Counter expression (derived counters only)
|
||||
uint8_t is_constant : 1; ///< If this counter is HW constant
|
||||
uint8_t is_derived : 1; ///< If this counter is a derived counter
|
||||
} rocprofiler_counter_info_v0_t;
|
||||
typedef rocprofiler_counter_record_t rocprofiler_record_counter_t;
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler SPM Record.
|
||||
*
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_spm_record_t
|
||||
{
|
||||
/**
|
||||
* Counters, including identifiers to get counter information and Counters
|
||||
@@ -861,6 +858,14 @@ typedef struct
|
||||
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"
|
||||
ROCPROFILER_SDK_DEPRECATED("profile_config renamed to counter_config")
|
||||
typedef rocprofiler_counter_config_id_t rocprofiler_profile_config_id_t;
|
||||
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
ROCPROFILER_EXTERN_C_FINI
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include <rocprofiler-sdk/defines.h>
|
||||
#include <rocprofiler-sdk/fwd.h>
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
|
||||
#include <hip/hip_runtime.h>
|
||||
#include <hip/hip_runtime_api.h>
|
||||
|
||||
@@ -22,14 +22,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
|
||||
#include <hip/amd_detail/hip_api_trace.hpp>
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler enumeration of HIP Compiler API tracing operations
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_hip_compiler_api_id_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_HIP_COMPILER_API_ID_NONE = -1,
|
||||
ROCPROFILER_HIP_COMPILER_API_ID___hipPopCallConfiguration = 0,
|
||||
|
||||
@@ -22,14 +22,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
|
||||
#include <hip/amd_detail/hip_api_trace.hpp>
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler enumeration of HIP runtime API tracing operations
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_hip_runtime_api_id_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_HIP_RUNTIME_API_ID_NONE = -1,
|
||||
ROCPROFILER_HIP_RUNTIME_API_ID_hipApiName = 0,
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#pragma once
|
||||
|
||||
// NOLINTNEXTLINE(performance-enum-size)
|
||||
typedef enum
|
||||
typedef enum rocprofiler_hip_table_id_t
|
||||
{
|
||||
ROCPROFILER_HIP_TABLE_ID_NONE = -1,
|
||||
ROCPROFILER_HIP_TABLE_ID_Compiler = 0,
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/ext_version.h>
|
||||
#include <rocprofiler-sdk/hsa/api_trace_version.h>
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler enumeration of HSA AMD Extended API tracing operations
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_hsa_amd_ext_api_id_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_HSA_AMD_EXT_API_ID_NONE = -1,
|
||||
ROCPROFILER_HSA_AMD_EXT_API_ID_hsa_amd_coherency_get_type,
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/defines.h>
|
||||
#include <rocprofiler-sdk/ext_version.h>
|
||||
#include <rocprofiler-sdk/hsa/api_trace_version.h>
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
|
||||
#include <hsa/hsa.h>
|
||||
#include <hsa/hsa_ext_amd.h>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
#include <rocprofiler-sdk/ext_version.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
# include <hsa/hsa_api_trace.h> // safe to include from C++
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
#include <rocprofiler-sdk/ext_version.h>
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler enumeration of HSA Core API tracing operations
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_hsa_core_api_id_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_HSA_CORE_API_ID_NONE = -1,
|
||||
ROCPROFILER_HSA_CORE_API_ID_hsa_init = 0,
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
#include <rocprofiler-sdk/ext_version.h>
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler enumeration of HSA Image Extended API tracing operations
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_hsa_finalize_ext_api_id_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_HSA_FINALIZE_EXT_API_ID_NONE = -1,
|
||||
ROCPROFILER_HSA_FINALIZE_EXT_API_ID_hsa_ext_program_create = 0,
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
#include <rocprofiler-sdk/ext_version.h>
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler enumeration of HSA Image Extended API tracing operations
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_hsa_image_ext_api_id_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_HSA_IMAGE_EXT_API_ID_NONE = -1,
|
||||
ROCPROFILER_HSA_IMAGE_EXT_API_ID_hsa_ext_image_get_capability,
|
||||
|
||||
@@ -23,11 +23,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/defines.h>
|
||||
#include <rocprofiler-sdk/hsa/api_trace_version.h>
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
|
||||
#include <hsa/hsa.h>
|
||||
#include <hsa/hsa_amd_tool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
ROCPROFILER_EXTERN_C_INIT
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
* @brief Allocation flags for @see rocprofiler_buffer_tracing_scratch_memory_record_t
|
||||
*/
|
||||
// NOLINTNEXTLINE(performance-enum-size)
|
||||
typedef enum
|
||||
typedef enum rocprofiler_scratch_alloc_flag_t
|
||||
{
|
||||
ROCPROFILER_SCRATCH_ALLOC_FLAG_NONE = 0,
|
||||
ROCPROFILER_SCRATCH_ALLOC_FLAG_USE_ONCE =
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#pragma once
|
||||
|
||||
// NOLINTNEXTLINE(performance-enum-size)
|
||||
typedef enum
|
||||
typedef enum rocprofiler_hsa_table_id_t
|
||||
{
|
||||
ROCPROFILER_HSA_TABLE_ID_NONE = -1,
|
||||
ROCPROFILER_HSA_TABLE_ID_Core = 0,
|
||||
|
||||
@@ -49,17 +49,18 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Callback type when a new runtime library is loaded. @see
|
||||
* @brief (experimental) Callback type when a new runtime library is loaded. @see
|
||||
* rocprofiler_at_intercept_table_registration
|
||||
* @param [in] type Type of API table
|
||||
* @param [in] lib_version Major, minor, and patch version of library encoded into single number
|
||||
* similar to @ref ROCPROFILER_VERSION
|
||||
* similar to ::ROCPROFILER_VERSION
|
||||
* @param [in] lib_instance The number of times this runtime library has been registered previously
|
||||
* @param [in] tables An array of pointers to the API tables
|
||||
* @param [in] num_tables The size of the array of pointers to the API tables
|
||||
* @param [in] user_data The pointer to the data provided to @ref
|
||||
* rocprofiler_at_intercept_table_registration
|
||||
* @param [in] user_data The pointer to the data provided to
|
||||
* ::rocprofiler_at_intercept_table_registration
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
typedef void (*rocprofiler_intercept_library_cb_t)(rocprofiler_intercept_table_t type,
|
||||
uint64_t lib_version,
|
||||
uint64_t lib_instance,
|
||||
@@ -68,10 +69,10 @@ typedef void (*rocprofiler_intercept_library_cb_t)(rocprofiler_intercept_table_t
|
||||
void* user_data);
|
||||
|
||||
/**
|
||||
* @brief Invoke this function to receive callbacks when a ROCm library registers its API
|
||||
* intercept table with rocprofiler. Use the @ref rocprofiler_intercept_table_t enumeration for
|
||||
* specifying which raw API tables the tool would like to have access to. E.g. including @ref
|
||||
* ROCPROFILER_HSA_TABLE in the @ref rocprofiler_at_intercept_table_registration function call
|
||||
* @brief (experimental) Invoke this function to receive callbacks when a ROCm library registers its
|
||||
* API intercept table with rocprofiler. Use the ::rocprofiler_intercept_table_t enumeration for
|
||||
* specifying which raw API tables the tool would like to have access to. E.g. including
|
||||
* ::ROCPROFILER_HSA_TABLE in the ::rocprofiler_at_intercept_table_registration function call
|
||||
* communicates to rocprofiler that, when rocprofiler receives a `HsaApiTable` instance, the tool
|
||||
* would like rocprofiler to provide it access too.
|
||||
*
|
||||
@@ -79,23 +80,23 @@ typedef void (*rocprofiler_intercept_library_cb_t)(rocprofiler_intercept_table_t
|
||||
* invocation of one of their public API functions), these runtimes will provide a table of function
|
||||
* pointers to the rocprofiler library via the rocprofiler-register library if the
|
||||
* `rocprofiler_configure` symbol is visible in the application's symbol table. The vast majority of
|
||||
* tools will want to use the @ref CALLBACK_TRACING_SERVICE to trace these runtime APIs, however,
|
||||
* tools will want to use the ::CALLBACK_TRACING_SERVICE to trace these runtime APIs, however,
|
||||
* some tools may want or require installing their own intercept functions in lieu of receiving
|
||||
* these callbacks and those tools should use the @ref rocprofiler_at_intercept_table_registration
|
||||
* these callbacks and those tools should use the ::rocprofiler_at_intercept_table_registration
|
||||
* to install their intercept functions. There are no restrictions to where or how early this
|
||||
* function can be invoked but it will return ::ROCPROFILER_STATUS_ERROR_CONFIGURATION_LOCKED if it
|
||||
* is invoked after rocprofiler has requested all the tool configurations. Thus, it is highly
|
||||
* recommended to invoke this function within the @ref rocprofiler_configure function or the
|
||||
* callback passed to the @ref rocprofiler_force_configure function -- the reason for this
|
||||
* recommendation is that if @ref rocprofiler_at_intercept_table_registration is invoked in one of
|
||||
* recommended to invoke this function within the ::rocprofiler_configure function or the
|
||||
* callback passed to the ::rocprofiler_force_configure function -- the reason for this
|
||||
* recommendation is that if ::rocprofiler_at_intercept_table_registration is invoked in one of
|
||||
* these locations, rocprofiler can guarantee that the tool will be passed the API table because, at
|
||||
* the first instance of a runtime registering it's API table, rocprofiler will ensure that, in the
|
||||
* case of the former, rocprofiler will invoke all of the @ref rocprofiler_configure symbols that
|
||||
* case of the former, rocprofiler will invoke all of the ::rocprofiler_configure symbols that
|
||||
* are visible before checking the list of tools which want to receive the API tables and, in the
|
||||
* case of the latter, @ref rocprofiler_force_configure will fail with error code @ref
|
||||
* ROCPROFILER_STATUS_ERROR_CONFIGURATION_LOCKED if a runtime has already been registered (and,
|
||||
* therefore, already scanned and invoked the visible @ref rocprofiler_configure symbols and
|
||||
* completed the tool initialization). If @ref rocprofiler_at_intercept_table_registration is
|
||||
* case of the latter, ::rocprofiler_force_configure will fail with error code
|
||||
* ::ROCPROFILER_STATUS_ERROR_CONFIGURATION_LOCKED if a runtime has already been registered (and,
|
||||
* therefore, already scanned and invoked the visible ::rocprofiler_configure symbols and
|
||||
* completed the tool initialization). If ::rocprofiler_at_intercept_table_registration is
|
||||
* invoked outside of these recommended places, even if it is done before the `main` function starts
|
||||
* (e.g. in a library init/constructor function), it is possible that another library, such as
|
||||
* ROCm-aware MPI, caused the HIP and HSA runtime libraries to be initialized when that library was
|
||||
@@ -212,8 +213,9 @@ typedef void (*rocprofiler_intercept_library_cb_t)(rocprofiler_intercept_table_t
|
||||
* @endcode
|
||||
*
|
||||
* @example intercept_table/client.cpp
|
||||
* Example demonstrating @ref rocprofiler_at_intercept_table_registration usage
|
||||
* Example demonstrating ::rocprofiler_at_intercept_table_registration usage
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
rocprofiler_status_t
|
||||
rocprofiler_at_intercept_table_registration(rocprofiler_intercept_library_cb_t callback,
|
||||
int libs,
|
||||
|
||||
@@ -33,23 +33,25 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
*
|
||||
* @{
|
||||
* @example api_buffered_tracing/client.cpp
|
||||
* Example demonstrating @ref BUFFER_TRACING_SERVICE that includes usage of @ref
|
||||
* rocprofiler_at_internal_thread_create, @ref rocprofiler_create_callback_thread, and @ref
|
||||
* rocprofiler_assign_callback_thread.
|
||||
* Example demonstrating ::BUFFER_TRACING_SERVICE that includes usage of
|
||||
* ::rocprofiler_at_internal_thread_create, ::rocprofiler_create_callback_thread, and
|
||||
* ::rocprofiler_assign_callback_thread.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Callback type before and after internal thread creation. @see
|
||||
* @brief (experimental) Callback type before and after internal thread creation. @see
|
||||
* rocprofiler_at_internal_thread_create
|
||||
*
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
typedef void (*rocprofiler_internal_thread_library_cb_t)(rocprofiler_runtime_library_t, void*);
|
||||
|
||||
/**
|
||||
* @brief Invoke this function to receive callbacks before and after the creation of an internal
|
||||
* thread by a library which as invoked on the thread which is creating the internal thread(s).
|
||||
* @brief (experimental) Invoke this function to receive callbacks before and after the creation of
|
||||
* an internal thread by a library which as invoked on the thread which is creating the internal
|
||||
* thread(s).
|
||||
*
|
||||
* Use the @ref rocprofiler_runtime_library_t enumeration for specifying which libraries you want
|
||||
* Use the ::rocprofiler_runtime_library_t enumeration for specifying which libraries you want
|
||||
* callbacks before and after the library creates an internal thread. These callbacks will be
|
||||
* invoked on the thread that is about to create the new thread (not on the newly created thread).
|
||||
* In thread-aware tools that wrap pthread_create, this can be used to disable the wrapper before
|
||||
@@ -74,6 +76,7 @@ typedef void (*rocprofiler_internal_thread_library_cb_t)(rocprofiler_runtime_lib
|
||||
* @retval ::ROCPROFILER_STATUS_SUCCESS There are currently no conditions which result in any other
|
||||
* value, even if internal threads have already been created
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
rocprofiler_status_t
|
||||
rocprofiler_at_internal_thread_create(rocprofiler_internal_thread_library_cb_t precreate,
|
||||
rocprofiler_internal_thread_library_cb_t postcreate,
|
||||
@@ -81,38 +84,40 @@ rocprofiler_at_internal_thread_create(rocprofiler_internal_thread_library_cb_t p
|
||||
void* data) ROCPROFILER_API;
|
||||
|
||||
/**
|
||||
* @brief opaque handle to an internal thread identifier which delivers callbacks for buffers
|
||||
* @brief (experimental) opaque handle to an internal thread identifier which delivers callbacks for
|
||||
* buffers
|
||||
* @see rocprofiler_create_callback_thread
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_callback_thread_t
|
||||
{
|
||||
uint64_t handle;
|
||||
} rocprofiler_callback_thread_t;
|
||||
|
||||
/**
|
||||
* @brief Create a handle to a unique thread (created by rocprofiler) which, when associated with a
|
||||
* particular buffer, will guarantee those buffered results always get delivered on the same thread.
|
||||
* This is useful to prevent/control thread-safety issues and/or enable multithreaded processing of
|
||||
* buffers with non-overlapping data
|
||||
* @brief (experimental) Create a handle to a unique thread (created by rocprofiler) which, when
|
||||
* associated with a particular buffer, will guarantee those buffered results always get delivered
|
||||
* on the same thread. This is useful to prevent/control thread-safety issues and/or enable
|
||||
* multithreaded processing of buffers with non-overlapping data
|
||||
*
|
||||
* @param [in] cb_thread_id User-provided pointer to a @ref rocprofiler_callback_thread_t
|
||||
* @param [in] cb_thread_id User-provided pointer to a ::rocprofiler_callback_thread_t
|
||||
* @return ::rocprofiler_status_t
|
||||
* @retval ::ROCPROFILER_STATUS_SUCCESS Successful thread creation
|
||||
* @retval ::ROCPROFILER_STATUS_ERROR_CONFIGURATION_LOCKED Thread creation is no longer available
|
||||
* post-initialization
|
||||
* @retval ::ROCPROFILER_STATUS_ERROR Failed to create thread
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
rocprofiler_status_t
|
||||
rocprofiler_create_callback_thread(rocprofiler_callback_thread_t* cb_thread_id) ROCPROFILER_API
|
||||
ROCPROFILER_NONNULL(1);
|
||||
|
||||
/**
|
||||
* @brief By default, all buffered results are delivered on the same thread. Using @ref
|
||||
* rocprofiler_create_callback_thread, one or more buffers can be assigned to deliever their results
|
||||
* on a unique, dedicated thread.
|
||||
* @brief (experimental) By default, all buffered results are delivered on the same thread. Using
|
||||
* ::rocprofiler_create_callback_thread, one or more buffers can be assigned to deliever their
|
||||
* results on a unique, dedicated thread.
|
||||
*
|
||||
* @param [in] buffer_id Buffer identifier
|
||||
* @param [in] cb_thread_id Callback thread identifier via @ref rocprofiler_create_callback_thread
|
||||
* @param [in] cb_thread_id Callback thread identifier via ::rocprofiler_create_callback_thread
|
||||
* @return ::rocprofiler_status_t
|
||||
* @retval ::ROCPROFILER_STATUS_SUCCESS Successful assignment of the delivery thread for the given
|
||||
* buffer
|
||||
@@ -123,6 +128,7 @@ rocprofiler_create_callback_thread(rocprofiler_callback_thread_t* cb_thread_id)
|
||||
* @retval ::ROCPROFILER_STATUS_ERROR_BUFFER_NOT_FOUND Buffer identifier did not match any of the
|
||||
* buffers registered with rocprofiler
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
rocprofiler_status_t
|
||||
rocprofiler_assign_callback_thread(rocprofiler_buffer_id_t buffer_id,
|
||||
rocprofiler_callback_thread_t cb_thread_id) ROCPROFILER_API;
|
||||
|
||||
@@ -94,7 +94,7 @@ typedef struct rocprofiler_page_migration_dropped_event_t
|
||||
uint32_t dropped_events_count;
|
||||
} rocprofiler_page_migration_dropped_event_t;
|
||||
|
||||
typedef union
|
||||
typedef union rocprofiler_page_migration_args_t
|
||||
{
|
||||
rocprofiler_page_migration_none_t none;
|
||||
rocprofiler_page_migration_page_migrate_start_t page_migrate_start;
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <rocprofiler-sdk/fwd.h>
|
||||
#include <rocprofiler-sdk/hsa.h>
|
||||
#include <rocprofiler-sdk/hsa/api_trace_version.h>
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -36,7 +35,7 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
* @brief Page migration triggers
|
||||
*
|
||||
*/
|
||||
typedef enum
|
||||
typedef enum rocprofiler_page_migration_trigger_t
|
||||
{
|
||||
ROCPROFILER_PAGE_MIGRATION_TRIGGER_NONE = -1,
|
||||
ROCPROFILER_PAGE_MIGRATION_TRIGGER_PREFETCH, ///< Migration triggered by a prefetch
|
||||
@@ -51,7 +50,7 @@ typedef enum
|
||||
* @brief Page migration triggers causing the queue to suspend
|
||||
*
|
||||
*/
|
||||
typedef enum
|
||||
typedef enum rocprofiler_page_migration_queue_suspend_trigger_t
|
||||
{
|
||||
ROCPROFILER_PAGE_MIGRATION_QUEUE_SUSPEND_TRIGGER_NONE = -1,
|
||||
ROCPROFILER_PAGE_MIGRATION_QUEUE_SUSPEND_TRIGGER_SVM,
|
||||
@@ -71,7 +70,7 @@ typedef enum
|
||||
* @brief Page migration triggers causing an unmap from the GPU
|
||||
*
|
||||
*/
|
||||
typedef enum
|
||||
typedef enum rocprofiler_page_migration_unmap_from_gpu_trigger_t
|
||||
{
|
||||
ROCPROFILER_PAGE_MIGRATION_UNMAP_FROM_GPU_TRIGGER_NONE = -1,
|
||||
ROCPROFILER_PAGE_MIGRATION_UNMAP_FROM_GPU_TRIGGER_MMU_NOTIFY,
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/defines.h>
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
|
||||
#include <rocprofiler-sdk-roctx/api_trace.h>
|
||||
#include <rocprofiler-sdk-roctx/types.h>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
/**
|
||||
* @brief ROCProfiler enumeration of Marker (ROCTx) API tracing operations
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_marker_core_api_id_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_MARKER_CORE_API_ID_NONE = -1,
|
||||
ROCPROFILER_MARKER_CORE_API_ID_roctxMarkA = 0,
|
||||
@@ -37,7 +37,7 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
ROCPROFILER_MARKER_CORE_API_ID_LAST,
|
||||
} rocprofiler_marker_core_api_id_t;
|
||||
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_marker_control_api_id_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_MARKER_CONTROL_API_ID_NONE = -1,
|
||||
ROCPROFILER_MARKER_CONTROL_API_ID_roctxProfilerPause = 0,
|
||||
@@ -45,7 +45,7 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
ROCPROFILER_MARKER_CONTROL_API_ID_LAST,
|
||||
} rocprofiler_marker_control_api_id_t;
|
||||
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_marker_name_api_id_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_MARKER_NAME_API_ID_NONE = -1,
|
||||
ROCPROFILER_MARKER_NAME_API_ID_roctxNameOsThread = 0,
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#pragma once
|
||||
|
||||
// NOLINTNEXTLINE(performance-enum-size)
|
||||
typedef enum
|
||||
typedef enum rocprofiler_marker_table_id_t
|
||||
{
|
||||
ROCPROFILER_MARKER_TABLE_ID_NONE = -1,
|
||||
ROCPROFILER_MARKER_TABLE_ID_RoctxCore = 0,
|
||||
|
||||
@@ -39,12 +39,40 @@
|
||||
|
||||
ROCPROFILER_EXTERN_C_INIT
|
||||
|
||||
/**
|
||||
* @brief (experimental) Query whether rocprofiler-sdk OMPT implementation has been initialized by
|
||||
* OpenMP runtime.
|
||||
*
|
||||
* @param [out] status Set to 0 if rocprofiler OMPT has not been initialized. Otherwise, set to 1.
|
||||
* @return ::rocprofiler_status_t
|
||||
* @retval ::ROCPROFILER_STATUS_SUCCESS Always returns this value
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
rocprofiler_status_t
|
||||
rocprofiler_ompt_is_initialized(int* status) ROCPROFILER_API ROCPROFILER_NONNULL(1);
|
||||
|
||||
/**
|
||||
* @brief (experimental) Query whether rocprofiler-sdk OMPT implementation has invoked ompt_finalize
|
||||
* function.
|
||||
*
|
||||
* @param [out] status Set to 0 if rocprofiler OMPT has not been finalized. Otherwise, set to 1.
|
||||
* @return ::rocprofiler_status_t
|
||||
* @retval ::ROCPROFILER_STATUS_SUCCESS Always returns this value
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
rocprofiler_status_t
|
||||
rocprofiler_ompt_is_finalized(int* status) ROCPROFILER_API ROCPROFILER_NONNULL(1);
|
||||
|
||||
/**
|
||||
* @brief (experimental) If a tool which contains a "ompt_start_tool" function which is invoked by
|
||||
* the OpenMP runtime but the tool wishes to defer to rocprofiler-sdk to be the OMPT tool, it should
|
||||
* invoke this function from it's `ompt_start_tool` implementation.
|
||||
*
|
||||
* @param [in] omp_version Refer to OpenMP OMPT docs for more information
|
||||
* @param [in] runtime_version Refer to OpenMP OMPT docs for more information
|
||||
* @return ompt_start_tool_result_t*
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
ompt_start_tool_result_t*
|
||||
rocprofiler_ompt_start_tool(unsigned int omp_version, const char* runtime_version) ROCPROFILER_API;
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/defines.h>
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
|
||||
#include <rocprofiler-sdk/ompt/omp-tools.h>
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* @brief ROCProfiler enumeration of OMPT (OpenMP tools) tracing operations
|
||||
* NOTE: These are callbacks into the ROCProfiler SDK from the vendor-provided OMPT implementation
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_ompt_operation_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_OMPT_ID_NONE = -1,
|
||||
ROCPROFILER_OMPT_ID_thread_begin = 0,
|
||||
|
||||
@@ -35,7 +35,8 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Function used to configure the PC sampling service on the GPU agent with @p agent_id.
|
||||
* @brief (experimental) Function used to configure the PC sampling service on the GPU agent with @p
|
||||
* agent_id.
|
||||
*
|
||||
* Prerequisites are the following:
|
||||
* - The client must create a context and supply its @p context_id. By using this context,
|
||||
@@ -114,6 +115,7 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
* setup in the context
|
||||
* @retval ::ROCPROFILER_STATUS_ERROR_INVALID_ARGUMENT function invoked with an invalid argument
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
rocprofiler_status_t
|
||||
rocprofiler_configure_pc_sampling_service(rocprofiler_context_id_t context_id,
|
||||
rocprofiler_agent_id_t agent_id,
|
||||
@@ -124,9 +126,10 @@ rocprofiler_configure_pc_sampling_service(rocprofiler_context_id_t conte
|
||||
int flags) ROCPROFILER_API;
|
||||
|
||||
/**
|
||||
* @brief Enumeration describing values of flags of ::rocprofiler_pc_sampling_configuration_t.
|
||||
* @brief (experimental) Enumeration describing values of flags of
|
||||
* ::rocprofiler_pc_sampling_configuration_t.
|
||||
*/
|
||||
typedef enum rocprofiler_pc_sampling_configuration_flags_t
|
||||
typedef enum ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_pc_sampling_configuration_flags_t
|
||||
{
|
||||
ROCPROFILER_PC_SAMPLING_CONFIGURATION_FLAGS_NONE = 0,
|
||||
ROCPROFILER_PC_SAMPLING_CONFIGURATION_FLAGS_INTERVAL_POW2,
|
||||
@@ -137,9 +140,9 @@ typedef enum rocprofiler_pc_sampling_configuration_flags_t
|
||||
} rocprofiler_pc_sampling_configuration_flags_t;
|
||||
|
||||
/**
|
||||
* @brief PC sampling configuration supported by a GPU agent.
|
||||
* @brief (experimental) PC sampling configuration supported by a GPU agent.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_pc_sampling_configuration_t
|
||||
{
|
||||
uint64_t size; ///< Size of this struct
|
||||
rocprofiler_pc_sampling_method_t method;
|
||||
@@ -165,26 +168,27 @@ typedef struct
|
||||
} rocprofiler_pc_sampling_configuration_t;
|
||||
|
||||
/**
|
||||
* @brief Rocprofiler SDK's callback function to deliver the list of available PC
|
||||
* @brief (experimental) Rocprofiler SDK's callback function to deliver the list of available PC
|
||||
* sampling configurations upon the call to the
|
||||
* @ref rocprofiler_query_pc_sampling_agent_configurations.
|
||||
* ::rocprofiler_query_pc_sampling_agent_configurations.
|
||||
*
|
||||
* @param[out] configs - The array of PC sampling configurations supported by the agent
|
||||
* at the moment of invoking @ref rocprofiler_query_pc_sampling_agent_configurations.
|
||||
* at the moment of invoking ::rocprofiler_query_pc_sampling_agent_configurations.
|
||||
* @param[out] num_config - The number of configurations contained in the underlying array
|
||||
* @p configs.
|
||||
* In case the GPU agent does not support PC sampling, the value is 0.
|
||||
* @param[in] user_data - client's private data passed via
|
||||
* @ref rocprofiler_query_pc_sampling_agent_configurations
|
||||
* ::rocprofiler_query_pc_sampling_agent_configurations
|
||||
* @return ::rocprofiler_status_t
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
typedef rocprofiler_status_t (*rocprofiler_available_pc_sampling_configurations_cb_t)(
|
||||
const rocprofiler_pc_sampling_configuration_t* configs,
|
||||
size_t num_config,
|
||||
void* user_data);
|
||||
|
||||
/**
|
||||
* @brief Query PC Sampling Configuration.
|
||||
* @brief (experimental) Query PC Sampling Configuration.
|
||||
*
|
||||
* Lists PC sampling configurations a GPU agent with @p agent_id supports at the moment
|
||||
* of invoking the function. Delivers configurations via @p cb.
|
||||
@@ -205,6 +209,7 @@ typedef rocprofiler_status_t (*rocprofiler_available_pc_sampling_configurations_
|
||||
* @retval ::ROCPROFILER_STATUS_ERROR a general error caused by the amdgpu driver
|
||||
* @retval ::ROCPROFILER_STATUS_SUCCESS @p cb successfully finished
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
rocprofiler_status_t
|
||||
rocprofiler_query_pc_sampling_agent_configurations(
|
||||
rocprofiler_agent_id_t agent_id,
|
||||
@@ -212,10 +217,10 @@ rocprofiler_query_pc_sampling_agent_configurations(
|
||||
void* user_data) ROCPROFILER_API ROCPROFILER_NONNULL(2, 3);
|
||||
|
||||
/**
|
||||
* @brief Information about the GPU part where wave was executing
|
||||
* @brief (experimental) Information about the GPU part where wave was executing
|
||||
* at the moment of sampling.
|
||||
*/
|
||||
typedef struct rocprofiler_pc_sampling_hw_id_v0_t
|
||||
typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_pc_sampling_hw_id_v0_t
|
||||
{
|
||||
uint64_t chiplet : 6; ///< chiplet index (3 bits allocated by the ROCr runtime)
|
||||
uint64_t wave_id : 7; ///< wave slot index
|
||||
@@ -235,9 +240,9 @@ typedef struct rocprofiler_pc_sampling_hw_id_v0_t
|
||||
} rocprofiler_pc_sampling_hw_id_v0_t;
|
||||
|
||||
/**
|
||||
* @brief Sampled program counter.
|
||||
* @brief (experimental) Sampled program counter.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_pc_t
|
||||
{
|
||||
uint64_t code_object_id;
|
||||
uint64_t code_object_offset;
|
||||
@@ -260,9 +265,9 @@ typedef struct
|
||||
} rocprofiler_pc_t;
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler Host-Trap PC Sampling Record.
|
||||
* @brief (experimental) ROCProfiler Host-Trap PC Sampling Record.
|
||||
*/
|
||||
typedef struct rocprofiler_pc_sampling_record_host_trap_v0_t
|
||||
typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_pc_sampling_record_host_trap_v0_t
|
||||
{
|
||||
uint64_t size; ///< Size of this struct
|
||||
rocprofiler_pc_sampling_hw_id_v0_t hw_id; ///< @see ::rocprofiler_pc_sampling_hw_id_0_t
|
||||
@@ -280,11 +285,11 @@ typedef struct rocprofiler_pc_sampling_record_host_trap_v0_t
|
||||
} rocprofiler_pc_sampling_record_host_trap_v0_t;
|
||||
|
||||
/**
|
||||
* @brief The header of the @ref rocprofiler_pc_sampling_record_stochastic_v0_t, indicating
|
||||
* what fields of the @ref rocprofiler_pc_sampling_record_stochastic_v0_t instance are meaningful
|
||||
* for the sample.
|
||||
* @brief (experimental) The header of the ::rocprofiler_pc_sampling_record_stochastic_v0_t,
|
||||
* indicating what fields of the ::rocprofiler_pc_sampling_record_stochastic_v0_t instance are
|
||||
* meaningful for the sample.
|
||||
*/
|
||||
typedef struct rocprofiler_pc_sampling_record_stochastic_header_t
|
||||
typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_pc_sampling_record_stochastic_header_t
|
||||
{
|
||||
uint8_t has_memory_counter : 1; ///< pc sample provides memory counters information
|
||||
///< via ::rocprofiler_pc_sampling_memory_counters_t
|
||||
@@ -292,9 +297,9 @@ typedef struct rocprofiler_pc_sampling_record_stochastic_header_t
|
||||
} rocprofiler_pc_sampling_record_stochastic_header_t;
|
||||
|
||||
/**
|
||||
* @brief Enumeration describing type of sampled issued instruction.
|
||||
* @brief (experimental) Enumeration describing type of sampled issued instruction.
|
||||
*/
|
||||
typedef enum rocprofiler_pc_sampling_instruction_type_t
|
||||
typedef enum ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_pc_sampling_instruction_type_t
|
||||
{
|
||||
ROCPROFILER_PC_SAMPLING_INSTRUCTION_TYPE_NONE = 0,
|
||||
ROCPROFILER_PC_SAMPLING_INSTRUCTION_TYPE_VALU, ///< vector ALU instruction
|
||||
@@ -322,9 +327,9 @@ typedef enum rocprofiler_pc_sampling_instruction_type_t
|
||||
} rocprofiler_pc_sampling_instruction_type_t;
|
||||
|
||||
/**
|
||||
* @brief Enumeration describing reason for not issuing an instruction.
|
||||
* @brief (experimental) Enumeration describing reason for not issuing an instruction.
|
||||
*/
|
||||
typedef enum rocprofiler_pc_sampling_instruction_not_issued_reason_t
|
||||
typedef enum ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_pc_sampling_instruction_not_issued_reason_t
|
||||
{
|
||||
ROCPROFILER_PC_SAMPLING_INSTRUCTION_NOT_ISSUED_REASON_NONE = 0,
|
||||
ROCPROFILER_PC_SAMPLING_INSTRUCTION_NOT_ISSUED_REASON_NO_INSTRUCTION_AVAILABLE,
|
||||
@@ -354,10 +359,10 @@ typedef enum rocprofiler_pc_sampling_instruction_not_issued_reason_t
|
||||
} rocprofiler_pc_sampling_instruction_not_issued_reason_t;
|
||||
|
||||
/**
|
||||
* @brief Data provided by stochastic sampling hardware.
|
||||
* @brief (experimental) Data provided by stochastic sampling hardware.
|
||||
*
|
||||
*/
|
||||
typedef struct rocprofiler_pc_sampling_snapshot_v0_t
|
||||
typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_pc_sampling_snapshot_v0_t
|
||||
{
|
||||
uint32_t reason_not_issued : 4;
|
||||
uint32_t reserved0 : 1; ///< reserved for future use
|
||||
@@ -390,7 +395,7 @@ typedef struct rocprofiler_pc_sampling_snapshot_v0_t
|
||||
|
||||
/// @var reason_not_issued
|
||||
/// @brief The reason for not issuing an instruction. The field takes one of the value defined
|
||||
/// in @ref ::rocprofiler_pc_sampling_instruction_not_issued_reason_t
|
||||
/// in ::rocprofiler_pc_sampling_instruction_not_issued_reason_t
|
||||
/// @var arb_state_stall_valu
|
||||
/// @brief VALU instruction was stalled when a sample was generated
|
||||
/// @var dual_issue_valu
|
||||
@@ -398,9 +403,9 @@ typedef struct rocprofiler_pc_sampling_snapshot_v0_t
|
||||
} rocprofiler_pc_sampling_snapshot_v0_t;
|
||||
|
||||
/**
|
||||
* @brief Counters of issued but not yet completed instructions.
|
||||
* @brief (experimental) Counters of issued but not yet completed instructions.
|
||||
*/
|
||||
typedef struct rocprofiler_pc_sampling_memory_counters_t
|
||||
typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_pc_sampling_memory_counters_t
|
||||
{
|
||||
uint32_t load_cnt : 6;
|
||||
uint32_t store_cnt : 6;
|
||||
@@ -425,9 +430,9 @@ typedef struct rocprofiler_pc_sampling_memory_counters_t
|
||||
} rocprofiler_pc_sampling_memory_counters_t;
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler Stochastic PC Sampling Record.
|
||||
* @brief (experimental) ROCProfiler Stochastic PC Sampling Record.
|
||||
*/
|
||||
typedef struct rocprofiler_pc_sampling_record_stochastic_v0_t
|
||||
typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_pc_sampling_record_stochastic_v0_t
|
||||
{
|
||||
uint64_t size; ///< Size of this struct
|
||||
rocprofiler_pc_sampling_record_stochastic_header_t flags;
|
||||
@@ -482,33 +487,33 @@ typedef struct rocprofiler_pc_sampling_record_stochastic_v0_t
|
||||
} rocprofiler_pc_sampling_record_stochastic_v0_t;
|
||||
|
||||
/**
|
||||
* @brief Record representing an invalid PC Sampling Record.
|
||||
* @brief (experimental) Record representing an invalid PC Sampling Record.
|
||||
*/
|
||||
typedef struct rocprofiler_pc_sampling_record_invalid_t
|
||||
typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_pc_sampling_record_invalid_t
|
||||
{
|
||||
uint64_t size; ///< Size of the struct
|
||||
} rocprofiler_pc_sampling_record_invalid_t;
|
||||
|
||||
/**
|
||||
* @fn C compatible string representation of the PC sampling instruction type
|
||||
* @brief Return the string encoding of @ref rocprofiler_pc_sampling_instruction_type_t value
|
||||
* @brief (experimental) Return the string encoding of ::rocprofiler_pc_sampling_instruction_type_t
|
||||
* value
|
||||
* @param [in] instruction_type instruction type enum value
|
||||
* @return Will return a nullptr if invalid/unsupported @ref
|
||||
* rocprofiler_pc_sampling_instruction_type_t value is provided.
|
||||
* @return Will return a nullptr if invalid/unsupported ::rocprofiler_pc_sampling_instruction_type_t
|
||||
* value is provided.
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
const char*
|
||||
rocprofiler_get_pc_sampling_instruction_type_name(
|
||||
rocprofiler_pc_sampling_instruction_type_t instruction_type) ROCPROFILER_API;
|
||||
|
||||
/**
|
||||
* @fn C compatible string representation of reason for not issuing an instruciton
|
||||
* @brief Return the string encoding of @ref rocprofiler_pc_sampling_instruction_not_issued_reason_t
|
||||
* value
|
||||
* @brief (experimental) Return the string encoding of
|
||||
* ::rocprofiler_pc_sampling_instruction_not_issued_reason_t value
|
||||
* @param [in] not_issued_reason no issue reason enum value
|
||||
* @return Will return a nullptr if invalid/unsupported @ref
|
||||
* rocprofiler_pc_sampling_instruction_not_issued_reason_t value is provided.
|
||||
* @return Will return a nullptr if invalid/unsupported
|
||||
* ::rocprofiler_pc_sampling_instruction_not_issued_reason_t value is provided.
|
||||
*/
|
||||
const char*
|
||||
ROCPROFILER_SDK_EXPERIMENTAL const char*
|
||||
rocprofiler_get_pc_sampling_instruction_not_issued_reason_name(
|
||||
rocprofiler_pc_sampling_instruction_not_issued_reason_t not_issued_reason) ROCPROFILER_API;
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/defines.h>
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
|
||||
#if !defined(ROCPROFILER_SDK_USE_SYSTEM_RCCL)
|
||||
# if defined __has_include
|
||||
|
||||
@@ -24,12 +24,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler enumeration of HSA Core API tracing operations
|
||||
* @brief ROCProfiler enumeration of RCCL API tracing operations
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_rccl_api_id_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_RCCL_API_ID_NONE = -1,
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#pragma once
|
||||
|
||||
// NOLINTNEXTLINE(performance-enum-size)
|
||||
typedef enum
|
||||
typedef enum rocprofiler_rccl_table_id_t
|
||||
{
|
||||
ROCPROFILER_RCCL_TABLE_ID_NONE = -1,
|
||||
ROCPROFILER_RCCL_TABLE_ID = 0,
|
||||
|
||||
@@ -35,17 +35,18 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief A client refers to an individual or entity engaged in the configuration of ROCprofiler
|
||||
* services. e.g: any third party tool like PAPI or any internal tool (Omnitrace). A pointer to this
|
||||
* data structure is provided to the client tool initialization function. The name member can be set
|
||||
* by the client to assist with debugging (e.g. rocprofiler cannot start your context because there
|
||||
* is a conflicting context started by `<name>` -- at least that is the plan). The handle member is
|
||||
* a unique identifer assigned by rocprofiler for the client and the client can store it and pass it
|
||||
* to the @ref rocprofiler_client_finalize_t function to force finalization (i.e. deactivate all of
|
||||
* it's contexts) for the client.
|
||||
* @brief (experimental) A client refers to an individual or entity engaged in the configuration of
|
||||
* ROCprofiler services. e.g: any third party tool like PAPI or any internal tool (Omnitrace). A
|
||||
* pointer to this data structure is provided to the client tool initialization function. The name
|
||||
* member can be set by the client to assist with debugging (e.g. rocprofiler cannot start your
|
||||
* context because there is a conflicting context started by `<name>` -- at least that is the plan).
|
||||
* The handle member is a unique identifer assigned by rocprofiler for the client and the client can
|
||||
* store it and pass it to the ::rocprofiler_client_finalize_t function to force finalization
|
||||
* (i.e. deactivate all of it's contexts) for the client.
|
||||
*/
|
||||
typedef struct rocprofiler_client_id_t
|
||||
typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_client_id_t
|
||||
{
|
||||
size_t size; ///< size of this struct
|
||||
const char* name; ///< clients should set this value for debugging
|
||||
const uint32_t handle; ///< internal handle
|
||||
} rocprofiler_client_id_t;
|
||||
@@ -127,11 +128,11 @@ rocprofiler_is_finalized(int* status) ROCPROFILER_API ROCPROFILER_NONNULL(1);
|
||||
/**
|
||||
* @brief This is the special function that tools define to enable rocprofiler support. The tool
|
||||
* should return a pointer to
|
||||
* @ref rocprofiler_tool_configure_result_t which will contain a function pointer to (1) an
|
||||
* ::rocprofiler_tool_configure_result_t which will contain a function pointer to (1) an
|
||||
* initialization function where all the contexts are created, (2) a finalization function (if
|
||||
* necessary) which will be invoked when rocprofiler shutdown and, (3) a pointer to any data that
|
||||
* the tool wants communicated between the @ref rocprofiler_tool_configure_result_t::initialize and
|
||||
* @ref rocprofiler_tool_configure_result_t::finalize functions. If the user
|
||||
* the tool wants communicated between the ::rocprofiler_tool_configure_result_t::initialize and
|
||||
* ::rocprofiler_tool_configure_result_t::finalize functions. If the user
|
||||
*
|
||||
* @param [in] version The version of rocprofiler: `(10000 * major) + (100 * minor) + patch`
|
||||
* @param [in] runtime_version String descriptor of the rocprofiler version and other relevant info.
|
||||
@@ -227,7 +228,7 @@ rocprofiler_configure(uint32_t version,
|
||||
// want the symbol to be visible when the user includes the header for the prototype
|
||||
|
||||
/**
|
||||
* @brief Function pointer typedef for @ref rocprofiler_configure function
|
||||
* @brief Function pointer typedef for ::rocprofiler_configure function
|
||||
* @param [in] version The version of rocprofiler: `(10000 * major) + (100 * minor) + patch`
|
||||
* @param [in] runtime_version String descriptor of the rocprofiler version and other relevant info.
|
||||
* @param [in] priority How many client tools were initialized before this client tool
|
||||
@@ -243,7 +244,7 @@ typedef rocprofiler_tool_configure_result_t* (*rocprofiler_configure_func_t)(
|
||||
* @brief Function for explicitly registering a configuration with rocprofiler. This can be invoked
|
||||
* before any ROCm runtimes (lazily) initialize and context(s) can be started before the runtimes
|
||||
* initialize.
|
||||
* @param [in] configure_func Address of @ref rocprofiler_configure function. A null pointer is
|
||||
* @param [in] configure_func Address of ::rocprofiler_configure function. A null pointer is
|
||||
* acceptable if the address is not known
|
||||
* @return ::rocprofiler_status_t
|
||||
* @retval ::ROCPROFILER_STATUS_SUCCESS Registration was successfully triggered.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# Installation of public rocDecode headers
|
||||
#
|
||||
#
|
||||
set(ROCPROFILER_ROCDECODE_HEADER_FILES api_args.h api_id.h table_id.h)
|
||||
set(ROCPROFILER_ROCDECODE_HEADER_FILES api_args.h api_id.h api_trace.h table_id.h)
|
||||
|
||||
install(
|
||||
FILES ${ROCPROFILER_ROCDECODE_HEADER_FILES}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/defines.h>
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
#include <rocprofiler-sdk/rocdecode/api_trace.h>
|
||||
|
||||
#include <rocprofiler-sdk/rocdecode/details/rocdecode_headers.h>
|
||||
|
||||
|
||||
@@ -24,12 +24,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
#include <rocprofiler-sdk/rocdecode/api_trace.h>
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler enumeration of rocDecode API tracing operations
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_rocdecode_api_id_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_ROCDECODE_API_ID_NONE = -1,
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
// MIT License
|
||||
//
|
||||
// Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/rocdecode/details/rocdecode_headers.h>
|
||||
|
||||
#if ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE > 0
|
||||
# include <rocdecode/amd_detail/rocdecode_api_trace.h>
|
||||
#else
|
||||
# include <rocprofiler-sdk/rocdecode/details/rocdecode_api_trace.h>
|
||||
#endif
|
||||
@@ -23,7 +23,7 @@
|
||||
#pragma once
|
||||
|
||||
// NOLINTNEXTLINE(performance-enum-size)
|
||||
typedef enum
|
||||
typedef enum rocprofiler_rocdecode_table_id_t
|
||||
{
|
||||
ROCPROFILER_ROCDECODE_TABLE_ID_NONE = -1,
|
||||
ROCPROFILER_ROCDECODE_TABLE_ID_CORE = 0,
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/defines.h>
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
|
||||
#include <rocprofiler-sdk/rocjpeg/details/rocjpeg_headers.h>
|
||||
|
||||
|
||||
@@ -22,12 +22,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler enumeration of rocJPEG API tracing operations
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
typedef enum rocprofiler_rocjpeg_api_id_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_ROCJPEG_API_ID_NONE = -1,
|
||||
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// NOLINTNEXTLINE(performance-enum-size)
|
||||
typedef enum
|
||||
typedef enum rocprofiler_rocjpeg_table_id_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_ROCJPEG_TABLE_ID_NONE = -1,
|
||||
ROCPROFILER_ROCJPEG_TABLE_ID_CORE = 0,
|
||||
|
||||
@@ -77,9 +77,9 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
* patch)
|
||||
* @brief Query the version of the installed library.
|
||||
*
|
||||
* Return the version of the installed library. This can be used to check if
|
||||
* it is compatible with this interface version. This function can be used
|
||||
* even when the library is not initialized.
|
||||
* Returns the version of the rocprofiler-sdk library loaded at runtime. This can be used to check
|
||||
* if the runtime version is equal to or compatible with the version of rocprofiler-sdk used during
|
||||
* compilation time. This function can be invoked before tool initialization.
|
||||
*
|
||||
* @param [out] major The major version number is stored if non-NULL.
|
||||
* @param [out] minor The minor version number is stored if non-NULL.
|
||||
@@ -88,6 +88,19 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
rocprofiler_status_t
|
||||
rocprofiler_get_version(uint32_t* major, uint32_t* minor, uint32_t* patch) ROCPROFILER_API;
|
||||
|
||||
/**
|
||||
* @brief Simplified alternative to ::rocprofiler_get_version
|
||||
*
|
||||
* Returns the version of the rocprofiler-sdk library loaded at runtime. This can be used to check
|
||||
* if the runtime version is equal to or compatible with the version of rocprofiler-sdk used during
|
||||
* compilation time. This function can be invoked before tool initialization.
|
||||
*
|
||||
* @param [out] info Pointer to version triplet struct which will be populated by the function call.
|
||||
*/
|
||||
rocprofiler_status_t
|
||||
rocprofiler_get_version_triplet(rocprofiler_version_triplet_t* info) ROCPROFILER_API
|
||||
ROCPROFILER_NONNULL(1);
|
||||
|
||||
ROCPROFILER_EXTERN_C_FINI
|
||||
|
||||
/** @} */
|
||||
@@ -97,6 +110,7 @@ ROCPROFILER_EXTERN_C_FINI
|
||||
#include "rocprofiler-sdk/buffer_tracing.h"
|
||||
#include "rocprofiler-sdk/callback_tracing.h"
|
||||
#include "rocprofiler-sdk/context.h"
|
||||
#include "rocprofiler-sdk/counter_config.h"
|
||||
#include "rocprofiler-sdk/counters.h"
|
||||
#include "rocprofiler-sdk/device_counting_service.h"
|
||||
#include "rocprofiler-sdk/dispatch_counting_service.h"
|
||||
@@ -106,10 +120,16 @@ ROCPROFILER_EXTERN_C_FINI
|
||||
#include "rocprofiler-sdk/intercept_table.h"
|
||||
#include "rocprofiler-sdk/internal_threading.h"
|
||||
#include "rocprofiler-sdk/marker.h"
|
||||
#include "rocprofiler-sdk/ompt.h"
|
||||
#include "rocprofiler-sdk/pc_sampling.h"
|
||||
#include "rocprofiler-sdk/profile_config.h"
|
||||
#include "rocprofiler-sdk/rccl.h"
|
||||
#include "rocprofiler-sdk/rocdecode.h"
|
||||
#include "rocprofiler-sdk/rocjpeg.h"
|
||||
// #include "rocprofiler-sdk/spm.h"
|
||||
|
||||
// subject to removal
|
||||
#include "rocprofiler-sdk/deprecated/profile_config.h"
|
||||
|
||||
ROCPROFILER_EXTERN_C_INIT
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,14 +39,15 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
*
|
||||
* @param [in] context_id
|
||||
* @param [in] buffer_id
|
||||
* @param [in] profile_config
|
||||
* @param [in] counter_config
|
||||
* @param [in] interval
|
||||
* @return ::rocprofiler_status_t
|
||||
*/
|
||||
ROCPROFILER_SDK_EXPERIMENTAL
|
||||
rocprofiler_status_t
|
||||
rocprofiler_configure_spm_service(rocprofiler_context_id_t context_id,
|
||||
rocprofiler_buffer_id_t buffer_id,
|
||||
rocprofiler_profile_config_id_t profile_config,
|
||||
rocprofiler_counter_config_id_t counter_config,
|
||||
uint64_t interval) ROCPROFILER_API;
|
||||
|
||||
/** @} */
|
||||
|
||||
@@ -108,32 +108,11 @@
|
||||
// compiler information
|
||||
#define ROCPROFILER_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@"
|
||||
#define ROCPROFILER_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@"
|
||||
|
||||
#define ROCPROFILER_HSA_RUNTIME_VERSION_MAJOR @HSA_RUNTIME_VERSION_MAJOR@
|
||||
#define ROCPROFILER_HSA_RUNTIME_VERSION_MINOR @HSA_RUNTIME_VERSION_MINOR@
|
||||
|
||||
#cmakedefine ROCPROFILER_HSA_API_TABLE_MAJOR_VERSION @ROCPROFILER_HSA_API_TABLE_MAJOR_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_CORE_API_TABLE_MAJOR_VERSION @ROCPROFILER_HSA_CORE_API_TABLE_MAJOR_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_AMD_EXT_API_TABLE_MAJOR_VERSION @ROCPROFILER_HSA_AMD_EXT_API_TABLE_MAJOR_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_FINALIZER_API_TABLE_MAJOR_VERSION @ROCPROFILER_HSA_FINALIZER_API_TABLE_MAJOR_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_IMAGE_API_TABLE_MAJOR_VERSION @ROCPROFILER_HSA_IMAGE_API_TABLE_MAJOR_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_AQLPROFILE_API_TABLE_MAJOR_VERSION @ROCPROFILER_HSA_AQLPROFILE_API_TABLE_MAJOR_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_TOOLS_API_TABLE_MAJOR_VERSION @ROCPROFILER_HSA_TOOLS_API_TABLE_MAJOR_VERSION@
|
||||
|
||||
#cmakedefine ROCPROFILER_HSA_API_TABLE_STEP_VERSION @ROCPROFILER_HSA_API_TABLE_STEP_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_CORE_API_TABLE_STEP_VERSION @ROCPROFILER_HSA_CORE_API_TABLE_STEP_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_AMD_EXT_API_TABLE_STEP_VERSION @ROCPROFILER_HSA_AMD_EXT_API_TABLE_STEP_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_FINALIZER_API_TABLE_STEP_VERSION @ROCPROFILER_HSA_FINALIZER_API_TABLE_STEP_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_IMAGE_API_TABLE_STEP_VERSION @ROCPROFILER_HSA_IMAGE_API_TABLE_STEP_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_AQLPROFILE_API_TABLE_STEP_VERSION @ROCPROFILER_HSA_AQLPROFILE_API_TABLE_STEP_VERSION@
|
||||
#cmakedefine ROCPROFILER_HSA_TOOLS_API_TABLE_STEP_VERSION @ROCPROFILER_HSA_TOOLS_API_TABLE_STEP_VERSION@
|
||||
// clang-format on
|
||||
|
||||
#define ROCPROFILER_VERSION \
|
||||
((10000 * ROCPROFILER_VERSION_MAJOR) + (100 * ROCPROFILER_VERSION_MINOR) + \
|
||||
ROCPROFILER_VERSION_PATCH)
|
||||
|
||||
// latest hsa-runtime version supported
|
||||
#define ROCPROFILER_HSA_RUNTIME_VERSION \
|
||||
((10000 * ROCPROFILER_HSA_RUNTIME_VERSION_MAJOR) + \
|
||||
(100 * ROCPROFILER_HSA_RUNTIME_VERSION_MINOR))
|
||||
// include the external version info
|
||||
#include "ext_version.h"
|
||||
|
||||
Ссылка в новой задаче
Block a user