d3eaacd610
* Update scripts/update-doxygen.sh
- ensure build-docs folder exists
* Update scripts/run-ci.py
- exclude files in details subdirectory from code coverage
* Update scripts/thread-sanitizer-suppr.txt
- exclude races in glog
* Update docs/rocprofiler.dox.in
- exclude defines in include/rocprofiler/defines.h from doxygen
- Tweak EXCLUDE_PATTERNS and EXAMPLE_PATTERNS
* Update docs workflow
- trigger workflow whenever there is a change to the public headers (which may be doxygen comments)
* Update include/rocprofiler (reorg and overhaul)
- rocprofiler_status_t additions
- CONTEXT_NOT_FOUND
- CONTEXT_ERROR
- INVALID_CONTEXT_ID
- INVALID_CONTEXT
- BUFFER_BUSY
- rocprofiler_context_is_active func
- rocprofiler_context_is_valid func
- rocprofiler_service_callback_tracing_kind_t update
- remove ROCPROFILER_SERVICE_CALLBACK_TRACING_HELPER_THREAD
- Remove rocprofiler_tracing_helper_thread_operation_t
- Remove rocprofiler_helper_thread_callback_tracer_data_t
- Added rocprofiler_internal_thread_library_t
- Added rocprofiler_at_internal_thread_create
- split rocprofiler.h into several smaller headers
- reworked rocprofiler_status_t values
- added doxygen comments for enums
- replaced rocprofiler_trace_record_operation_kind_t with rocprofiler_trace_operation_t
- use @ instead of / in doxygen comment in rocprofiler_plugin.h
- fix ref to ROCPROFILER_SERVICE_CALLBACK_TRACING_MARKER_API
- end group in fwd.h
- remove PROFILE_COUNTING group in dispatch_profile.h
- remove premature group close in callback_tracing.h
- hsa.h: remove rocprofiler_hsa_trace_data_t
- fwd.h: remove rocprofiler_tracer_callback_data_t
- rename rocprofiler_correlation_id_t.handle to rocprofiler_correlation_id_t.id (consistency)
- fwd.h: add rocprofiler_callback_tracing_record_t
- callback_tracing.h: update rocprofiler_hsa_api_callback_tracer_data_t
- callback_tracing.h: add size fields
- simplify rocprofiler_tracer_callback_t
- removed ROCPROFILER_NONNULL from rocprofiler_get_version
- added rocprofiler_get_timestamp
- ROCPROFILER_STATUS_ERROR_CONFIGURATION_LOCKED in rocprofiler_status_t
- add ROCPROFILER_STATUS_ERROR_THREAD_NOT_FOUND rocprofiler_status_t
- add rocprofiler_buffer_category_t
- rocprofiler_trace_operation_t -> rocprofiler_tracing_operation_t
- rocprofiler_user_data_t union
- tweak rocprofiler_callback_tracing_record_t
- make external_correlation_id non-pointer
- add rocprofiler_user_data_t data field
- tweak rocprofiler_record_header_t
- instead of single uint64_t kind field, have union for category + kind (two u32) with u64 hash
- API extensions for kind id <-> kind string
- API extensions for operation id <-> operation string
- rocprofiler_callback_trace_kind_name_cb_t
- rocprofiler_callback_trace_operation_name_cb_t
- rocprofiler_iterate_callback_trace_kind_names
- rocprofiler_iterate_callback_trace_kind_operation_names
- modify rocprofiler_hsa_api_callback_tracer_data_t data members (remove pointers)
- add rocprofiler_callback_trace_operation_args_cb_t function pointer typedef
- add rocprofiler_iterate_callback_trace_operation_args function
- fixed inconsistent use of *_trace_* vs. *_tracing_* (opting for tracing)
- removed rocprofiler_query_callback_trace_kind_name
- removed rocprofiler_query_callback_kind_operation_name
- Add include/rocprofiler/registration.h
- header dedicated to registering a tool/client with rocprofiler
- this header is not intended to be included by rocprofiler.h
- rocprofiler_client_id_t
- identifier for client tool
- rocprofiler_client_finalize_t
- function pointer prototype for tool-initiated finalization
- rocprofiler_tool_initialize_t
- function pointer prototype for tool initialization (i.e. configuration)
- rocprofiler_tool_finalize_t
- function pointer prototype for tool finalization
- rocprofiler_tool_configure_result_t
- struct returned by tool/client to rocprofiler
- rocprofiler_is_initialized
- function for querying whether tool-induced initialization is possible
- rocprofiler_is_finalized
- function for querying whether rocprofiler has been finalized
- rocprofiler_configure prototype
- this is the function tools implement
- prototype is always marked as having default visibility
- no implementation in rocprofiler
- added typedef for rocprofiler_configure function pointer
- added rocprofiler_force_configure to explicitly invoke rocprofiler_configure instead of relying on lazy init
- made callback typedef names more consistent (_cb_t suffix)
- typedef for rocprofiler_internal_thread_library_cb_t function pointer
- added rocprofiler_at_internal_thread_create function
- added rocprofiler_callback_thread_t struct
- added rocprofiler_create_callback_thread function
- added rocprofiler_assign_callback_thread function
- removed rocprofiler_buffer_tracing_record_header_t in favor of kind and correlation id in each record type
- added rocprofiler_buffer_tracing_kind_name_cb_t typedef
- added rocprofiler_buffer_tracing_operation_name_cb_t typedef
- added rocprofiler_iterate_buffer_tracing_kind_names function
- added rocprofiler_iterate_buffer_tracing_kind_operation_names function
- removed rocprofiler_query_buffer_trace_kind_name function
- removed rocprofiler_query_buffer_kind_operation_name function
* Update lib/common/container/stable_vector.hpp
- include limits header
- reserve_size struct
- overload stable_vector constructor to support reserving as part of construction
* Update lib/common/container/record_header_buffer.{hpp,cpp}
- add emplace member function accepting category and kind (two u32 variables) instead of one u64 kind
- use std::shared_mutex to prevent data-race when reading m_headers
- record_header_buffer is now multiple writer, single reader
- add read_lock member function (shared)
- add read_unlock member function (shared)
- lock member function gets exclusive lock
- unlock member function releases exclusive lock
* Rename "config" to "context" + restructure + implement
- Restructure config files + license
- move config files into lib/rocprofiler/config subfolder
- rename some files
- add license to some files which were missing it
- Rename config/helpers.hpp
- rename to allocator.hpp
- remove get_domain_max_ops
- Create config/domain.{hpp,cpp}
- structures for handling tracing domains and ops
- Update config/config.{hpp,cpp}
- buffer_instance struct
- callback_tracing_service struct
- buffer_tracing_service struct
- config struct
- allocate_{config,buffer} func
- {validate,start,stop}_config funcs
- get_registered_configs func
- get_active_configs func
- get_buffers func
- Update rocprofiler.cpp
- Implement rocprofiler_create_context
- Implement rocprofiler_start_context
- Implement rocprofiler_stop_context
- Implement rocprofiler_context_is_active
- Implement rocprofiler_context_is_valid
- Implement rocprofiler_flush_buffer
- Implement rocprofiler_destroy_buffer
- Implement rocprofiler_create_buffer
- Update lib/rocprofiler/hsa
- use rocprofiler_tracer_activity_domain_t instead of rocprofiler_tracer_activity_domain_t
- remove ROCPROFILER_TRACER_ACTIVITY_DOMAIN_HSA_API fromHSA_API_INFO_DEFINITION_* macros
- Update lib/rocprofiler/context/domain.*
- fixes for domain_info (i.e. use correct enums)
- update rocprofiler_status_t codes
- fix template instantiations
- Update lib/rocprofiler/context/context.*
- use rocprofiler_service_callback_tracing_kind_t instead of rocprofiler_tracer_activity_domain_t
- rename correlation_context to correlation_tracing_service
- fix domains in callback_tracing_service and buffer_tracing_service
- unique_ptr for callback_tracer and buffered_tracer in context
- Update lib/rocprofiler/rocprofiler.cpp
- implement rocprofiler_configure_callback_tracing_service
- Update lib/rocprofiler/hsa/ostream.hpp
- include rocprofiler.h instead of tracer.hpp
- Update lib/rocprofiler/hsa
- migration to use rocprofiler_hsa_api_callback_tracer_data_t instead of rocprofiler_hsa_trace_data_t
- restructure hsa_api_impl<Idx>
- remove phase_enter and phase_exit
- add set_data_args (partial replacement for phase_enter)
- functor handles the contexts
- Update lib/rocprofiler/rocprofiler.cpp
- implement rocprofiler_get_version
- Update lib/rocprofiler/hsa/hsa.{hpp,cpp}
- remove hsa_api_ prefix for functions already in hsa namespace
- Update lib/rocprofiler/context/context.{hpp,cpp}
- add client_idx to context struct (tool identifier)
- add push_client function to set client_idx before context is allocated
- add pop_client function to remove client identifier from future context creations
- implemented {registered,active}_contexts and buffers to use new container::reserve_size overload to stable_vector
- fix implementation of start_context
- fix implementation of stop_context
- Update lib/rocprofiler/rocprofiler.cpp
- prevent context creation, buffer creation, pc sampling config, etc. after initialization
- add nullptr checks to rocprofiler_context_is_valid
- fix rocprofiler_configure_callback_tracing_service
- was checking size of buffers, not registered context
- implement rocprofiler_iterate_callback_trace_kind_names
- implement rocprofiler_iterate_callback_trace_kind_operation_names
- Update lib/rocprofiler/CMakeLists.txt
- add registration.{hpp,cpp} to rocprofiler-library target sources
- Update lib/rocprofiler/hsa/utils.hpp
- fix using fmt::formt with const char* strings
- remove join functions (no longer used)
- Update lib/rocprofiler/hsa/hsa.{hpp,cpp}
- remove args_string function
- remove named_args_string function
- update iterate_args function
- change callback type
- accept user data
- rework the hsa_api_impl<Idx>::functor function
- save the rocprofiler_callback_tracing_record_t between callbacks
- update update_table function
- check buffered_tracer domains
- remove comments
- Update lib/rocprofiler/hsa/defines.hpp
- remove MEMBER_<N> macros
- add ADDR_MEMBER_<N> macros
- remove doxygen comments for GET_MEMBER_FIELDS
- add GET_ADDR_MEMBER_FIELDS
- update HSA_API_INFO_DEFINITION_{0,V}
- rename domain_idx to callback_domain_idx
- add buffered_domain_idx
- add as_arg_addr function
- Update lib/rocprofiler/rocprofiler.cpp
- implement rocprofiler_iterate_callback_trace_operation_args
- Remove lib/rocprofiler/tracing.{hpp,cpp} and lib/rocprofiler/CMakeLists.txt
- unused
- Update lib/rocprofiler/hsa/hsa.{hpp,cpp}
- support buffered tracing in hsa_api_impl<Idx>::functor
- rocprofiler_callback_trace_operation_args_cb_t -> rocprofiler_callback_tracing_operation_args_cb_t
- i.e. trace -> tracing
- Update lib/rocprofiler/context/context.{hpp,cpp}
- removed buffer_instance struct
- removed allocate_buffer function
- removed get_buffers function
- changed buffer_tracing_service::buffer_array_t
- Update lib/rocprofiler/hsa: hsa.cpp, ostream.hpp, details folder
- move ostream.hpp into details folder to prevent from contributing to code coverage
- update cmake build system for new directory
* Add lib/rocprofiler/registration.{hpp,cpp}
- implements rocprofiler_set_api_table (called by rocprofiler-register)
- miscellaneous functions for client configure/initialize/finalize
- functions for querying the init/fini status
- relocated OnLoad HSA workaround to this file
- at present, this is used to workaround ROCr not having rocprofiler-register integration yet
- implement rocprofiler_force_configure function
- implement rocprofiler_is_initialized function
- implement rocprofiler_is_finalized function
- ensure configure functions only invoked once
- ensure internal thread creation notification functions are invoked
- get_status is pair of atomics
- fix heap-use-after-free in init_logging
- update finalize
- invoke hsa_shut_down
- set all active contexts to null pointers
* Add lib/rocprofiler/buffer_tracing.cpp
- contains implementations of buffer_tracing (i.e. rocprofiler/buffer_tracing.h)
- previous implementation may have been moved out of lib/rocprofiler/rocprofiler.cpp
* Add lib/rocprofiler/buffer.{hpp,cpp}
- contains implementations of buffer (i.e. rocprofiler/buffer.h) and misc internal access functions
- previous implementation may have been moved out of lib/rocprofiler/rocprofiler.cpp and lib/rocprofiler/context/context.{hpp,cpp}
* Add lib/rocprofiler/callback_tracing.cpp
- contains implementations of callback_tracing (i.e. rocprofiler/callback_tracing.h)
- previous implementation may have been moved out of lib/rocprofiler/rocprofiler.cpp
* Add lib/rocprofiler/context.cpp
- contains implementations of context public API functions (i.e. rocprofiler/context.h)
- previous implementation may have been moved out of lib/rocprofiler/rocprofiler.cpp
* Add lib/rocprofiler/internal_threading.{hpp,cpp}
- contains implementations of internal_threading (i.e. rocprofiler/internal_threading.h)
- also contains implementations of internal access functions
- update finalize function
- join all task groups and destroy all thread pools first, then reset unique_ptr
* Update lib/rocprofiler/rocprofiler.cpp
- rocprofiler_get_version returns status
- implement rocprofiler_get_timestamp
- remove misc implementations that were split into other files
* Update lib/rocprofiler/CMakeLists.txt
- compile new implementation files
- buffer.cpp
- buffer_tracing.cpp
- callback_tracing.cpp
- context.cpp
- internal_threading.cpp
* Update lib/tests/buffering/buffering-*.cpp
- update to reflect changes to rocprofiler_record_header_t
* Update CMakeLists.txt
- increase minimum cmake version to 3.21 which added HIP support as a language
* Add samples/apps/transpose
- simple HIP application for testing
* Add samples/api_callback_tracing
- HIP application and tool library
- This effectively demos how to setup HSA API tracing
- For each function called in tool, it stores the func/file/line and prints it during finalization
- client.hpp and client.cpp are the tool library
- Implement use of rocprofiler_iterate_callback_trace_operation_args
- add demo of using rocprofiler_get_version
- add_test
- remove PASS_REGULAR_EXPRESSION
- causing false passes during memcheck
- add ROCPROFILER_MEMCHECK_PRELOAD_ENV to environment
- check if rocprofiler is initialized before stopping context
* Add samples/api_buffered_tracing
- Sample demonstrating tracing the HSA API via buffering
- demo rocprofiler_record_header_compute_hash
- throw exceptions for unexpected buffer data
- add_test
- remove PASS_REGULAR_EXPRESSION
- causing false passes during memcheck
- add ROCPROFILER_MEMCHECK_PRELOAD_ENV to environment
* Update samples/CMakeLists.txt
- add subdirectory for api_callback_tracing
- add subdirectory api_buffered_tracing
* Update samples/pc_sampling/common.h
- fix processing of headers
* Update lib/rocprofiler/hsa/details/ostream.hpp
- fix data race on HSA_depth_max_cnt and recursion
- HSA_depth_max_cnt and recursion is now thread-local static instead of global static
- replace std::string usage with std::string_view
* Actions update
- add dependabot.yml
- use actions/checkout@v4
- install latest libasan and libtsan in sanitizer containers
* Add PTL (Parallel Tasking Library) submodule
1308 líneas
37 KiB
C
1308 líneas
37 KiB
C
// 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 <hsa/hsa.h>
|
|
#include <hsa/hsa_api_trace.h>
|
|
#include <hsa/hsa_ext_amd.h>
|
|
#include <hsa/hsa_ext_image.h>
|
|
#include <rocprofiler/version.h>
|
|
|
|
typedef union rocprofiler_hsa_api_retval_u
|
|
{
|
|
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_retval_t;
|
|
|
|
typedef union rocprofiler_hsa_api_args_u
|
|
{
|
|
// block: CoreApi API
|
|
struct
|
|
{
|
|
} hsa_init;
|
|
struct
|
|
{
|
|
} hsa_shut_down;
|
|
struct
|
|
{
|
|
hsa_system_info_t attribute;
|
|
void* value;
|
|
} hsa_system_get_info;
|
|
struct
|
|
{
|
|
uint16_t extension;
|
|
uint16_t version_major;
|
|
uint16_t version_minor;
|
|
bool* result;
|
|
} hsa_system_extension_supported;
|
|
struct
|
|
{
|
|
uint16_t extension;
|
|
uint16_t version_major;
|
|
uint16_t version_minor;
|
|
void* table;
|
|
} hsa_system_get_extension_table;
|
|
struct
|
|
{
|
|
hsa_status_t (*callback)(hsa_agent_t agent, void* data);
|
|
void* data;
|
|
} hsa_iterate_agents;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
hsa_agent_info_t attribute;
|
|
void* value;
|
|
} hsa_agent_get_info;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
uint32_t size;
|
|
hsa_queue_type32_t type;
|
|
void (*callback)(hsa_status_t status, hsa_queue_t* source, void* data);
|
|
void* data;
|
|
uint32_t private_segment_size;
|
|
uint32_t group_segment_size;
|
|
hsa_queue_t** queue;
|
|
} hsa_queue_create;
|
|
struct
|
|
{
|
|
hsa_region_t region;
|
|
uint32_t size;
|
|
hsa_queue_type32_t type;
|
|
uint32_t features;
|
|
hsa_signal_t doorbell_signal;
|
|
hsa_queue_t** queue;
|
|
} hsa_soft_queue_create;
|
|
struct
|
|
{
|
|
hsa_queue_t* queue;
|
|
} hsa_queue_destroy;
|
|
struct
|
|
{
|
|
hsa_queue_t* queue;
|
|
} hsa_queue_inactivate;
|
|
struct
|
|
{
|
|
const hsa_queue_t* queue;
|
|
} hsa_queue_load_read_index_scacquire;
|
|
struct
|
|
{
|
|
const hsa_queue_t* queue;
|
|
} hsa_queue_load_read_index_relaxed;
|
|
struct
|
|
{
|
|
const hsa_queue_t* queue;
|
|
} hsa_queue_load_write_index_scacquire;
|
|
struct
|
|
{
|
|
const hsa_queue_t* queue;
|
|
} hsa_queue_load_write_index_relaxed;
|
|
struct
|
|
{
|
|
const hsa_queue_t* queue;
|
|
uint64_t value;
|
|
} hsa_queue_store_write_index_relaxed;
|
|
struct
|
|
{
|
|
const hsa_queue_t* queue;
|
|
uint64_t value;
|
|
} hsa_queue_store_write_index_screlease;
|
|
struct
|
|
{
|
|
const hsa_queue_t* queue;
|
|
uint64_t expected;
|
|
uint64_t value;
|
|
} hsa_queue_cas_write_index_scacq_screl;
|
|
struct
|
|
{
|
|
const hsa_queue_t* queue;
|
|
uint64_t expected;
|
|
uint64_t value;
|
|
} hsa_queue_cas_write_index_scacquire;
|
|
struct
|
|
{
|
|
const hsa_queue_t* queue;
|
|
uint64_t expected;
|
|
uint64_t value;
|
|
} hsa_queue_cas_write_index_relaxed;
|
|
struct
|
|
{
|
|
const hsa_queue_t* queue;
|
|
uint64_t expected;
|
|
uint64_t value;
|
|
} hsa_queue_cas_write_index_screlease;
|
|
struct
|
|
{
|
|
const hsa_queue_t* queue;
|
|
uint64_t value;
|
|
} hsa_queue_add_write_index_scacq_screl;
|
|
struct
|
|
{
|
|
const hsa_queue_t* queue;
|
|
uint64_t value;
|
|
} hsa_queue_add_write_index_scacquire;
|
|
struct
|
|
{
|
|
const hsa_queue_t* queue;
|
|
uint64_t value;
|
|
} hsa_queue_add_write_index_relaxed;
|
|
struct
|
|
{
|
|
const hsa_queue_t* queue;
|
|
uint64_t value;
|
|
} hsa_queue_add_write_index_screlease;
|
|
struct
|
|
{
|
|
const hsa_queue_t* queue;
|
|
uint64_t value;
|
|
} hsa_queue_store_read_index_relaxed;
|
|
struct
|
|
{
|
|
const hsa_queue_t* queue;
|
|
uint64_t value;
|
|
} hsa_queue_store_read_index_screlease;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
hsa_status_t (*callback)(hsa_region_t region, void* data);
|
|
void* data;
|
|
} hsa_agent_iterate_regions;
|
|
struct
|
|
{
|
|
hsa_region_t region;
|
|
hsa_region_info_t attribute;
|
|
void* value;
|
|
} hsa_region_get_info;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
hsa_profile_t profile;
|
|
uint16_t* mask;
|
|
} hsa_agent_get_exception_policies;
|
|
struct
|
|
{
|
|
uint16_t extension;
|
|
hsa_agent_t agent;
|
|
uint16_t version_major;
|
|
uint16_t version_minor;
|
|
bool* result;
|
|
} hsa_agent_extension_supported;
|
|
struct
|
|
{
|
|
void* ptr;
|
|
size_t size;
|
|
} hsa_memory_register;
|
|
struct
|
|
{
|
|
void* ptr;
|
|
size_t size;
|
|
} hsa_memory_deregister;
|
|
struct
|
|
{
|
|
hsa_region_t region;
|
|
size_t size;
|
|
void** ptr;
|
|
} hsa_memory_allocate;
|
|
struct
|
|
{
|
|
void* ptr;
|
|
} hsa_memory_free;
|
|
struct
|
|
{
|
|
void* dst;
|
|
const void* src;
|
|
size_t size;
|
|
} hsa_memory_copy;
|
|
struct
|
|
{
|
|
void* ptr;
|
|
hsa_agent_t agent;
|
|
hsa_access_permission_t access;
|
|
} hsa_memory_assign_agent;
|
|
struct
|
|
{
|
|
hsa_signal_value_t initial_value;
|
|
uint32_t num_consumers;
|
|
const hsa_agent_t* consumers;
|
|
hsa_signal_t* signal;
|
|
} hsa_signal_create;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
} hsa_signal_destroy;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
} hsa_signal_load_relaxed;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
} hsa_signal_load_scacquire;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_store_relaxed;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_store_screlease;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_condition_t condition;
|
|
hsa_signal_value_t compare_value;
|
|
uint64_t timeout_hint;
|
|
hsa_wait_state_t wait_state_hint;
|
|
} hsa_signal_wait_relaxed;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_condition_t condition;
|
|
hsa_signal_value_t compare_value;
|
|
uint64_t timeout_hint;
|
|
hsa_wait_state_t wait_state_hint;
|
|
} hsa_signal_wait_scacquire;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_and_relaxed;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_and_scacquire;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_and_screlease;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_and_scacq_screl;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_or_relaxed;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_or_scacquire;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_or_screlease;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_or_scacq_screl;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_xor_relaxed;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_xor_scacquire;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_xor_screlease;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_xor_scacq_screl;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_exchange_relaxed;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_exchange_scacquire;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_exchange_screlease;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_exchange_scacq_screl;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_add_relaxed;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_add_scacquire;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_add_screlease;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_add_scacq_screl;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_subtract_relaxed;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_subtract_scacquire;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_subtract_screlease;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_subtract_scacq_screl;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t expected;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_cas_relaxed;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t expected;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_cas_scacquire;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t expected;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_cas_screlease;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t expected;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_cas_scacq_screl;
|
|
struct
|
|
{
|
|
const char* name;
|
|
hsa_isa_t* isa;
|
|
} hsa_isa_from_name;
|
|
struct
|
|
{
|
|
hsa_isa_t isa;
|
|
hsa_isa_info_t attribute;
|
|
uint32_t index;
|
|
void* value;
|
|
} hsa_isa_get_info;
|
|
struct
|
|
{
|
|
hsa_isa_t code_object_isa;
|
|
hsa_isa_t agent_isa;
|
|
bool* result;
|
|
} hsa_isa_compatible;
|
|
struct
|
|
{
|
|
hsa_code_object_t code_object;
|
|
hsa_status_t (*alloc_callback)(size_t size, hsa_callback_data_t data, void** address);
|
|
hsa_callback_data_t callback_data;
|
|
const char* options;
|
|
void** serialized_code_object;
|
|
size_t* serialized_code_object_size;
|
|
} hsa_code_object_serialize;
|
|
struct
|
|
{
|
|
void* serialized_code_object;
|
|
size_t serialized_code_object_size;
|
|
const char* options;
|
|
hsa_code_object_t* code_object;
|
|
} hsa_code_object_deserialize;
|
|
struct
|
|
{
|
|
hsa_code_object_t code_object;
|
|
} hsa_code_object_destroy;
|
|
struct
|
|
{
|
|
hsa_code_object_t code_object;
|
|
hsa_code_object_info_t attribute;
|
|
void* value;
|
|
} hsa_code_object_get_info;
|
|
struct
|
|
{
|
|
hsa_code_object_t code_object;
|
|
const char* symbol_name;
|
|
hsa_code_symbol_t* symbol;
|
|
} hsa_code_object_get_symbol;
|
|
struct
|
|
{
|
|
hsa_code_symbol_t code_symbol;
|
|
hsa_code_symbol_info_t attribute;
|
|
void* value;
|
|
} hsa_code_symbol_get_info;
|
|
struct
|
|
{
|
|
hsa_code_object_t code_object;
|
|
hsa_status_t (*callback)(hsa_code_object_t code_object,
|
|
hsa_code_symbol_t symbol,
|
|
void* data);
|
|
void* data;
|
|
} hsa_code_object_iterate_symbols;
|
|
struct
|
|
{
|
|
hsa_profile_t profile;
|
|
hsa_executable_state_t executable_state;
|
|
const char* options;
|
|
hsa_executable_t* executable;
|
|
} hsa_executable_create;
|
|
struct
|
|
{
|
|
hsa_executable_t executable;
|
|
} hsa_executable_destroy;
|
|
struct
|
|
{
|
|
hsa_executable_t executable;
|
|
hsa_agent_t agent;
|
|
hsa_code_object_t code_object;
|
|
const char* options;
|
|
} hsa_executable_load_code_object;
|
|
struct
|
|
{
|
|
hsa_executable_t executable;
|
|
const char* options;
|
|
} hsa_executable_freeze;
|
|
struct
|
|
{
|
|
hsa_executable_t executable;
|
|
hsa_executable_info_t attribute;
|
|
void* value;
|
|
} hsa_executable_get_info;
|
|
struct
|
|
{
|
|
hsa_executable_t executable;
|
|
const char* variable_name;
|
|
void* address;
|
|
} hsa_executable_global_variable_define;
|
|
struct
|
|
{
|
|
hsa_executable_t executable;
|
|
hsa_agent_t agent;
|
|
const char* variable_name;
|
|
void* address;
|
|
} hsa_executable_agent_global_variable_define;
|
|
struct
|
|
{
|
|
hsa_executable_t executable;
|
|
hsa_agent_t agent;
|
|
const char* variable_name;
|
|
void* address;
|
|
} hsa_executable_readonly_variable_define;
|
|
struct
|
|
{
|
|
hsa_executable_t executable;
|
|
uint32_t* result;
|
|
} hsa_executable_validate;
|
|
struct
|
|
{
|
|
hsa_executable_t executable;
|
|
const char* module_name;
|
|
const char* symbol_name;
|
|
hsa_agent_t agent;
|
|
int32_t call_convention;
|
|
hsa_executable_symbol_t* symbol;
|
|
} hsa_executable_get_symbol;
|
|
struct
|
|
{
|
|
hsa_executable_symbol_t executable_symbol;
|
|
hsa_executable_symbol_info_t attribute;
|
|
void* value;
|
|
} hsa_executable_symbol_get_info;
|
|
struct
|
|
{
|
|
hsa_executable_t executable;
|
|
hsa_status_t (*callback)(hsa_executable_t exec, hsa_executable_symbol_t symbol, void* data);
|
|
void* data;
|
|
} hsa_executable_iterate_symbols;
|
|
struct
|
|
{
|
|
hsa_status_t status;
|
|
const char** status_string;
|
|
} hsa_status_string;
|
|
struct
|
|
{
|
|
uint16_t extension;
|
|
const char** name;
|
|
} hsa_extension_get_name;
|
|
struct
|
|
{
|
|
uint16_t extension;
|
|
uint16_t version_major;
|
|
uint16_t* version_minor;
|
|
bool* result;
|
|
} hsa_system_major_extension_supported;
|
|
struct
|
|
{
|
|
uint16_t extension;
|
|
uint16_t version_major;
|
|
size_t table_length;
|
|
void* table;
|
|
} hsa_system_get_major_extension_table;
|
|
struct
|
|
{
|
|
uint16_t extension;
|
|
hsa_agent_t agent;
|
|
uint16_t version_major;
|
|
uint16_t* version_minor;
|
|
bool* result;
|
|
} hsa_agent_major_extension_supported;
|
|
struct
|
|
{
|
|
hsa_cache_t cache;
|
|
hsa_cache_info_t attribute;
|
|
void* value;
|
|
} hsa_cache_get_info;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
hsa_status_t (*callback)(hsa_cache_t cache, void* data);
|
|
void* data;
|
|
} hsa_agent_iterate_caches;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_silent_store_relaxed;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_value_t value;
|
|
} hsa_signal_silent_store_screlease;
|
|
struct
|
|
{
|
|
uint32_t num_signals;
|
|
const hsa_signal_t* signals;
|
|
uint32_t num_consumers;
|
|
const hsa_agent_t* consumers;
|
|
hsa_signal_group_t* signal_group;
|
|
} hsa_signal_group_create;
|
|
struct
|
|
{
|
|
hsa_signal_group_t signal_group;
|
|
} hsa_signal_group_destroy;
|
|
struct
|
|
{
|
|
hsa_signal_group_t signal_group;
|
|
const hsa_signal_condition_t* conditions;
|
|
const hsa_signal_value_t* compare_values;
|
|
hsa_wait_state_t wait_state_hint;
|
|
hsa_signal_t* signal;
|
|
hsa_signal_value_t* value;
|
|
} hsa_signal_group_wait_any_scacquire;
|
|
struct
|
|
{
|
|
hsa_signal_group_t signal_group;
|
|
const hsa_signal_condition_t* conditions;
|
|
const hsa_signal_value_t* compare_values;
|
|
hsa_wait_state_t wait_state_hint;
|
|
hsa_signal_t* signal;
|
|
hsa_signal_value_t* value;
|
|
} hsa_signal_group_wait_any_relaxed;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
hsa_status_t (*callback)(hsa_isa_t isa, void* data);
|
|
void* data;
|
|
} hsa_agent_iterate_isas;
|
|
struct
|
|
{
|
|
hsa_isa_t isa;
|
|
hsa_isa_info_t attribute;
|
|
void* value;
|
|
} hsa_isa_get_info_alt;
|
|
struct
|
|
{
|
|
hsa_isa_t isa;
|
|
hsa_profile_t profile;
|
|
uint16_t* mask;
|
|
} hsa_isa_get_exception_policies;
|
|
struct
|
|
{
|
|
hsa_isa_t isa;
|
|
hsa_fp_type_t fp_type;
|
|
hsa_flush_mode_t flush_mode;
|
|
hsa_round_method_t* round_method;
|
|
} hsa_isa_get_round_method;
|
|
struct
|
|
{
|
|
hsa_wavefront_t wavefront;
|
|
hsa_wavefront_info_t attribute;
|
|
void* value;
|
|
} hsa_wavefront_get_info;
|
|
struct
|
|
{
|
|
hsa_isa_t isa;
|
|
hsa_status_t (*callback)(hsa_wavefront_t wavefront, void* data);
|
|
void* data;
|
|
} hsa_isa_iterate_wavefronts;
|
|
struct
|
|
{
|
|
hsa_code_object_t code_object;
|
|
const char* module_name;
|
|
const char* symbol_name;
|
|
hsa_code_symbol_t* symbol;
|
|
} hsa_code_object_get_symbol_from_name;
|
|
struct
|
|
{
|
|
hsa_file_t file;
|
|
hsa_code_object_reader_t* code_object_reader;
|
|
} hsa_code_object_reader_create_from_file;
|
|
struct
|
|
{
|
|
const void* code_object;
|
|
size_t size;
|
|
hsa_code_object_reader_t* code_object_reader;
|
|
} hsa_code_object_reader_create_from_memory;
|
|
struct
|
|
{
|
|
hsa_code_object_reader_t code_object_reader;
|
|
} hsa_code_object_reader_destroy;
|
|
struct
|
|
{
|
|
hsa_profile_t profile;
|
|
hsa_default_float_rounding_mode_t default_float_rounding_mode;
|
|
const char* options;
|
|
hsa_executable_t* executable;
|
|
} hsa_executable_create_alt;
|
|
struct
|
|
{
|
|
hsa_executable_t executable;
|
|
hsa_code_object_reader_t code_object_reader;
|
|
const char* options;
|
|
hsa_loaded_code_object_t* loaded_code_object;
|
|
} hsa_executable_load_program_code_object;
|
|
struct
|
|
{
|
|
hsa_executable_t executable;
|
|
hsa_agent_t agent;
|
|
hsa_code_object_reader_t code_object_reader;
|
|
const char* options;
|
|
hsa_loaded_code_object_t* loaded_code_object;
|
|
} hsa_executable_load_agent_code_object;
|
|
struct
|
|
{
|
|
hsa_executable_t executable;
|
|
const char* options;
|
|
uint32_t* result;
|
|
} hsa_executable_validate_alt;
|
|
struct
|
|
{
|
|
hsa_executable_t executable;
|
|
const char* symbol_name;
|
|
const hsa_agent_t* agent;
|
|
hsa_executable_symbol_t* symbol;
|
|
} hsa_executable_get_symbol_by_name;
|
|
struct
|
|
{
|
|
hsa_executable_t executable;
|
|
hsa_agent_t agent;
|
|
hsa_status_t (*callback)(hsa_executable_t exec,
|
|
hsa_agent_t agent,
|
|
hsa_executable_symbol_t symbol,
|
|
void* data);
|
|
void* data;
|
|
} hsa_executable_iterate_agent_symbols;
|
|
struct
|
|
{
|
|
hsa_executable_t executable;
|
|
hsa_status_t (*callback)(hsa_executable_t exec, hsa_executable_symbol_t symbol, void* data);
|
|
void* data;
|
|
} hsa_executable_iterate_program_symbols;
|
|
|
|
// block: AmdExt API
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
hsa_amd_coherency_type_t* type;
|
|
} hsa_amd_coherency_get_type;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
hsa_amd_coherency_type_t type;
|
|
} hsa_amd_coherency_set_type;
|
|
struct
|
|
{
|
|
hsa_queue_t* queue;
|
|
int enable;
|
|
} hsa_amd_profiling_set_profiler_enabled;
|
|
struct
|
|
{
|
|
bool enable;
|
|
} hsa_amd_profiling_async_copy_enable;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
hsa_signal_t signal;
|
|
hsa_amd_profiling_dispatch_time_t* time;
|
|
} hsa_amd_profiling_get_dispatch_time;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_amd_profiling_async_copy_time_t* time;
|
|
} hsa_amd_profiling_get_async_copy_time;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
uint64_t agent_tick;
|
|
uint64_t* system_tick;
|
|
} hsa_amd_profiling_convert_tick_to_system_domain;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_signal_condition_t cond;
|
|
hsa_signal_value_t value;
|
|
hsa_amd_signal_handler handler;
|
|
void* arg;
|
|
} hsa_amd_signal_async_handler;
|
|
struct
|
|
{
|
|
void (*callback)(void* arg);
|
|
void* arg;
|
|
} hsa_amd_async_function;
|
|
struct
|
|
{
|
|
uint32_t signal_count;
|
|
hsa_signal_t* signals;
|
|
hsa_signal_condition_t* conds;
|
|
hsa_signal_value_t* values;
|
|
uint64_t timeout_hint;
|
|
hsa_wait_state_t wait_hint;
|
|
hsa_signal_value_t* satisfying_value;
|
|
} hsa_amd_signal_wait_any;
|
|
struct
|
|
{
|
|
const hsa_queue_t* queue;
|
|
uint32_t num_cu_mask_count;
|
|
const uint32_t* cu_mask;
|
|
} hsa_amd_queue_cu_set_mask;
|
|
struct
|
|
{
|
|
hsa_amd_memory_pool_t memory_pool;
|
|
hsa_amd_memory_pool_info_t attribute;
|
|
void* value;
|
|
} hsa_amd_memory_pool_get_info;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
hsa_status_t (*callback)(hsa_amd_memory_pool_t memory_pool, void* data);
|
|
void* data;
|
|
} hsa_amd_agent_iterate_memory_pools;
|
|
struct
|
|
{
|
|
hsa_amd_memory_pool_t memory_pool;
|
|
size_t size;
|
|
uint32_t flags;
|
|
void** ptr;
|
|
} hsa_amd_memory_pool_allocate;
|
|
struct
|
|
{
|
|
void* ptr;
|
|
} hsa_amd_memory_pool_free;
|
|
struct
|
|
{
|
|
void* dst;
|
|
hsa_agent_t dst_agent;
|
|
const void* src;
|
|
hsa_agent_t src_agent;
|
|
size_t size;
|
|
uint32_t num_dep_signals;
|
|
const hsa_signal_t* dep_signals;
|
|
hsa_signal_t completion_signal;
|
|
} hsa_amd_memory_async_copy;
|
|
struct
|
|
{
|
|
void* dst;
|
|
hsa_agent_t dst_agent;
|
|
const void* src;
|
|
hsa_agent_t src_agent;
|
|
size_t size;
|
|
uint32_t num_dep_signals;
|
|
const hsa_signal_t* dep_signals;
|
|
hsa_signal_t completion_signal;
|
|
hsa_amd_sdma_engine_id_t engine_id;
|
|
bool force_copy_on_sdma;
|
|
} hsa_amd_memory_async_copy_on_engine;
|
|
struct
|
|
{
|
|
hsa_agent_t dst_agent;
|
|
hsa_agent_t src_agent;
|
|
uint32_t* engine_ids_mask;
|
|
} hsa_amd_memory_copy_engine_status;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
hsa_amd_memory_pool_t memory_pool;
|
|
hsa_amd_agent_memory_pool_info_t attribute;
|
|
void* value;
|
|
} hsa_amd_agent_memory_pool_get_info;
|
|
struct
|
|
{
|
|
uint32_t num_agents;
|
|
const hsa_agent_t* agents;
|
|
const uint32_t* flags;
|
|
const void* ptr;
|
|
} hsa_amd_agents_allow_access;
|
|
struct
|
|
{
|
|
hsa_amd_memory_pool_t src_memory_pool;
|
|
hsa_amd_memory_pool_t dst_memory_pool;
|
|
bool* result;
|
|
} hsa_amd_memory_pool_can_migrate;
|
|
struct
|
|
{
|
|
const void* ptr;
|
|
hsa_amd_memory_pool_t memory_pool;
|
|
uint32_t flags;
|
|
} hsa_amd_memory_migrate;
|
|
struct
|
|
{
|
|
void* host_ptr;
|
|
size_t size;
|
|
hsa_agent_t* agents;
|
|
int num_agent;
|
|
void** agent_ptr;
|
|
} hsa_amd_memory_lock;
|
|
struct
|
|
{
|
|
void* host_ptr;
|
|
} hsa_amd_memory_unlock;
|
|
struct
|
|
{
|
|
void* ptr;
|
|
uint32_t value;
|
|
size_t count;
|
|
} hsa_amd_memory_fill;
|
|
struct
|
|
{
|
|
uint32_t num_agents;
|
|
hsa_agent_t* agents;
|
|
int interop_handle;
|
|
uint32_t flags;
|
|
size_t* size;
|
|
void** ptr;
|
|
size_t* metadata_size;
|
|
const void** metadata;
|
|
} hsa_amd_interop_map_buffer;
|
|
struct
|
|
{
|
|
void* ptr;
|
|
} hsa_amd_interop_unmap_buffer;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
const hsa_ext_image_descriptor_t* image_descriptor;
|
|
const hsa_amd_image_descriptor_t* image_layout;
|
|
const void* image_data;
|
|
hsa_access_permission_t access_permission;
|
|
hsa_ext_image_t* image;
|
|
} hsa_amd_image_create;
|
|
struct
|
|
{
|
|
const void* ptr;
|
|
hsa_amd_pointer_info_t* info;
|
|
void* (*alloc)(size_t);
|
|
uint32_t* num_agents_accessible;
|
|
hsa_agent_t** accessible;
|
|
} hsa_amd_pointer_info;
|
|
struct
|
|
{
|
|
const void* ptr;
|
|
void* userdata;
|
|
} hsa_amd_pointer_info_set_userdata;
|
|
struct
|
|
{
|
|
void* ptr;
|
|
size_t len;
|
|
hsa_amd_ipc_memory_t* handle;
|
|
} hsa_amd_ipc_memory_create;
|
|
struct
|
|
{
|
|
const hsa_amd_ipc_memory_t* handle;
|
|
size_t len;
|
|
uint32_t num_agents;
|
|
const hsa_agent_t* mapping_agents;
|
|
void** mapped_ptr;
|
|
} hsa_amd_ipc_memory_attach;
|
|
struct
|
|
{
|
|
void* mapped_ptr;
|
|
} hsa_amd_ipc_memory_detach;
|
|
struct
|
|
{
|
|
hsa_signal_value_t initial_value;
|
|
uint32_t num_consumers;
|
|
const hsa_agent_t* consumers;
|
|
uint64_t attributes;
|
|
hsa_signal_t* signal;
|
|
} hsa_amd_signal_create;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
hsa_amd_ipc_signal_t* handle;
|
|
} hsa_amd_ipc_signal_create;
|
|
struct
|
|
{
|
|
const hsa_amd_ipc_signal_t* handle;
|
|
hsa_signal_t* signal;
|
|
} hsa_amd_ipc_signal_attach;
|
|
struct
|
|
{
|
|
hsa_amd_system_event_callback_t callback;
|
|
void* data;
|
|
} hsa_amd_register_system_event_handler;
|
|
struct
|
|
{
|
|
hsa_agent_t agent_handle;
|
|
uint32_t size;
|
|
hsa_queue_type32_t type;
|
|
void (*callback)(hsa_status_t status, hsa_queue_t* source, void* data);
|
|
void* data;
|
|
uint32_t private_segment_size;
|
|
uint32_t group_segment_size;
|
|
hsa_queue_t** queue;
|
|
} hsa_amd_queue_intercept_create;
|
|
struct
|
|
{
|
|
hsa_queue_t* queue;
|
|
hsa_amd_queue_intercept_handler callback;
|
|
void* user_data;
|
|
} hsa_amd_queue_intercept_register;
|
|
struct
|
|
{
|
|
hsa_queue_t* queue;
|
|
hsa_amd_queue_priority_t priority;
|
|
} hsa_amd_queue_set_priority;
|
|
struct
|
|
{
|
|
const hsa_pitched_ptr_t* dst;
|
|
const hsa_dim3_t* dst_offset;
|
|
const hsa_pitched_ptr_t* src;
|
|
const hsa_dim3_t* src_offset;
|
|
const hsa_dim3_t* range;
|
|
hsa_dim3_t range__val;
|
|
hsa_agent_t copy_agent;
|
|
hsa_amd_copy_direction_t dir;
|
|
uint32_t num_dep_signals;
|
|
const hsa_signal_t* dep_signals;
|
|
hsa_signal_t completion_signal;
|
|
} hsa_amd_memory_async_copy_rect;
|
|
struct
|
|
{
|
|
hsa_amd_runtime_queue_notifier callback;
|
|
void* user_data;
|
|
} hsa_amd_runtime_queue_create_register;
|
|
struct
|
|
{
|
|
void* host_ptr;
|
|
size_t size;
|
|
hsa_agent_t* agents;
|
|
int num_agent;
|
|
hsa_amd_memory_pool_t pool;
|
|
uint32_t flags;
|
|
void** agent_ptr;
|
|
} hsa_amd_memory_lock_to_pool;
|
|
struct
|
|
{
|
|
void* ptr;
|
|
hsa_amd_deallocation_callback_t callback;
|
|
void* user_data;
|
|
} hsa_amd_register_deallocation_callback;
|
|
struct
|
|
{
|
|
void* ptr;
|
|
hsa_amd_deallocation_callback_t callback;
|
|
} hsa_amd_deregister_deallocation_callback;
|
|
struct
|
|
{
|
|
hsa_signal_t signal;
|
|
volatile hsa_signal_value_t** value_ptr;
|
|
} hsa_amd_signal_value_pointer;
|
|
struct
|
|
{
|
|
void* ptr;
|
|
size_t size;
|
|
hsa_amd_svm_attribute_pair_t* attribute_list;
|
|
size_t attribute_count;
|
|
} hsa_amd_svm_attributes_set;
|
|
struct
|
|
{
|
|
void* ptr;
|
|
size_t size;
|
|
hsa_amd_svm_attribute_pair_t* attribute_list;
|
|
size_t attribute_count;
|
|
} hsa_amd_svm_attributes_get;
|
|
struct
|
|
{
|
|
void* ptr;
|
|
size_t size;
|
|
hsa_agent_t agent;
|
|
uint32_t num_dep_signals;
|
|
const hsa_signal_t* dep_signals;
|
|
hsa_signal_t completion_signal;
|
|
} hsa_amd_svm_prefetch_async;
|
|
struct
|
|
{
|
|
hsa_agent_t preferred_agent;
|
|
} hsa_amd_spm_acquire;
|
|
struct
|
|
{
|
|
hsa_agent_t preferred_agent;
|
|
} hsa_amd_spm_release;
|
|
struct
|
|
{
|
|
hsa_agent_t preferred_agent;
|
|
size_t size_in_bytes;
|
|
uint32_t* timeout;
|
|
uint32_t* size_copied;
|
|
void* dest;
|
|
bool* is_data_loss;
|
|
} hsa_amd_spm_set_dest_buffer;
|
|
struct
|
|
{
|
|
const hsa_queue_t* queue;
|
|
uint32_t num_cu_mask_count;
|
|
uint32_t* cu_mask;
|
|
} hsa_amd_queue_cu_get_mask;
|
|
struct
|
|
{
|
|
const void* ptr;
|
|
size_t size;
|
|
int* dmabuf;
|
|
uint64_t* offset;
|
|
} hsa_amd_portable_export_dmabuf;
|
|
struct
|
|
{
|
|
int dmabuf;
|
|
} hsa_amd_portable_close_dmabuf;
|
|
|
|
// block: ImageExt API
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
hsa_ext_image_geometry_t geometry;
|
|
const hsa_ext_image_format_t* image_format;
|
|
uint32_t* capability_mask;
|
|
} hsa_ext_image_get_capability;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
const hsa_ext_image_descriptor_t* image_descriptor;
|
|
hsa_access_permission_t access_permission;
|
|
hsa_ext_image_data_info_t* image_data_info;
|
|
} hsa_ext_image_data_get_info;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
const hsa_ext_image_descriptor_t* image_descriptor;
|
|
const void* image_data;
|
|
hsa_access_permission_t access_permission;
|
|
hsa_ext_image_t* image;
|
|
} hsa_ext_image_create;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
const void* src_memory;
|
|
size_t src_row_pitch;
|
|
size_t src_slice_pitch;
|
|
hsa_ext_image_t dst_image;
|
|
const hsa_ext_image_region_t* image_region;
|
|
} hsa_ext_image_import;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
hsa_ext_image_t src_image;
|
|
void* dst_memory;
|
|
size_t dst_row_pitch;
|
|
size_t dst_slice_pitch;
|
|
const hsa_ext_image_region_t* image_region;
|
|
} hsa_ext_image_export;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
hsa_ext_image_t src_image;
|
|
const hsa_dim3_t* src_offset;
|
|
hsa_ext_image_t dst_image;
|
|
const hsa_dim3_t* dst_offset;
|
|
const hsa_dim3_t* range;
|
|
} hsa_ext_image_copy;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
hsa_ext_image_t image;
|
|
const void* data;
|
|
const hsa_ext_image_region_t* image_region;
|
|
} hsa_ext_image_clear;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
hsa_ext_image_t image;
|
|
} hsa_ext_image_destroy;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
const hsa_ext_sampler_descriptor_t* sampler_descriptor;
|
|
hsa_ext_sampler_t* sampler;
|
|
} hsa_ext_sampler_create;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
hsa_ext_sampler_t sampler;
|
|
} hsa_ext_sampler_destroy;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
hsa_ext_image_geometry_t geometry;
|
|
const hsa_ext_image_format_t* image_format;
|
|
hsa_ext_image_data_layout_t image_data_layout;
|
|
uint32_t* capability_mask;
|
|
} hsa_ext_image_get_capability_with_layout;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
const hsa_ext_image_descriptor_t* image_descriptor;
|
|
hsa_access_permission_t access_permission;
|
|
hsa_ext_image_data_layout_t image_data_layout;
|
|
size_t image_data_row_pitch;
|
|
size_t image_data_slice_pitch;
|
|
hsa_ext_image_data_info_t* image_data_info;
|
|
} hsa_ext_image_data_get_info_with_layout;
|
|
struct
|
|
{
|
|
hsa_agent_t agent;
|
|
const hsa_ext_image_descriptor_t* image_descriptor;
|
|
const void* image_data;
|
|
hsa_access_permission_t access_permission;
|
|
hsa_ext_image_data_layout_t image_data_layout;
|
|
size_t image_data_row_pitch;
|
|
size_t image_data_slice_pitch;
|
|
hsa_ext_image_t* image;
|
|
} hsa_ext_image_create_with_layout;
|
|
#if HSA_AMD_EXT_API_TABLE_MAJOR_VERSION >= 0x02
|
|
struct
|
|
{
|
|
void** ptr;
|
|
size_t size;
|
|
uint64_t address;
|
|
uint64_t flags;
|
|
} hsa_amd_vmem_address_reserve;
|
|
struct
|
|
{
|
|
void* ptr;
|
|
size_t size;
|
|
} hsa_amd_vmem_address_free;
|
|
struct
|
|
{
|
|
hsa_amd_memory_pool_t pool;
|
|
size_t size;
|
|
hsa_amd_memory_type_t type;
|
|
uint64_t flags;
|
|
hsa_amd_vmem_alloc_handle_t* memory_handle;
|
|
} hsa_amd_vmem_handle_create;
|
|
struct
|
|
{
|
|
hsa_amd_vmem_alloc_handle_t memory_handle;
|
|
} hsa_amd_vmem_handle_release;
|
|
struct
|
|
{
|
|
void* va;
|
|
size_t size;
|
|
size_t in_offset;
|
|
hsa_amd_vmem_alloc_handle_t memory_handle;
|
|
uint64_t flags;
|
|
} hsa_amd_vmem_map;
|
|
struct
|
|
{
|
|
void* va;
|
|
size_t size;
|
|
} hsa_amd_vmem_unmap;
|
|
struct
|
|
{
|
|
void* va;
|
|
size_t size;
|
|
const hsa_amd_memory_access_desc_t* desc;
|
|
size_t desc_cnt;
|
|
} hsa_amd_vmem_set_access;
|
|
struct
|
|
{
|
|
void* va;
|
|
hsa_access_permission_t* perms;
|
|
hsa_agent_t agent_handle;
|
|
} hsa_amd_vmem_get_access;
|
|
struct
|
|
{
|
|
int* dmabuf_fd;
|
|
hsa_amd_vmem_alloc_handle_t handle;
|
|
uint64_t flags;
|
|
} hsa_amd_vmem_export_shareable_handle;
|
|
struct
|
|
{
|
|
int dmabuf_fd;
|
|
hsa_amd_vmem_alloc_handle_t* handle;
|
|
} hsa_amd_vmem_import_shareable_handle;
|
|
struct
|
|
{
|
|
hsa_amd_vmem_alloc_handle_t* handle;
|
|
void* addr;
|
|
} hsa_amd_vmem_retain_alloc_handle;
|
|
struct
|
|
{
|
|
hsa_amd_vmem_alloc_handle_t alloc_handle;
|
|
hsa_amd_memory_pool_t* pool;
|
|
hsa_amd_memory_type_t* type;
|
|
} hsa_amd_vmem_get_alloc_properties_from_handle;
|
|
#endif
|
|
} rocprofiler_hsa_api_args_t;
|