* Update and rename rocprofiler.h to rocprofiler.h.in

- Removing Service IDs
- Fixing agent_id to be agent

* [0/N] New rocprofiler headers

- created rocprofiler/defines.h
  - ppdef macros
- created rocprofiler/hip.h
  - HIP specific types
- created rocprofiler/hsa.h
  - HSA specific types
- created rocprofiler/marker.h
  - Marker (ROCTx) specific types
- create version.h.in
  - file containing version info
- updated source/lib/rocprofiler/CMakeLists.txt
  - set DEFINE_SYMBOL
  - compile defs provided by rocprofiler::rocprofiler-headers

* [1/N] Update rocprofiler.h

- pragma once
- removed some ppdefs (in version.h.in and defines.h)
- extern "C" after includes
- added *_NONE and *_LAST enum values to all enums
- provided some rocprofiler_status_t enums
- tweaked rocprofiler_agent_type_t enum fields
- tweaked rocprofiler_agent_info_t enum fields
- provided rocprofiler_tracer_activity_domain_t
- added missing rocprofiler_counter_instance_id_t typedef
  - may not be correct
- provided rocprofiler_record_header_t struct
- provided rocprofiler_record_tracer_t struct
- add ROCPROFILER_NONNULL attribute where appropriate
- CMakeLists.txt: add subdirectories for hsa, hip, and marker
- defines.h: remove ROCPROFILER_CALL ppdef
- rocprofiler.h
  - ROCPROFILER_STATUS_ERROR_NOT_IMPLEMENTED
  - extend rocprofiler_agent_t
  - modify rocprofiler_query_available_agents signature to callback
  - rocprofiler_pc_sampling_config_array_t
  - update rocprofiler_buffer_callback_t to include context id
  - update rocprofiler_create_buffer to accept context
- rocprofiler_plugin.h
  - non-const rocprofiler_record_header_t**

* [2/N] Update include/rocprofiler/rocprofiler_plugin.h

- change prototype of rocprofiler_plugin_write_buffer_records to resemble rocprofiler_buffer_callback_t

* [3/N] Update include/rocprofiler/hsa

- Update hsa.h
- Details in hsa subfolder

* [4/N] Update include/rocprofiler/hip

- Update hip.h
- Details in hip subfolder

* [5/N] Update include/rocprofiler/marker

- Update marker.h
- Details in marker subfolder

* [6/N] Update samples/pc_sampling

- fix issues with macros
- fix API changes

---------

Co-authored-by: Jonathan Madsen <jrmadsen@users.noreply.github.com>

[ROCm/rocprofiler-sdk commit: 39b209c2a7]
Этот коммит содержится в:
Ammar ELWazir
2023-08-24 15:39:56 -07:00
коммит произвёл GitHub
родитель 2e0ede4761
Коммит cafeaadb8c
24 изменённых файлов: 5988 добавлений и 2118 удалений
+6
Просмотреть файл
@@ -1 +1,7 @@
#
#
#
project(rocprofiler-samples LANGUAGES C CXX)
# add_subdirectory(api_tracing)
add_subdirectory(pc_sampling)
+16
Просмотреть файл
@@ -0,0 +1,16 @@
#
#
#
project(rocprofiler-samples-pc-sampling LANGUAGES C CXX)
add_executable(pc_sampling_single-user-host-trap)
target_sources(pc_sampling_single-user-host-trap PRIVATE common.h
single-user-host-trap.cpp)
target_link_libraries(pc_sampling_single-user-host-trap
PRIVATE rocprofiler::rocprofiler-library)
add_executable(pc_sampling_single-user-host-trap-retry)
target_sources(pc_sampling_single-user-host-trap-retry
PRIVATE common.h single-user-host-trap-retries-service-instantiation.cpp)
target_link_libraries(pc_sampling_single-user-host-trap-retry
PRIVATE rocprofiler::rocprofiler-library)
+124
Просмотреть файл
@@ -0,0 +1,124 @@
#ifndef PC_SAMPLING_COMMON_H
#define PC_SAMPLING_COMMON_H
#include <rocprofiler/rocprofiler.h>
#include <cstdio>
#include <cstdlib>
#include <cstddef>
#include <cstdint>
constexpr size_t BUFFER_SIZE_BYTES = 4096;
constexpr size_t WATERMARK = (BUFFER_SIZE_BYTES / 2);
#define ROCPROFILER_CALL(result, msg) \
{ \
rocprofiler_status_t status = result; \
if(status != ROCPROFILER_STATUS_SUCCESS) \
{ \
puts(#result " failed"); \
} \
}
// We might want to test the calls that fails
// e.g. calling `rocprofiler_configure_pc_sampling_service `
// after previous initialization.
#define ROCPROFILER_CALL_FAILS(result, msg) \
{ \
rocprofiler_status_t status = result; \
if(status == ROCPROFILER_STATUS_SUCCESS) \
{ \
puts(#result " succeeded"); \
} \
}
static rocprofiler_status_t
find_first_gpu_agent_impl(rocprofiler_agent_t** agents, size_t num_agents, void* data)
{
// data is required
if(!data) return ROCPROFILER_STATUS_ERROR;
auto* _out_agent = static_cast<rocprofiler_agent_t*>(data);
// find the first GPU agent
for(size_t i = 0; i < num_agents; i++)
{
if(agents[i]->type == ROCPROFILER_AGENT_TYPE_GPU)
{
*_out_agent = *agents[i];
printf("[%s] %s :: id=%zu, type=%i, num pc sample configs=%zu\n",
__FUNCTION__,
_out_agent->name,
_out_agent->id.handle,
_out_agent->type,
_out_agent->pc_sampling_configs.size);
return ROCPROFILER_STATUS_SUCCESS;
}
else
{
printf("[%s] %s :: id=%zu, type=%i, num pc sample configs=%zu\n",
__FUNCTION__,
agents[i]->name,
agents[i]->id.handle,
agents[i]->type,
agents[i]->pc_sampling_configs.size);
}
}
return ROCPROFILER_STATUS_ERROR;
}
static rocprofiler_agent_t
find_first_gpu_agent()
{
// This function returns the first gpu agent it encounters.
// TODO: write the better function querying information about the agent,
// and return if the agent is MI200.
rocprofiler_agent_t gpu_agent;
ROCPROFILER_CALL(rocprofiler_query_available_agents(&find_first_gpu_agent_impl,
sizeof(rocprofiler_agent_t),
static_cast<void*>(&gpu_agent)),
"Failed to find GPU agents");
return gpu_agent;
}
static void
rocprofiler_pc_sampling_callback(rocprofiler_context_id_t /*context_id*/,
rocprofiler_buffer_id_t /*buffer_id*/,
rocprofiler_record_header_t** headers,
size_t num_headers,
void* /*data*/,
uint64_t drop_count)
{
// Vladimir: I am not sure if this is the right way of iterating over PC sampling records.
printf(
"The number of delivered samples is: %zu, while the number of dropped samples is: %lu.\n",
num_headers,
drop_count);
for(size_t i = 0; i < num_headers; i++)
{
auto* cur_header = headers[i];
if(cur_header->kind == 0)
{
auto* pc_sample = static_cast<rocprofiler_pc_sampling_record_t*>(cur_header->payload);
printf("--- pc: %lx, dispatch_id: %lx, timestamp: %lu, hardware_id: %lu\n",
pc_sample->pc,
pc_sample->dispatch_id,
pc_sample->timestamp,
pc_sample->hardware_id);
// Vladimir: How to parse the remaining part of the `rocprofiler_pc_sampling_record_t`
// struct?
}
}
// Vladimr: We might want to add somewhere in the documentation that headars actually contain PC
// samples.
}
static void
run_HIP_app()
{
// TODO: provide the simple HIP app
}
#endif
@@ -0,0 +1,165 @@
// Vladimir: The example of using Host-trap PC sampling on a system with single MI200/300 by two
// users. The first user initiates Host-Trap sampling with the configuration A. The second user
// tries initiaiting stochastic sampling with configuration B and fails. Then it queries available
// configurations and observes only the configuration A. It accepts it and starts PC sampling.
// Vladimir: Currently, this example is written as a single-threaded program.
// Decide whether to move the second user to a separate thread or process
#include <rocprofiler/rocprofiler.h>
#include "common.h"
#include <cassert>
#define HOST_TRAP_INTERVAL 1000
rocprofiler_pc_sampling_method_t host_trap_sampling_method;
rocprofiler_pc_sampling_unit_t host_trap_sampling_unit_time;
uint64_t host_trap_interval;
void
second_user()
{
// creating a context
rocprofiler_context_id_t context_id2;
ROCPROFILER_CALL(rocprofiler_create_context(&context_id2),
"Cannot create context for the second user\n");
rocprofiler_agent_t gpu_agent = find_first_gpu_agent();
// creating a buffer that will hold pc sampling information
rocprofiler_buffer_policy_t lossless_buffer_action = ROCPROFILER_BUFFER_POLICY_LOSSLESS;
rocprofiler_buffer_id_t buffer_id2;
ROCPROFILER_CALL(rocprofiler_create_buffer(context_id2,
BUFFER_SIZE_BYTES,
WATERMARK,
lossless_buffer_action,
rocprofiler_pc_sampling_callback,
nullptr,
&buffer_id2),
"Cannot create pc sampling buffer for the second user");
// The second user tries to create another pc sampling service with different configuration,
// but the rocprofiler rejects it.
rocprofiler_pc_sampling_method_t sampling_method2 = ROCPROFILER_PC_SAMPLING_METHOD_STOCHASTIC;
rocprofiler_pc_sampling_unit_t sampling_unit2 = ROCPROFILER_PC_SAMPLING_UNIT_CYCLES;
uint64_t interval2 = 2048; // I assumed micro secs, so this should be 1ms
// The following function returns an error code indicating the PC sampling has already been
// configured.
ROCPROFILER_CALL_FAILS(
rocprofiler_configure_pc_sampling_service(
context_id2, gpu_agent, sampling_method2, sampling_unit2, interval2, buffer_id2),
"Instantiation of the PC sampling service should fail");
// After failure, the second user queries available configuration and observes the one chosen by
// the first user.
rocprofiler_pc_sampling_configuration_t* configs;
size_t config_count;
ROCPROFILER_CALL(
rocprofiler_query_pc_sampling_agent_configurations(gpu_agent, configs, &config_count),
"The second user cannot query available configurations");
// Only one configuration should be listed, and its parameters should match the parameters set
// by the first user. Vladimir: Is it ok to use assertions? In the release mode, they might be
// ignored.
assert(config_count == 1);
rocprofiler_pc_sampling_configuration_t first_user_config = configs[0];
assert(first_user_config.method == host_trap_sampling_method);
assert(first_user_config.unit == host_trap_sampling_unit_time);
// Vladimir: Should the min_interval and max_interval have the same value at this point (the PC
// sampling is alredy configured)??
assert(first_user_config.min_interval == host_trap_interval &&
first_user_config.min_interval == first_user_config.max_interval);
// Vladimir: Do we need to explicitly free queried configurations?
free(configs);
// Reuse the same configuration set by the first user.
// The second user is satisfied with the configuration chosen by the first user, so it
// starts PC sampling.
ROCPROFILER_CALL(rocprofiler_configure_pc_sampling_service(context_id2,
gpu_agent,
first_user_config.method,
first_user_config.unit,
first_user_config.min_interval,
buffer_id2),
"The second user cannot share already created PC sampling configuration");
// Starting the context that should trigger PC sampling?
ROCPROFILER_CALL(rocprofiler_start_context(context_id2),
"Cannot start PC sampling context for the second user");
// Running the applicaiton
run_HIP_app();
// Stop the context that should stop PC sampling?
ROCPROFILER_CALL(rocprofiler_stop_context(context_id2),
"Cannot start PC sampling context for the second user");
// Explicit buffer flush, before destroying it
ROCPROFILER_CALL(rocprofiler_flush_buffer(buffer_id2),
"Cannot destroy the second user's buffer");
// Destroying the buffer
ROCPROFILER_CALL(rocprofiler_destroy_buffer(buffer_id2), "Cannot destroy the second user's");
}
int
main(int /*argc*/, char** /*argv*/)
{
rocprofiler_status_t status;
// creating a context
rocprofiler_context_id_t context_id;
ROCPROFILER_CALL(rocprofiler_create_context(&context_id), "Cannot create context\n");
rocprofiler_agent_t gpu_agent = find_first_gpu_agent();
// creating a buffer that will hold pc sampling information
rocprofiler_buffer_policy_t drop_buffer_action = ROCPROFILER_BUFFER_POLICY_DISCARD;
rocprofiler_buffer_id_t buffer_id;
ROCPROFILER_CALL(rocprofiler_create_buffer(context_id,
BUFFER_SIZE_BYTES,
WATERMARK,
drop_buffer_action,
rocprofiler_pc_sampling_callback,
nullptr,
&buffer_id),
"Cannot create pc sampling buffer");
// PC sampling service configuration
rocprofiler_pc_sampling_method_t host_trap_sampling_method =
ROCPROFILER_PC_SAMPLING_METHOD_HOST_TRAP;
rocprofiler_pc_sampling_unit_t host_trap_sampling_unit_time = ROCPROFILER_PC_SAMPLING_UNIT_TIME;
// Vladimir: What units are we using for time? ms, micro secs, ns?
uint64_t host_trap_interval = HOST_TRAP_INTERVAL;
// Instantiating the first PC sampling service succeeds.
ROCPROFILER_CALL(rocprofiler_configure_pc_sampling_service(context_id,
gpu_agent,
host_trap_sampling_method,
host_trap_sampling_unit_time,
host_trap_interval,
buffer_id),
"Cannot create PC sampling service");
// Trigger the second user code.
// Vladimir: Discuss whether this should be put in a separate thread/process.
second_user();
// Starting the context that should trigger PC sampling?
ROCPROFILER_CALL(rocprofiler_start_context(context_id), "Cannot start PC sampling context");
// Running the applicaiton
run_HIP_app();
// Stop the context that should stop PC sampling?
ROCPROFILER_CALL(rocprofiler_stop_context(context_id), "Cannot start PC sampling context");
// Explicit buffer flush, before destroying it
ROCPROFILER_CALL(rocprofiler_flush_buffer(buffer_id), "Cannot destroy buffer");
// Destroying the buffer
ROCPROFILER_CALL(rocprofiler_destroy_buffer(buffer_id), "Cannot destroy buffer");
// Vladimir: Do we need to destroy context or a service?
return 0;
}
+61
Просмотреть файл
@@ -0,0 +1,61 @@
// Vladimir: The example of using Host-trap PC sampling exclusively on the system with single MI200.
// If any of the rocprofiler calls returns status fail, we simply stop the application.
#include <rocprofiler/rocprofiler.h>
#include "common.h"
int
main(int /*argc*/, char** /*argv*/)
{
rocprofiler_status_t status;
// creating a context
rocprofiler_context_id_t context_id;
ROCPROFILER_CALL(rocprofiler_create_context(&context_id), "Cannot create context\n");
rocprofiler_agent_t gpu_agent = find_first_gpu_agent();
// creating a buffer that will hold pc sampling information
rocprofiler_buffer_policy_t drop_buffer_action = ROCPROFILER_BUFFER_POLICY_DISCARD;
rocprofiler_buffer_id_t buffer_id;
ROCPROFILER_CALL(rocprofiler_create_buffer(context_id,
BUFFER_SIZE_BYTES,
WATERMARK,
drop_buffer_action,
rocprofiler_pc_sampling_callback,
nullptr,
&buffer_id),
"Cannot create pc sampling buffer");
// PC sampling service configuration
rocprofiler_pc_sampling_method_t sampling_method = ROCPROFILER_PC_SAMPLING_METHOD_HOST_TRAP;
rocprofiler_pc_sampling_unit_t sampling_unit = ROCPROFILER_PC_SAMPLING_UNIT_TIME;
// What units are we using for time? ms, micro secs, ns?
uint64_t interval = 1000; // I assumed micro secs, so this should be 1ms
// Instantiating the PC sampling service
ROCPROFILER_CALL(
rocprofiler_configure_pc_sampling_service(
context_id, gpu_agent, sampling_method, sampling_unit, interval, buffer_id),
"Cannot create PC sampling service");
// Vladimir: Is this the place of retrying if someone already created the
// configuration and the previous call fails?
// Starting the context that should trigger PC sampling?
ROCPROFILER_CALL(rocprofiler_start_context(context_id), "Cannot start PC sampling context");
// Running the applicaiton
run_HIP_app();
// Stop the context that should stop PC sampling?
ROCPROFILER_CALL(rocprofiler_stop_context(context_id), "Cannot start PC sampling context");
// Explicit buffer flush, before destroying it
ROCPROFILER_CALL(rocprofiler_flush_buffer(buffer_id), "Cannot destroy buffer");
// Destroying the buffer
ROCPROFILER_CALL(rocprofiler_destroy_buffer(buffer_id), "Cannot destroy buffer");
// Vladimir: Do we need to destroy context or a service?
return 0;
}
+11 -2
Просмотреть файл
@@ -3,6 +3,15 @@
# Installation of public headers
#
#
set(ROCPROFILER_INCLUDE_FILES config.h rocprofiler.h rocprofiler_plugin.h)
install(FILES ${ROCPROFILER_INCLUDE_FILES}
configure_file(${CMAKE_CURRENT_LIST_DIR}/version.h.in
${CMAKE_CURRENT_BINARY_DIR}/version.h @ONLY)
set(ROCPROFILER_HEADER_FILES config.h defines.h hip.h hsa.h marker.h rocprofiler.h
rocprofiler_plugin.h ${CMAKE_CURRENT_BINARY_DIR}/version.h)
install(FILES ${ROCPROFILER_HEADER_FILES}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler)
add_subdirectory(hip)
add_subdirectory(hsa)
add_subdirectory(marker)
+97
Просмотреть файл
@@ -0,0 +1,97 @@
// MIT License
//
// Copyright (c) 2023 ROCm Developer Tools
//
// 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
#if !defined(ROCPROFILER_ATTRIBUTE)
# if defined(_MSC_VER)
# define ROCPROFILER_ATTRIBUTE(...) __declspec(__VA_ARGS__)
# else
# define ROCPROFILER_ATTRIBUTE(...) __attribute__((__VA_ARGS__))
# endif
#endif
#if !defined(ROCPROFILER_PUBLIC_API)
# if defined(_MSC_VER)
# define ROCPROFILER_PUBLIC_API ROCPROFILER_ATTRIBUTE(dllexport)
# else
# define ROCPROFILER_PUBLIC_API ROCPROFILER_ATTRIBUTE(visibility("default"))
# endif
#endif
#if !defined(ROCPROFILER_HIDDEN_API)
# if defined(_MSC_VER)
# define ROCPROFILER_HIDDEN_API
# else
# define ROCPROFILER_HIDDEN_API ROCPROFILER_ATTRIBUTE(visibility("hidden"))
# endif
#endif
#if !defined(ROCPROFILER_EXPORT_DECORATOR)
# define ROCPROFILER_EXPORT_DECORATOR ROCPROFILER_PUBLIC_API
#endif
#if !defined(ROCPROFILER_IMPORT_DECORATOR)
# if defined(_MSC_VER)
# define ROCPROFILER_IMPORT_DECORATOR ROCPROFILER_ATTRIBUTE(dllimport)
# else
# define ROCPROFILER_IMPORT_DECORATOR
# endif
#endif
#define ROCPROFILER_EXPORT ROCPROFILER_EXPORT_DECORATOR
#define ROCPROFILER_IMPORT ROCPROFILER_IMPORT_DECORATOR
#if !defined(ROCPROFILER_API)
# if defined(rocprofiler_EXPORTS)
# define ROCPROFILER_API ROCPROFILER_EXPORT
# else
# define ROCPROFILER_API ROCPROFILER_IMPORT
# endif
#endif
#if defined(__has_attribute)
# if __has_attribute(nonnull)
# define ROCPROFILER_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
# else
# define ROCPROFILER_NONNULL(...)
# endif
#else
# if defined(__GNUC__)
# define ROCPROFILER_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
# else
# define ROCPROFILER_NONNULL(...)
# endif
#endif
#if __cplusplus >= 201103L // C++11
/* c++11 allows extended initializer lists. */
# define ROCPROFILER_HANDLE_LITERAL(type, value) (type{value})
#elif __STDC_VERSION__ >= 199901L
/* c99 allows compound literals. */
# define ROCPROFILER_HANDLE_LITERAL(type, value) ((type){value})
#else
# define ROCPROFILER_HANDLE_LITERAL(type, value) \
{ \
value \
}
#endif
+51
Просмотреть файл
@@ -0,0 +1,51 @@
// MIT License
//
// Copyright (c) 2023 ROCm Developer Tools
//
// 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/hip/api_id.h>
#include <rocprofiler/hip/api_args.h>
#include <stdint.h>
typedef uint32_t rocprofiler_trace_record_hip_operation_kind_t;
typedef struct rocprofiler_hip_trace_data_s rocprofiler_hip_trace_data_t;
typedef struct rocprofiler_hip_api_data_s rocprofiler_hip_api_data_t;
struct rocprofiler_hip_api_data_s
{
uint64_t correlation_id;
uint32_t phase;
rocprofiler_hip_api_args_t args;
uint64_t* phase_data;
};
struct rocprofiler_hip_trace_data_s
{
rocprofiler_hip_api_data_t api_data;
uint64_t phase_enter_timestamp;
uint64_t phase_exit_timestamp;
uint64_t phase_data;
void (*phase_enter)(rocprofiler_hip_api_id_t operation_id, rocprofiler_hip_trace_data_t* data);
void (*phase_exit)(rocprofiler_hip_api_id_t operation_id, rocprofiler_hip_trace_data_t* data);
};
+9
Просмотреть файл
@@ -0,0 +1,9 @@
#
#
# Installation of public HIP headers
#
#
set(ROCPROFILER_HIP_HEADER_FILES api_args.h api_id.h)
install(FILES ${ROCPROFILER_HIP_HEADER_FILES}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler/hip)
Разница между файлами не показана из-за своего большого размера Загрузить разницу
+432
Просмотреть файл
@@ -0,0 +1,432 @@
// Copyright (c) 2018-2023 Advanced Micro Devices, Inc.
//
// 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
// NOLINTNEXTLINE(performance-enum-size)
typedef enum
{
ROCPROFILER_HIP_API_ID_NONE = -1,
ROCPROFILER_HIP_API_ID___hipPopCallConfiguration = 0,
ROCPROFILER_HIP_API_ID___hipPushCallConfiguration,
ROCPROFILER_HIP_API_ID_hipArray3DCreate,
ROCPROFILER_HIP_API_ID_hipArrayCreate,
ROCPROFILER_HIP_API_ID_hipArrayDestroy,
ROCPROFILER_HIP_API_ID_hipChooseDevice,
ROCPROFILER_HIP_API_ID_hipConfigureCall,
ROCPROFILER_HIP_API_ID_hipCtxCreate,
ROCPROFILER_HIP_API_ID_hipCtxDestroy,
ROCPROFILER_HIP_API_ID_hipCtxDisablePeerAccess,
ROCPROFILER_HIP_API_ID_hipCtxEnablePeerAccess,
ROCPROFILER_HIP_API_ID_hipCtxGetApiVersion,
ROCPROFILER_HIP_API_ID_hipCtxGetCacheConfig,
ROCPROFILER_HIP_API_ID_hipCtxGetCurrent,
ROCPROFILER_HIP_API_ID_hipCtxGetDevice,
ROCPROFILER_HIP_API_ID_hipCtxGetFlags,
ROCPROFILER_HIP_API_ID_hipCtxGetSharedMemConfig,
ROCPROFILER_HIP_API_ID_hipCtxPopCurrent,
ROCPROFILER_HIP_API_ID_hipCtxPushCurrent,
ROCPROFILER_HIP_API_ID_hipCtxSetCacheConfig,
ROCPROFILER_HIP_API_ID_hipCtxSetCurrent,
ROCPROFILER_HIP_API_ID_hipCtxSetSharedMemConfig,
ROCPROFILER_HIP_API_ID_hipCtxSynchronize,
ROCPROFILER_HIP_API_ID_hipDestroyExternalMemory,
ROCPROFILER_HIP_API_ID_hipDestroyExternalSemaphore,
ROCPROFILER_HIP_API_ID_hipDeviceCanAccessPeer,
ROCPROFILER_HIP_API_ID_hipDeviceComputeCapability,
ROCPROFILER_HIP_API_ID_hipDeviceDisablePeerAccess,
ROCPROFILER_HIP_API_ID_hipDeviceEnablePeerAccess,
ROCPROFILER_HIP_API_ID_hipDeviceGet,
ROCPROFILER_HIP_API_ID_hipDeviceGetAttribute,
ROCPROFILER_HIP_API_ID_hipDeviceGetByPCIBusId,
ROCPROFILER_HIP_API_ID_hipDeviceGetCacheConfig,
ROCPROFILER_HIP_API_ID_hipDeviceGetLimit,
ROCPROFILER_HIP_API_ID_hipDeviceGetName,
ROCPROFILER_HIP_API_ID_hipDeviceGetP2PAttribute,
ROCPROFILER_HIP_API_ID_hipDeviceGetPCIBusId,
ROCPROFILER_HIP_API_ID_hipDeviceGetSharedMemConfig,
ROCPROFILER_HIP_API_ID_hipDeviceGetStreamPriorityRange,
ROCPROFILER_HIP_API_ID_hipDevicePrimaryCtxGetState,
ROCPROFILER_HIP_API_ID_hipDevicePrimaryCtxRelease,
ROCPROFILER_HIP_API_ID_hipDevicePrimaryCtxReset,
ROCPROFILER_HIP_API_ID_hipDevicePrimaryCtxRetain,
ROCPROFILER_HIP_API_ID_hipDevicePrimaryCtxSetFlags,
ROCPROFILER_HIP_API_ID_hipDeviceReset,
ROCPROFILER_HIP_API_ID_hipDeviceSetCacheConfig,
ROCPROFILER_HIP_API_ID_hipDeviceSetSharedMemConfig,
ROCPROFILER_HIP_API_ID_hipDeviceSynchronize,
ROCPROFILER_HIP_API_ID_hipDeviceTotalMem,
ROCPROFILER_HIP_API_ID_RESERVED_50,
ROCPROFILER_HIP_API_ID_hipDrvMemcpy2DUnaligned,
ROCPROFILER_HIP_API_ID_hipDrvMemcpy3D,
ROCPROFILER_HIP_API_ID_hipDrvMemcpy3DAsync,
ROCPROFILER_HIP_API_ID_hipEventCreate,
ROCPROFILER_HIP_API_ID_hipEventCreateWithFlags,
ROCPROFILER_HIP_API_ID_hipEventDestroy,
ROCPROFILER_HIP_API_ID_hipEventElapsedTime,
ROCPROFILER_HIP_API_ID_hipEventQuery,
ROCPROFILER_HIP_API_ID_hipEventRecord,
ROCPROFILER_HIP_API_ID_hipEventSynchronize,
ROCPROFILER_HIP_API_ID_hipExtGetLinkTypeAndHopCount,
ROCPROFILER_HIP_API_ID_hipExtLaunchKernel,
ROCPROFILER_HIP_API_ID_hipExtLaunchMultiKernelMultiDevice,
ROCPROFILER_HIP_API_ID_hipExtMallocWithFlags,
ROCPROFILER_HIP_API_ID_hipExtModuleLaunchKernel,
ROCPROFILER_HIP_API_ID_hipExtStreamCreateWithCUMask,
ROCPROFILER_HIP_API_ID_hipExtStreamGetCUMask,
ROCPROFILER_HIP_API_ID_hipExternalMemoryGetMappedBuffer,
ROCPROFILER_HIP_API_ID_hipFree,
ROCPROFILER_HIP_API_ID_hipFreeArray,
ROCPROFILER_HIP_API_ID_hipFreeHost,
ROCPROFILER_HIP_API_ID_hipFreeMipmappedArray,
ROCPROFILER_HIP_API_ID_hipFuncGetAttribute,
ROCPROFILER_HIP_API_ID_hipFuncGetAttributes,
ROCPROFILER_HIP_API_ID_hipFuncSetAttribute,
ROCPROFILER_HIP_API_ID_hipFuncSetCacheConfig,
ROCPROFILER_HIP_API_ID_hipFuncSetSharedMemConfig,
ROCPROFILER_HIP_API_ID_hipGetDevice,
ROCPROFILER_HIP_API_ID_hipGetDeviceCount,
ROCPROFILER_HIP_API_ID_hipGetDeviceFlags,
ROCPROFILER_HIP_API_ID_hipGetDeviceProperties,
ROCPROFILER_HIP_API_ID_RESERVED_82,
ROCPROFILER_HIP_API_ID_hipGetErrorString,
ROCPROFILER_HIP_API_ID_hipGetLastError,
ROCPROFILER_HIP_API_ID_hipGetMipmappedArrayLevel,
ROCPROFILER_HIP_API_ID_hipGetSymbolAddress,
ROCPROFILER_HIP_API_ID_hipGetSymbolSize,
ROCPROFILER_HIP_API_ID_hipHccModuleLaunchKernel,
ROCPROFILER_HIP_API_ID_hipHostAlloc,
ROCPROFILER_HIP_API_ID_hipHostFree,
ROCPROFILER_HIP_API_ID_hipHostGetDevicePointer,
ROCPROFILER_HIP_API_ID_hipHostGetFlags,
ROCPROFILER_HIP_API_ID_hipHostMalloc,
ROCPROFILER_HIP_API_ID_hipHostRegister,
ROCPROFILER_HIP_API_ID_hipHostUnregister,
ROCPROFILER_HIP_API_ID_hipImportExternalMemory,
ROCPROFILER_HIP_API_ID_hipImportExternalSemaphore,
ROCPROFILER_HIP_API_ID_hipInit,
ROCPROFILER_HIP_API_ID_hipIpcCloseMemHandle,
ROCPROFILER_HIP_API_ID_hipIpcGetEventHandle,
ROCPROFILER_HIP_API_ID_hipIpcGetMemHandle,
ROCPROFILER_HIP_API_ID_hipIpcOpenEventHandle,
ROCPROFILER_HIP_API_ID_hipIpcOpenMemHandle,
ROCPROFILER_HIP_API_ID_hipLaunchByPtr,
ROCPROFILER_HIP_API_ID_hipLaunchCooperativeKernel,
ROCPROFILER_HIP_API_ID_hipLaunchCooperativeKernelMultiDevice,
ROCPROFILER_HIP_API_ID_hipLaunchKernel,
ROCPROFILER_HIP_API_ID_hipMalloc,
ROCPROFILER_HIP_API_ID_hipMalloc3D,
ROCPROFILER_HIP_API_ID_hipMalloc3DArray,
ROCPROFILER_HIP_API_ID_hipMallocArray,
ROCPROFILER_HIP_API_ID_hipMallocHost,
ROCPROFILER_HIP_API_ID_hipMallocManaged,
ROCPROFILER_HIP_API_ID_hipMallocMipmappedArray,
ROCPROFILER_HIP_API_ID_hipMallocPitch,
ROCPROFILER_HIP_API_ID_hipMemAdvise,
ROCPROFILER_HIP_API_ID_hipMemAllocHost,
ROCPROFILER_HIP_API_ID_hipMemAllocPitch,
ROCPROFILER_HIP_API_ID_hipMemGetAddressRange,
ROCPROFILER_HIP_API_ID_hipMemGetInfo,
ROCPROFILER_HIP_API_ID_hipMemPrefetchAsync,
ROCPROFILER_HIP_API_ID_hipMemPtrGetInfo,
ROCPROFILER_HIP_API_ID_hipMemRangeGetAttribute,
ROCPROFILER_HIP_API_ID_hipMemRangeGetAttributes,
ROCPROFILER_HIP_API_ID_hipMemcpy,
ROCPROFILER_HIP_API_ID_hipMemcpy2D,
ROCPROFILER_HIP_API_ID_hipMemcpy2DAsync,
ROCPROFILER_HIP_API_ID_hipMemcpy2DFromArray,
ROCPROFILER_HIP_API_ID_hipMemcpy2DFromArrayAsync,
ROCPROFILER_HIP_API_ID_hipMemcpy2DToArray,
ROCPROFILER_HIP_API_ID_hipMemcpy2DToArrayAsync,
ROCPROFILER_HIP_API_ID_hipMemcpy3D,
ROCPROFILER_HIP_API_ID_hipMemcpy3DAsync,
ROCPROFILER_HIP_API_ID_hipMemcpyAsync,
ROCPROFILER_HIP_API_ID_hipMemcpyAtoH,
ROCPROFILER_HIP_API_ID_hipMemcpyDtoD,
ROCPROFILER_HIP_API_ID_hipMemcpyDtoDAsync,
ROCPROFILER_HIP_API_ID_hipMemcpyDtoH,
ROCPROFILER_HIP_API_ID_hipMemcpyDtoHAsync,
ROCPROFILER_HIP_API_ID_hipMemcpyFromArray,
ROCPROFILER_HIP_API_ID_hipMemcpyFromSymbol,
ROCPROFILER_HIP_API_ID_hipMemcpyFromSymbolAsync,
ROCPROFILER_HIP_API_ID_hipMemcpyHtoA,
ROCPROFILER_HIP_API_ID_hipMemcpyHtoD,
ROCPROFILER_HIP_API_ID_hipMemcpyHtoDAsync,
ROCPROFILER_HIP_API_ID_hipMemcpyParam2D,
ROCPROFILER_HIP_API_ID_hipMemcpyParam2DAsync,
ROCPROFILER_HIP_API_ID_hipMemcpyPeer,
ROCPROFILER_HIP_API_ID_hipMemcpyPeerAsync,
ROCPROFILER_HIP_API_ID_hipMemcpyToArray,
ROCPROFILER_HIP_API_ID_hipMemcpyToSymbol,
ROCPROFILER_HIP_API_ID_hipMemcpyToSymbolAsync,
ROCPROFILER_HIP_API_ID_hipMemcpyWithStream,
ROCPROFILER_HIP_API_ID_hipMemset,
ROCPROFILER_HIP_API_ID_hipMemset2D,
ROCPROFILER_HIP_API_ID_hipMemset2DAsync,
ROCPROFILER_HIP_API_ID_hipMemset3D,
ROCPROFILER_HIP_API_ID_hipMemset3DAsync,
ROCPROFILER_HIP_API_ID_hipMemsetAsync,
ROCPROFILER_HIP_API_ID_hipMemsetD16,
ROCPROFILER_HIP_API_ID_hipMemsetD16Async,
ROCPROFILER_HIP_API_ID_hipMemsetD32,
ROCPROFILER_HIP_API_ID_hipMemsetD32Async,
ROCPROFILER_HIP_API_ID_hipMemsetD8,
ROCPROFILER_HIP_API_ID_hipMemsetD8Async,
ROCPROFILER_HIP_API_ID_hipModuleGetFunction,
ROCPROFILER_HIP_API_ID_hipModuleGetGlobal,
ROCPROFILER_HIP_API_ID_hipModuleGetTexRef,
ROCPROFILER_HIP_API_ID_hipModuleLaunchKernel,
ROCPROFILER_HIP_API_ID_hipModuleLoad,
ROCPROFILER_HIP_API_ID_hipModuleLoadData,
ROCPROFILER_HIP_API_ID_hipModuleLoadDataEx,
ROCPROFILER_HIP_API_ID_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor,
ROCPROFILER_HIP_API_ID_hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags,
ROCPROFILER_HIP_API_ID_hipModuleOccupancyMaxPotentialBlockSize,
ROCPROFILER_HIP_API_ID_hipModuleOccupancyMaxPotentialBlockSizeWithFlags,
ROCPROFILER_HIP_API_ID_hipModuleUnload,
ROCPROFILER_HIP_API_ID_hipOccupancyMaxActiveBlocksPerMultiprocessor,
ROCPROFILER_HIP_API_ID_hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags,
ROCPROFILER_HIP_API_ID_hipOccupancyMaxPotentialBlockSize,
ROCPROFILER_HIP_API_ID_hipPeekAtLastError,
ROCPROFILER_HIP_API_ID_hipPointerGetAttributes,
ROCPROFILER_HIP_API_ID_hipProfilerStart,
ROCPROFILER_HIP_API_ID_hipProfilerStop,
ROCPROFILER_HIP_API_ID_RESERVED_185,
ROCPROFILER_HIP_API_ID_hipSetDevice,
ROCPROFILER_HIP_API_ID_hipSetDeviceFlags,
ROCPROFILER_HIP_API_ID_hipSetupArgument,
ROCPROFILER_HIP_API_ID_hipSignalExternalSemaphoresAsync,
ROCPROFILER_HIP_API_ID_hipStreamAddCallback,
ROCPROFILER_HIP_API_ID_hipStreamAttachMemAsync,
ROCPROFILER_HIP_API_ID_hipStreamCreate,
ROCPROFILER_HIP_API_ID_hipStreamCreateWithFlags,
ROCPROFILER_HIP_API_ID_hipStreamCreateWithPriority,
ROCPROFILER_HIP_API_ID_hipStreamDestroy,
ROCPROFILER_HIP_API_ID_hipStreamGetFlags,
ROCPROFILER_HIP_API_ID_hipStreamGetPriority,
ROCPROFILER_HIP_API_ID_hipStreamQuery,
ROCPROFILER_HIP_API_ID_hipStreamSynchronize,
ROCPROFILER_HIP_API_ID_hipStreamWaitEvent,
ROCPROFILER_HIP_API_ID_hipStreamWaitValue32,
ROCPROFILER_HIP_API_ID_hipStreamWaitValue64,
ROCPROFILER_HIP_API_ID_hipStreamWriteValue32,
ROCPROFILER_HIP_API_ID_hipStreamWriteValue64,
ROCPROFILER_HIP_API_ID_hipWaitExternalSemaphoresAsync,
ROCPROFILER_HIP_API_ID_hipCreateSurfaceObject,
ROCPROFILER_HIP_API_ID_hipDestroySurfaceObject,
ROCPROFILER_HIP_API_ID_hipGraphAddKernelNode,
ROCPROFILER_HIP_API_ID_hipGraphAddMemcpyNode,
ROCPROFILER_HIP_API_ID_hipGraphAddMemsetNode,
ROCPROFILER_HIP_API_ID_hipGraphCreate,
ROCPROFILER_HIP_API_ID_hipGraphDestroy,
ROCPROFILER_HIP_API_ID_hipGraphExecDestroy,
ROCPROFILER_HIP_API_ID_hipGraphInstantiate,
ROCPROFILER_HIP_API_ID_hipGraphLaunch,
ROCPROFILER_HIP_API_ID_hipMipmappedArrayCreate,
ROCPROFILER_HIP_API_ID_hipMipmappedArrayDestroy,
ROCPROFILER_HIP_API_ID_hipMipmappedArrayGetLevel,
ROCPROFILER_HIP_API_ID_hipStreamBeginCapture,
ROCPROFILER_HIP_API_ID_hipStreamEndCapture,
ROCPROFILER_HIP_API_ID_hipTexRefGetAddress,
ROCPROFILER_HIP_API_ID_hipTexRefGetFlags,
ROCPROFILER_HIP_API_ID_hipTexRefGetFormat,
ROCPROFILER_HIP_API_ID_hipTexRefGetMaxAnisotropy,
ROCPROFILER_HIP_API_ID_hipTexRefGetMipMappedArray,
ROCPROFILER_HIP_API_ID_hipTexRefGetMipmapLevelBias,
ROCPROFILER_HIP_API_ID_hipTexRefGetMipmapLevelClamp,
ROCPROFILER_HIP_API_ID_hipTexRefSetAddress,
ROCPROFILER_HIP_API_ID_hipTexRefSetAddress2D,
ROCPROFILER_HIP_API_ID_hipTexRefSetBorderColor,
ROCPROFILER_HIP_API_ID_hipTexRefSetFormat,
ROCPROFILER_HIP_API_ID_hipTexRefSetMaxAnisotropy,
ROCPROFILER_HIP_API_ID_hipTexRefSetMipmapLevelClamp,
ROCPROFILER_HIP_API_ID_hipTexRefSetMipmappedArray,
ROCPROFILER_HIP_API_ID_hipGLGetDevices,
ROCPROFILER_HIP_API_ID_hipGraphAddDependencies,
ROCPROFILER_HIP_API_ID_hipGraphAddEmptyNode,
ROCPROFILER_HIP_API_ID_hipGraphExecKernelNodeSetParams,
ROCPROFILER_HIP_API_ID_hipGraphGetNodes,
ROCPROFILER_HIP_API_ID_hipGraphGetRootNodes,
ROCPROFILER_HIP_API_ID_hipGraphKernelNodeGetParams,
ROCPROFILER_HIP_API_ID_hipGraphKernelNodeSetParams,
ROCPROFILER_HIP_API_ID_hipGraphMemcpyNodeGetParams,
ROCPROFILER_HIP_API_ID_hipGraphMemcpyNodeSetParams,
ROCPROFILER_HIP_API_ID_hipGraphMemsetNodeGetParams,
ROCPROFILER_HIP_API_ID_hipGraphMemsetNodeSetParams,
ROCPROFILER_HIP_API_ID_hipGraphicsGLRegisterBuffer,
ROCPROFILER_HIP_API_ID_hipGraphicsMapResources,
ROCPROFILER_HIP_API_ID_hipGraphicsResourceGetMappedPointer,
ROCPROFILER_HIP_API_ID_hipGraphicsUnmapResources,
ROCPROFILER_HIP_API_ID_hipGraphicsUnregisterResource,
ROCPROFILER_HIP_API_ID_hipGraphAddChildGraphNode,
ROCPROFILER_HIP_API_ID_hipGraphAddEventRecordNode,
ROCPROFILER_HIP_API_ID_hipGraphAddEventWaitNode,
ROCPROFILER_HIP_API_ID_hipGraphAddHostNode,
ROCPROFILER_HIP_API_ID_hipGraphAddMemcpyNode1D,
ROCPROFILER_HIP_API_ID_hipGraphAddMemcpyNodeFromSymbol,
ROCPROFILER_HIP_API_ID_hipGraphAddMemcpyNodeToSymbol,
ROCPROFILER_HIP_API_ID_hipGraphChildGraphNodeGetGraph,
ROCPROFILER_HIP_API_ID_hipGraphClone,
ROCPROFILER_HIP_API_ID_hipGraphDestroyNode,
ROCPROFILER_HIP_API_ID_hipGraphEventRecordNodeGetEvent,
ROCPROFILER_HIP_API_ID_hipGraphEventRecordNodeSetEvent,
ROCPROFILER_HIP_API_ID_hipGraphEventWaitNodeGetEvent,
ROCPROFILER_HIP_API_ID_hipGraphEventWaitNodeSetEvent,
ROCPROFILER_HIP_API_ID_hipGraphExecChildGraphNodeSetParams,
ROCPROFILER_HIP_API_ID_hipGraphExecEventRecordNodeSetEvent,
ROCPROFILER_HIP_API_ID_hipGraphExecEventWaitNodeSetEvent,
ROCPROFILER_HIP_API_ID_hipGraphExecHostNodeSetParams,
ROCPROFILER_HIP_API_ID_hipGraphExecMemcpyNodeSetParams,
ROCPROFILER_HIP_API_ID_hipGraphExecMemcpyNodeSetParams1D,
ROCPROFILER_HIP_API_ID_hipGraphExecMemcpyNodeSetParamsFromSymbol,
ROCPROFILER_HIP_API_ID_hipGraphExecMemcpyNodeSetParamsToSymbol,
ROCPROFILER_HIP_API_ID_hipGraphExecMemsetNodeSetParams,
ROCPROFILER_HIP_API_ID_hipGraphExecUpdate,
ROCPROFILER_HIP_API_ID_hipGraphGetEdges,
ROCPROFILER_HIP_API_ID_hipGraphHostNodeGetParams,
ROCPROFILER_HIP_API_ID_hipGraphHostNodeSetParams,
ROCPROFILER_HIP_API_ID_hipGraphInstantiateWithFlags,
ROCPROFILER_HIP_API_ID_hipGraphMemcpyNodeSetParams1D,
ROCPROFILER_HIP_API_ID_hipGraphMemcpyNodeSetParamsFromSymbol,
ROCPROFILER_HIP_API_ID_hipGraphMemcpyNodeSetParamsToSymbol,
ROCPROFILER_HIP_API_ID_hipGraphNodeFindInClone,
ROCPROFILER_HIP_API_ID_hipGraphNodeGetDependencies,
ROCPROFILER_HIP_API_ID_hipGraphNodeGetDependentNodes,
ROCPROFILER_HIP_API_ID_hipGraphNodeGetType,
ROCPROFILER_HIP_API_ID_hipGraphRemoveDependencies,
ROCPROFILER_HIP_API_ID_hipStreamGetCaptureInfo,
ROCPROFILER_HIP_API_ID_hipStreamGetCaptureInfo_v2,
ROCPROFILER_HIP_API_ID_hipStreamIsCapturing,
ROCPROFILER_HIP_API_ID_hipStreamUpdateCaptureDependencies,
ROCPROFILER_HIP_API_ID_hipDrvPointerGetAttributes,
ROCPROFILER_HIP_API_ID_hipGraphicsGLRegisterImage,
ROCPROFILER_HIP_API_ID_hipGraphicsSubResourceGetMappedArray,
ROCPROFILER_HIP_API_ID_hipPointerGetAttribute,
ROCPROFILER_HIP_API_ID_RESERVED_296,
ROCPROFILER_HIP_API_ID_hipThreadExchangeStreamCaptureMode,
ROCPROFILER_HIP_API_ID_hipDeviceGetUuid,
ROCPROFILER_HIP_API_ID_hipGetChannelDesc,
ROCPROFILER_HIP_API_ID_hipGraphKernelNodeGetAttribute,
ROCPROFILER_HIP_API_ID_hipGraphKernelNodeSetAttribute,
ROCPROFILER_HIP_API_ID_hipLaunchHostFunc,
ROCPROFILER_HIP_API_ID_hipDeviceGetDefaultMemPool,
ROCPROFILER_HIP_API_ID_hipDeviceGetMemPool,
ROCPROFILER_HIP_API_ID_hipDeviceSetMemPool,
ROCPROFILER_HIP_API_ID_hipFreeAsync,
ROCPROFILER_HIP_API_ID_hipMallocAsync,
ROCPROFILER_HIP_API_ID_hipMallocFromPoolAsync,
ROCPROFILER_HIP_API_ID_hipMemPoolCreate,
ROCPROFILER_HIP_API_ID_hipMemPoolDestroy,
ROCPROFILER_HIP_API_ID_hipMemPoolExportPointer,
ROCPROFILER_HIP_API_ID_hipMemPoolExportToShareableHandle,
ROCPROFILER_HIP_API_ID_hipMemPoolGetAccess,
ROCPROFILER_HIP_API_ID_hipMemPoolGetAttribute,
ROCPROFILER_HIP_API_ID_hipMemPoolImportFromShareableHandle,
ROCPROFILER_HIP_API_ID_hipMemPoolImportPointer,
ROCPROFILER_HIP_API_ID_hipMemPoolSetAccess,
ROCPROFILER_HIP_API_ID_hipMemPoolSetAttribute,
ROCPROFILER_HIP_API_ID_hipMemPoolTrimTo,
ROCPROFILER_HIP_API_ID_hipMemAddressFree,
ROCPROFILER_HIP_API_ID_hipMemAddressReserve,
ROCPROFILER_HIP_API_ID_hipMemCreate,
ROCPROFILER_HIP_API_ID_hipMemExportToShareableHandle,
ROCPROFILER_HIP_API_ID_hipMemGetAccess,
ROCPROFILER_HIP_API_ID_hipMemGetAllocationGranularity,
ROCPROFILER_HIP_API_ID_hipMemGetAllocationPropertiesFromHandle,
ROCPROFILER_HIP_API_ID_hipMemImportFromShareableHandle,
ROCPROFILER_HIP_API_ID_hipMemMap,
ROCPROFILER_HIP_API_ID_hipMemMapArrayAsync,
ROCPROFILER_HIP_API_ID_hipMemRelease,
ROCPROFILER_HIP_API_ID_hipMemRetainAllocationHandle,
ROCPROFILER_HIP_API_ID_hipMemSetAccess,
ROCPROFILER_HIP_API_ID_hipMemUnmap,
ROCPROFILER_HIP_API_ID_hipDeviceSetGraphMemAttribute,
ROCPROFILER_HIP_API_ID_hipDeviceGetGraphMemAttribute,
ROCPROFILER_HIP_API_ID_hipDeviceGraphMemTrim,
ROCPROFILER_HIP_API_ID_hipDeviceSetLimit,
ROCPROFILER_HIP_API_ID_hipTexRefSetArray,
ROCPROFILER_HIP_API_ID_hipTexRefSetFlags,
ROCPROFILER_HIP_API_ID_hipTexRefSetMipmapLevelBias,
ROCPROFILER_HIP_API_ID_hipDriverGetVersion,
ROCPROFILER_HIP_API_ID_hipGraphUpload,
ROCPROFILER_HIP_API_ID_hipRuntimeGetVersion,
ROCPROFILER_HIP_API_ID_hipUserObjectCreate,
ROCPROFILER_HIP_API_ID_hipUserObjectRelease,
ROCPROFILER_HIP_API_ID_hipUserObjectRetain,
ROCPROFILER_HIP_API_ID_hipGraphRetainUserObject,
ROCPROFILER_HIP_API_ID_hipGraphReleaseUserObject,
ROCPROFILER_HIP_API_ID_hipGraphDebugDotPrint,
ROCPROFILER_HIP_API_ID_hipGraphKernelNodeCopyAttributes,
ROCPROFILER_HIP_API_ID_hipGraphNodeGetEnabled,
ROCPROFILER_HIP_API_ID_hipGraphNodeSetEnabled,
ROCPROFILER_HIP_API_ID_hipPointerSetAttribute,
ROCPROFILER_HIP_API_ID_hipGraphAddMemAllocNode,
ROCPROFILER_HIP_API_ID_hipGraphAddMemFreeNode,
ROCPROFILER_HIP_API_ID_hipGraphMemAllocNodeGetParams,
ROCPROFILER_HIP_API_ID_hipGraphMemFreeNodeGetParams,
ROCPROFILER_HIP_API_ID_hipModuleLaunchCooperativeKernel,
ROCPROFILER_HIP_API_ID_hipModuleLaunchCooperativeKernelMultiDevice,
ROCPROFILER_HIP_API_ID_hipArray3DGetDescriptor,
ROCPROFILER_HIP_API_ID_hipArrayGetDescriptor,
ROCPROFILER_HIP_API_ID_hipArrayGetInfo,
ROCPROFILER_HIP_API_ID_hipStreamGetDevice,
ROCPROFILER_HIP_API_ID_LAST,
//
// Deprecated or removed
//
ROCPROFILER_HIP_API_ID_hipBindTexture = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipBindTexture2D = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipBindTextureToArray = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipBindTextureToMipmappedArray = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipCreateTextureObject = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipDestroyTextureObject = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipDeviceGetCount = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipGetTextureAlignmentOffset = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipGetTextureObjectResourceDesc = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipGetTextureObjectResourceViewDesc = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipGetTextureObjectTextureDesc = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipGetTextureReference = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipMemcpy2DArrayToArray = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipMemcpyArrayToArray = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipMemcpyAtoA = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipMemcpyAtoD = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipMemcpyAtoHAsync = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipMemcpyDtoA = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipMemcpyFromArrayAsync = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipMemcpyHtoAAsync = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipMemcpyToArrayAsync = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipModuleLaunchKernelExt = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipSetValidDevices = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipTexObjectCreate = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipTexObjectDestroy = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipTexObjectGetResourceDesc = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipTexObjectGetResourceViewDesc = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipTexObjectGetTextureDesc = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipTexRefGetAddressMode = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipTexRefGetArray = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipTexRefGetBorderColor = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipTexRefGetFilterMode = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipTexRefGetMipmapFilterMode = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipTexRefGetMipmappedArray = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipTexRefSetAddressMode = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipTexRefSetFilterMode = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipTexRefSetMipmapFilterMode = ROCPROFILER_HIP_API_ID_NONE,
ROCPROFILER_HIP_API_ID_hipUnbindTexture = ROCPROFILER_HIP_API_ID_NONE,
} rocprofiler_hip_api_id_t;
+62
Просмотреть файл
@@ -0,0 +1,62 @@
// MIT License
//
// Copyright (c) 2023 ROCm Developer Tools
//
// 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/hsa/api_id.h>
#include <rocprofiler/hsa/table_api_id.h>
#include <rocprofiler/hsa/api_args.h>
#include <hsa/hsa.h>
#include <stdint.h>
typedef uint32_t rocprofiler_trace_record_hsa_operation_kind_t;
typedef struct hsa_kernel_dispatch_packet_s hsa_kernel_dispatch_packet_t;
typedef struct rocprofiler_hsa_trace_data_s rocprofiler_hsa_trace_data_t;
typedef struct rocprofiler_hsa_api_data_s rocprofiler_hsa_api_data_t;
struct rocprofiler_hsa_api_data_s
{
uint64_t correlation_id;
uint32_t phase;
union
{
uint64_t uint64_t_retval;
uint32_t uint32_t_retval;
hsa_signal_value_t hsa_signal_value_t_retval;
hsa_status_t hsa_status_t_retval;
};
rocprofiler_hsa_api_args_t args;
uint64_t* phase_data;
};
struct rocprofiler_hsa_trace_data_s
{
rocprofiler_hsa_api_data_t api_data;
uint64_t phase_enter_timestamp;
uint64_t phase_exit_timestamp;
uint64_t phase_data;
void (*phase_enter)(rocprofiler_hsa_api_id_t operation_id, rocprofiler_hsa_trace_data_t* data);
void (*phase_exit)(rocprofiler_hsa_api_id_t operation_id, rocprofiler_hsa_trace_data_t* data);
};
+9
Просмотреть файл
@@ -0,0 +1,9 @@
#
#
# Installation of public HSA headers
#
#
set(ROCPROFILER_HSA_HEADER_FILES api_args.h api_id.h table_api_id.h)
install(FILES ${ROCPROFILER_HSA_HEADER_FILES}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler/hsa)
Разница между файлами не показана из-за своего большого размера Загрузить разницу
+227
Просмотреть файл
@@ -0,0 +1,227 @@
// Copyright (c) 2018-2023 Advanced Micro Devices, Inc.
//
// 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
// NOLINTNEXTLINE(performance-enum-size)
typedef enum
{
ROCPROFILER_HSA_API_ID_NONE = -1,
// block: CoreApi API
ROCPROFILER_HSA_API_ID_hsa_init = 0,
ROCPROFILER_HSA_API_ID_hsa_shut_down,
ROCPROFILER_HSA_API_ID_hsa_system_get_info,
ROCPROFILER_HSA_API_ID_hsa_system_extension_supported,
ROCPROFILER_HSA_API_ID_hsa_system_get_extension_table,
ROCPROFILER_HSA_API_ID_hsa_iterate_agents,
ROCPROFILER_HSA_API_ID_hsa_agent_get_info,
ROCPROFILER_HSA_API_ID_hsa_queue_create,
ROCPROFILER_HSA_API_ID_hsa_soft_queue_create,
ROCPROFILER_HSA_API_ID_hsa_queue_destroy,
ROCPROFILER_HSA_API_ID_hsa_queue_inactivate,
ROCPROFILER_HSA_API_ID_hsa_queue_load_read_index_scacquire,
ROCPROFILER_HSA_API_ID_hsa_queue_load_read_index_relaxed,
ROCPROFILER_HSA_API_ID_hsa_queue_load_write_index_scacquire,
ROCPROFILER_HSA_API_ID_hsa_queue_load_write_index_relaxed,
ROCPROFILER_HSA_API_ID_hsa_queue_store_write_index_relaxed,
ROCPROFILER_HSA_API_ID_hsa_queue_store_write_index_screlease,
ROCPROFILER_HSA_API_ID_hsa_queue_cas_write_index_scacq_screl,
ROCPROFILER_HSA_API_ID_hsa_queue_cas_write_index_scacquire,
ROCPROFILER_HSA_API_ID_hsa_queue_cas_write_index_relaxed,
ROCPROFILER_HSA_API_ID_hsa_queue_cas_write_index_screlease,
ROCPROFILER_HSA_API_ID_hsa_queue_add_write_index_scacq_screl,
ROCPROFILER_HSA_API_ID_hsa_queue_add_write_index_scacquire,
ROCPROFILER_HSA_API_ID_hsa_queue_add_write_index_relaxed,
ROCPROFILER_HSA_API_ID_hsa_queue_add_write_index_screlease,
ROCPROFILER_HSA_API_ID_hsa_queue_store_read_index_relaxed,
ROCPROFILER_HSA_API_ID_hsa_queue_store_read_index_screlease,
ROCPROFILER_HSA_API_ID_hsa_agent_iterate_regions,
ROCPROFILER_HSA_API_ID_hsa_region_get_info,
ROCPROFILER_HSA_API_ID_hsa_agent_get_exception_policies,
ROCPROFILER_HSA_API_ID_hsa_agent_extension_supported,
ROCPROFILER_HSA_API_ID_hsa_memory_register,
ROCPROFILER_HSA_API_ID_hsa_memory_deregister,
ROCPROFILER_HSA_API_ID_hsa_memory_allocate,
ROCPROFILER_HSA_API_ID_hsa_memory_free,
ROCPROFILER_HSA_API_ID_hsa_memory_copy,
ROCPROFILER_HSA_API_ID_hsa_memory_assign_agent,
ROCPROFILER_HSA_API_ID_hsa_signal_create,
ROCPROFILER_HSA_API_ID_hsa_signal_destroy,
ROCPROFILER_HSA_API_ID_hsa_signal_load_relaxed,
ROCPROFILER_HSA_API_ID_hsa_signal_load_scacquire,
ROCPROFILER_HSA_API_ID_hsa_signal_store_relaxed,
ROCPROFILER_HSA_API_ID_hsa_signal_store_screlease,
ROCPROFILER_HSA_API_ID_hsa_signal_wait_relaxed,
ROCPROFILER_HSA_API_ID_hsa_signal_wait_scacquire,
ROCPROFILER_HSA_API_ID_hsa_signal_and_relaxed,
ROCPROFILER_HSA_API_ID_hsa_signal_and_scacquire,
ROCPROFILER_HSA_API_ID_hsa_signal_and_screlease,
ROCPROFILER_HSA_API_ID_hsa_signal_and_scacq_screl,
ROCPROFILER_HSA_API_ID_hsa_signal_or_relaxed,
ROCPROFILER_HSA_API_ID_hsa_signal_or_scacquire,
ROCPROFILER_HSA_API_ID_hsa_signal_or_screlease,
ROCPROFILER_HSA_API_ID_hsa_signal_or_scacq_screl,
ROCPROFILER_HSA_API_ID_hsa_signal_xor_relaxed,
ROCPROFILER_HSA_API_ID_hsa_signal_xor_scacquire,
ROCPROFILER_HSA_API_ID_hsa_signal_xor_screlease,
ROCPROFILER_HSA_API_ID_hsa_signal_xor_scacq_screl,
ROCPROFILER_HSA_API_ID_hsa_signal_exchange_relaxed,
ROCPROFILER_HSA_API_ID_hsa_signal_exchange_scacquire,
ROCPROFILER_HSA_API_ID_hsa_signal_exchange_screlease,
ROCPROFILER_HSA_API_ID_hsa_signal_exchange_scacq_screl,
ROCPROFILER_HSA_API_ID_hsa_signal_add_relaxed,
ROCPROFILER_HSA_API_ID_hsa_signal_add_scacquire,
ROCPROFILER_HSA_API_ID_hsa_signal_add_screlease,
ROCPROFILER_HSA_API_ID_hsa_signal_add_scacq_screl,
ROCPROFILER_HSA_API_ID_hsa_signal_subtract_relaxed,
ROCPROFILER_HSA_API_ID_hsa_signal_subtract_scacquire,
ROCPROFILER_HSA_API_ID_hsa_signal_subtract_screlease,
ROCPROFILER_HSA_API_ID_hsa_signal_subtract_scacq_screl,
ROCPROFILER_HSA_API_ID_hsa_signal_cas_relaxed,
ROCPROFILER_HSA_API_ID_hsa_signal_cas_scacquire,
ROCPROFILER_HSA_API_ID_hsa_signal_cas_screlease,
ROCPROFILER_HSA_API_ID_hsa_signal_cas_scacq_screl,
ROCPROFILER_HSA_API_ID_hsa_isa_from_name,
ROCPROFILER_HSA_API_ID_hsa_isa_get_info,
ROCPROFILER_HSA_API_ID_hsa_isa_compatible,
ROCPROFILER_HSA_API_ID_hsa_code_object_serialize,
ROCPROFILER_HSA_API_ID_hsa_code_object_deserialize,
ROCPROFILER_HSA_API_ID_hsa_code_object_destroy,
ROCPROFILER_HSA_API_ID_hsa_code_object_get_info,
ROCPROFILER_HSA_API_ID_hsa_code_object_get_symbol,
ROCPROFILER_HSA_API_ID_hsa_code_symbol_get_info,
ROCPROFILER_HSA_API_ID_hsa_code_object_iterate_symbols,
ROCPROFILER_HSA_API_ID_hsa_executable_create,
ROCPROFILER_HSA_API_ID_hsa_executable_destroy,
ROCPROFILER_HSA_API_ID_hsa_executable_load_code_object,
ROCPROFILER_HSA_API_ID_hsa_executable_freeze,
ROCPROFILER_HSA_API_ID_hsa_executable_get_info,
ROCPROFILER_HSA_API_ID_hsa_executable_global_variable_define,
ROCPROFILER_HSA_API_ID_hsa_executable_agent_global_variable_define,
ROCPROFILER_HSA_API_ID_hsa_executable_readonly_variable_define,
ROCPROFILER_HSA_API_ID_hsa_executable_validate,
ROCPROFILER_HSA_API_ID_hsa_executable_get_symbol,
ROCPROFILER_HSA_API_ID_hsa_executable_symbol_get_info,
ROCPROFILER_HSA_API_ID_hsa_executable_iterate_symbols,
ROCPROFILER_HSA_API_ID_hsa_status_string,
ROCPROFILER_HSA_API_ID_hsa_extension_get_name,
ROCPROFILER_HSA_API_ID_hsa_system_major_extension_supported,
ROCPROFILER_HSA_API_ID_hsa_system_get_major_extension_table,
ROCPROFILER_HSA_API_ID_hsa_agent_major_extension_supported,
ROCPROFILER_HSA_API_ID_hsa_cache_get_info,
ROCPROFILER_HSA_API_ID_hsa_agent_iterate_caches,
ROCPROFILER_HSA_API_ID_hsa_signal_silent_store_relaxed,
ROCPROFILER_HSA_API_ID_hsa_signal_silent_store_screlease,
ROCPROFILER_HSA_API_ID_hsa_signal_group_create,
ROCPROFILER_HSA_API_ID_hsa_signal_group_destroy,
ROCPROFILER_HSA_API_ID_hsa_signal_group_wait_any_scacquire,
ROCPROFILER_HSA_API_ID_hsa_signal_group_wait_any_relaxed,
ROCPROFILER_HSA_API_ID_hsa_agent_iterate_isas,
ROCPROFILER_HSA_API_ID_hsa_isa_get_info_alt,
ROCPROFILER_HSA_API_ID_hsa_isa_get_exception_policies,
ROCPROFILER_HSA_API_ID_hsa_isa_get_round_method,
ROCPROFILER_HSA_API_ID_hsa_wavefront_get_info,
ROCPROFILER_HSA_API_ID_hsa_isa_iterate_wavefronts,
ROCPROFILER_HSA_API_ID_hsa_code_object_get_symbol_from_name,
ROCPROFILER_HSA_API_ID_hsa_code_object_reader_create_from_file,
ROCPROFILER_HSA_API_ID_hsa_code_object_reader_create_from_memory,
ROCPROFILER_HSA_API_ID_hsa_code_object_reader_destroy,
ROCPROFILER_HSA_API_ID_hsa_executable_create_alt,
ROCPROFILER_HSA_API_ID_hsa_executable_load_program_code_object,
ROCPROFILER_HSA_API_ID_hsa_executable_load_agent_code_object,
ROCPROFILER_HSA_API_ID_hsa_executable_validate_alt,
ROCPROFILER_HSA_API_ID_hsa_executable_get_symbol_by_name,
ROCPROFILER_HSA_API_ID_hsa_executable_iterate_agent_symbols,
ROCPROFILER_HSA_API_ID_hsa_executable_iterate_program_symbols,
// block: AmdExt API
ROCPROFILER_HSA_API_ID_hsa_amd_coherency_get_type,
ROCPROFILER_HSA_API_ID_hsa_amd_coherency_set_type,
ROCPROFILER_HSA_API_ID_hsa_amd_profiling_set_profiler_enabled,
ROCPROFILER_HSA_API_ID_hsa_amd_profiling_async_copy_enable,
ROCPROFILER_HSA_API_ID_hsa_amd_profiling_get_dispatch_time,
ROCPROFILER_HSA_API_ID_hsa_amd_profiling_get_async_copy_time,
ROCPROFILER_HSA_API_ID_hsa_amd_profiling_convert_tick_to_system_domain,
ROCPROFILER_HSA_API_ID_hsa_amd_signal_async_handler,
ROCPROFILER_HSA_API_ID_hsa_amd_async_function,
ROCPROFILER_HSA_API_ID_hsa_amd_signal_wait_any,
ROCPROFILER_HSA_API_ID_hsa_amd_queue_cu_set_mask,
ROCPROFILER_HSA_API_ID_hsa_amd_memory_pool_get_info,
ROCPROFILER_HSA_API_ID_hsa_amd_agent_iterate_memory_pools,
ROCPROFILER_HSA_API_ID_hsa_amd_memory_pool_allocate,
ROCPROFILER_HSA_API_ID_hsa_amd_memory_pool_free,
ROCPROFILER_HSA_API_ID_hsa_amd_memory_async_copy,
ROCPROFILER_HSA_API_ID_hsa_amd_memory_async_copy_on_engine,
ROCPROFILER_HSA_API_ID_hsa_amd_memory_copy_engine_status,
ROCPROFILER_HSA_API_ID_hsa_amd_agent_memory_pool_get_info,
ROCPROFILER_HSA_API_ID_hsa_amd_agents_allow_access,
ROCPROFILER_HSA_API_ID_hsa_amd_memory_pool_can_migrate,
ROCPROFILER_HSA_API_ID_hsa_amd_memory_migrate,
ROCPROFILER_HSA_API_ID_hsa_amd_memory_lock,
ROCPROFILER_HSA_API_ID_hsa_amd_memory_unlock,
ROCPROFILER_HSA_API_ID_hsa_amd_memory_fill,
ROCPROFILER_HSA_API_ID_hsa_amd_interop_map_buffer,
ROCPROFILER_HSA_API_ID_hsa_amd_interop_unmap_buffer,
ROCPROFILER_HSA_API_ID_hsa_amd_image_create,
ROCPROFILER_HSA_API_ID_hsa_amd_pointer_info,
ROCPROFILER_HSA_API_ID_hsa_amd_pointer_info_set_userdata,
ROCPROFILER_HSA_API_ID_hsa_amd_ipc_memory_create,
ROCPROFILER_HSA_API_ID_hsa_amd_ipc_memory_attach,
ROCPROFILER_HSA_API_ID_hsa_amd_ipc_memory_detach,
ROCPROFILER_HSA_API_ID_hsa_amd_signal_create,
ROCPROFILER_HSA_API_ID_hsa_amd_ipc_signal_create,
ROCPROFILER_HSA_API_ID_hsa_amd_ipc_signal_attach,
ROCPROFILER_HSA_API_ID_hsa_amd_register_system_event_handler,
ROCPROFILER_HSA_API_ID_hsa_amd_queue_intercept_create,
ROCPROFILER_HSA_API_ID_hsa_amd_queue_intercept_register,
ROCPROFILER_HSA_API_ID_hsa_amd_queue_set_priority,
ROCPROFILER_HSA_API_ID_hsa_amd_memory_async_copy_rect,
ROCPROFILER_HSA_API_ID_hsa_amd_runtime_queue_create_register,
ROCPROFILER_HSA_API_ID_hsa_amd_memory_lock_to_pool,
ROCPROFILER_HSA_API_ID_hsa_amd_register_deallocation_callback,
ROCPROFILER_HSA_API_ID_hsa_amd_deregister_deallocation_callback,
ROCPROFILER_HSA_API_ID_hsa_amd_signal_value_pointer,
ROCPROFILER_HSA_API_ID_hsa_amd_svm_attributes_set,
ROCPROFILER_HSA_API_ID_hsa_amd_svm_attributes_get,
ROCPROFILER_HSA_API_ID_hsa_amd_svm_prefetch_async,
ROCPROFILER_HSA_API_ID_hsa_amd_spm_acquire,
ROCPROFILER_HSA_API_ID_hsa_amd_spm_release,
ROCPROFILER_HSA_API_ID_hsa_amd_spm_set_dest_buffer,
ROCPROFILER_HSA_API_ID_hsa_amd_queue_cu_get_mask,
ROCPROFILER_HSA_API_ID_hsa_amd_portable_export_dmabuf,
ROCPROFILER_HSA_API_ID_hsa_amd_portable_close_dmabuf,
// block: ImageExt API
ROCPROFILER_HSA_API_ID_hsa_ext_image_get_capability,
ROCPROFILER_HSA_API_ID_hsa_ext_image_data_get_info,
ROCPROFILER_HSA_API_ID_hsa_ext_image_create,
ROCPROFILER_HSA_API_ID_hsa_ext_image_import,
ROCPROFILER_HSA_API_ID_hsa_ext_image_export,
ROCPROFILER_HSA_API_ID_hsa_ext_image_copy,
ROCPROFILER_HSA_API_ID_hsa_ext_image_clear,
ROCPROFILER_HSA_API_ID_hsa_ext_image_destroy,
ROCPROFILER_HSA_API_ID_hsa_ext_sampler_create,
ROCPROFILER_HSA_API_ID_hsa_ext_sampler_destroy,
ROCPROFILER_HSA_API_ID_hsa_ext_image_get_capability_with_layout,
ROCPROFILER_HSA_API_ID_hsa_ext_image_data_get_info_with_layout,
ROCPROFILER_HSA_API_ID_hsa_ext_image_create_with_layout,
ROCPROFILER_HSA_API_ID_LAST,
} rocprofiler_hsa_api_id_t;
+31
Просмотреть файл
@@ -0,0 +1,31 @@
// Copyright (c) 2018-2023 Advanced Micro Devices, Inc.
//
// 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
// NOLINTNEXTLINE(performance-enum-size)
typedef enum
{
ROCPROFILER_HSA_API_TABLE_ID_NONE = -1,
ROCPROFILER_HSA_API_TABLE_ID_CoreApi = 0,
ROCPROFILER_HSA_API_TABLE_ID_AmdExt,
ROCPROFILER_HSA_API_TABLE_ID_ImageExt,
ROCPROFILER_HSA_API_TABLE_ID_LAST,
} rocprofiler_hsa_table_api_id_t;
+35
Просмотреть файл
@@ -0,0 +1,35 @@
// MIT License
//
// Copyright (c) 2023 ROCm Developer Tools
//
// 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/marker/api_args.h>
#include <stdint.h>
typedef uint32_t rocprofiler_trace_record_marker_operation_kind_t;
typedef struct rocprofiler_roctx_api_data_s rocprofiler_roctx_api_data_t;
struct rocprofiler_roctx_api_data_s
{
rocprofiler_roctx_api_args_t args;
};
+9
Просмотреть файл
@@ -0,0 +1,9 @@
#
#
# Installation of public HSA headers
#
#
set(ROCPROFILER_MARKER_HEADER_FILES api_args.h api_id.h)
install(FILES ${ROCPROFILER_MARKER_HEADER_FILES}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler/marker)
+51
Просмотреть файл
@@ -0,0 +1,51 @@
// Copyright (c) 2018-2023 Advanced Micro Devices, Inc.
//
// 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 <stdint.h>
typedef uint64_t roctx_range_id_t;
typedef union rocprofiler_roctx_api_args_u
{
struct
{
const char* message;
} roctxMarkA;
struct
{
const char* message;
} roctxRangePushA;
struct
{
const char* message;
} roctxRangePop;
struct
{
const char* message;
roctx_range_id_t id;
} roctxRangeStartA;
struct
{
const char* message;
roctx_range_id_t id;
} roctxRangeStop;
} rocprofiler_roctx_api_args_t;
+33
Просмотреть файл
@@ -0,0 +1,33 @@
// Copyright (c) 2018-2023 Advanced Micro Devices, Inc.
//
// 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
// NOLINTNEXTLINE(performance-enum-size)
typedef enum
{
ROCPROFILER_ROCTX_API_ID_NONE = -1,
ROCPROFILER_ROCTX_API_ID_roctxMarkA = 0,
ROCPROFILER_ROCTX_API_ID_roctxRangePushA,
ROCPROFILER_ROCTX_API_ID_roctxRangePop,
ROCPROFILER_ROCTX_API_ID_roctxRangeStartA,
ROCPROFILER_ROCTX_API_ID_roctxRangeStop,
ROCPROFILER_ROCTX_API_ID_LAST,
} rocprofiler_roctx_api_id_t;
Разница между файлами не показана из-за своего большого размера Загрузить разницу
+29 -30
Просмотреть файл
@@ -1,22 +1,24 @@
/* Copyright (c) 2022 Advanced Micro Devices, Inc.
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. */
// MIT License
//
// Copyright (c) 2023 ROCm Developer Tools
//
// 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.
/** \section rocprofiler_plugin_api ROCProfiler Plugin API
*
@@ -39,13 +41,12 @@
* ROCProfiler Tool Plugin API interface.
*/
#ifndef ROCPROFILER_PLUGIN_H_
#define ROCPROFILER_PLUGIN_H_
#pragma once
#include "rocprofiler/rocprofiler.h"
#include <stdint.h>
#include "rocprofiler.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -109,15 +110,15 @@ rocprofiler_plugin_finalize();
*
* @param[in] begin Pointer to the first record.
* @param[in] end Pointer to one past the last record.
* @param[in] session_id Session ID
* @param[in] context_id context ID
* @param[in] buffer_id Buffer ID
* @return Returns 0 on success and -1 on error.
*/
ROCPROFILER_EXPORT int
rocprofiler_plugin_write_buffer_records(const rocprofiler_record_header_t* begin,
const rocprofiler_record_header_t* end,
rocprofiler_session_id_t session_id,
rocprofiler_buffer_id_t buffer_id);
rocprofiler_plugin_write_buffer_records(rocprofiler_context_id_t context_id,
rocprofiler_buffer_id_t buffer_id,
rocprofiler_record_header_t** headers,
size_t num_headers);
/**
* Report Synchronous Record.
@@ -138,5 +139,3 @@ rocprofiler_plugin_write_record(rocprofiler_record_tracer_t record);
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
#endif /* ROCPROFILER_PLUGIN_H_ */
+61
Просмотреть файл
@@ -0,0 +1,61 @@
// MIT License
//
// Copyright (c) 2023 ROCm Developer Tools
//
// 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
/**
* @def ROCPROFILER_VERSION_MAJOR
* @brief The major version of the interface as a macro so it can be used
* by the preprocessor.
* @addtogroup VERSIONING_GROUP
*
* @def ROCPROFILER_VERSION_MINOR
* @brief The minor version of the interface as a macro so it can be used
* by the preprocessor.
* @addtogroup VERSIONING_GROUP
*/
// clang-format off
#define ROCPROFILER_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
#define ROCPROFILER_VERSION_MINOR @PROJECT_VERSION_MINOR@
#define ROCPROFILER_VERSION_PATCH @PROJECT_VERSION_PATCH@
#define ROCPROFILER_VERSION_STRING "@FULL_VERSION_STRING@"
#define ROCPROFILER_SOVERSION "@PROJECT_VERSION_MAJOR@"
#define ROCPROFILER_GIT_DESCRIBE "@ROCPROFILER_GIT_DESCRIBE@"
#define ROCPROFILER_GIT_REVISION "@ROCPROFILER_GIT_REVISION@"
// system info during compilation
#define ROCPROFILER_LIBRARY_ARCH "@CMAKE_LIBRARY_ARCHITECTURE@"
#define ROCPROFILER_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@"
#define ROCPROFILER_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@"
#define ROCPROFILER_SYSTEM_VERSION "@CMAKE_SYSTEM_VERSION@"
// compiler information
#define ROCPROFILER_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@"
#define ROCPROFILER_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@"
// clang-format on
#define ROCPROFILER_COMPILER_STRING ROCPROFILER_COMPILER_ID " v" ROCPROFILER_COMPILER_VERSION
#define ROCPROFILER_VERSION \
((10000 * ROCPROFILER_VERSION_MAJOR) + (100 * ROCPROFILER_VERSION_MINOR) + \
ROCPROFILER_VERSION_PATCH)
+2 -1
Просмотреть файл
@@ -24,4 +24,5 @@ set_target_properties(
rocprofiler-library
PROPERTIES OUTPUT_NAME rocprofiler64
SOVERSION ${PROJECT_VERSION_MAJOR}
VERSION ${PROJECT_VERSION})
VERSION ${PROJECT_VERSION}
DEFINE_SYMBOL rocprofiler_EXPORTS)