1edd4891b2
* Initial implementation of roctx library
* Update include/roctx/CMakeLists.txt
- fix installation
* Update cmake/rocprofiler_config_packaging.cmake
- add rocprofiler-sdk-roctx installer
* Update include/roctx/CMakeLists.txt
- include api_trace.h in installation
* Update include/roctx/api_trace.h
- add ROCTX_API_TABLE_VERSION_MAJOR define
- add ROCTX_API_TABLE_VERSION_STEP define
* Update lib/roctx/roctx.cpp
- static asserts for table size and struct member offsets
* Update external/CMakeLists.txt
- move BUILD_SHARED_LIBS to top
- disable libunwind for glog
* Update lib/roctx/CMakeLists.txt
- Update {BUILD,INSTALL}_RPATH
* Relocate include/roctx to include/rocprofiler-sdk/roctx
* Relocate lib/roctx to lib/rocprofiler-sdk-roctx
- change the name of the library from libroctx to librocprofiler-sdk-roctx
* Move lib/plugins to lib/rocprofiler-sdk-tool/plugins
- also change install export group
* Update lib/rocprofiler-sdk/CMakeLists.txt
- change rocprofiler-shared-library EXPORT group (rocprofiler-sdk-library-targets -> rocprofiler-sdk-targets)
* Update cmake/rocprofiler_utilities.cmake
- change install EXPORT group
- rocprofiler-sdk-library-targets -> rocprofiler-sdk-targets
* Update CMakeLists.txt
- set PACKAGE_NAME at high level
- include(rocprofiler_config_install_roctx)
* Update cmake/rocprofiler_config_install* and cmake/Templates/*.cmake.in
- added rocprofiler_config_install_roctx.cmake for installing roctx as a package
- reorganization of existing cmake/Templates/*-config.cmake.in files
- created new config.cmake.in and build-config.cmake.in for rocprofiler-sdk-roctx
* Relocate include/rocprofiler-sdk/roctx to include/rocprofiler-sdk-roctx
* Update rocprofiler_config_install_roctx.cmake
* Update lib/rocprofiler-sdk-roctx/roctx.cpp
- update include paths
* Update lib/rocprofiler-sdk-roctx/CMakeLists.txt
- change target name to have rocprofiler-sdk- prefix
- interface target_include_directories
- define export symbol
* source formatting (clang-format v11) (#361)
Co-authored-by: jrmadsen <jrmadsen@users.noreply.github.com>
* Update include/rocprofiler-sdk/fwd.h
- fix doxygen markup for ROCPROFILER_STATUS_ERROR_CONTEXT_ERROR
* Update modulefile and setup-env.sh
* Update cmake/Templates/rocprofiler-sdk/config.cmake.in
- fix inclusion of rocprofiler-sdk-targets.cmake
* Update include/rocprofiler-sdk-roctx
- add types.h for typedefs
- add doxygen comments for roctx.h
- add roctxGetThreadId function
- roctxProfilerStart and roctxProfilerStop accept thread ID param
* Update lib/rocprofiler-sdk-roctx/roctx.cpp
- hsa_agent_t* -> hsa_agent_s*
* Update lib/rocprofiler-sdk-roctx/roctx.cpp
- support for roctxGetThreadId
- update signatures of roctxProfilerPause and roctxProfilerResume
* Update lib/rocprofiler-sdk-roctx/roctx.cpp
- Initialize logging with ROCTX_LOG_LEVEL
* Update include/rocprofiler-sdk-roctx/roctx.h
- remove ROCTX_NONNULL for ihipStream_t parameter in roctxNameHipStream because default stream is a nullptr
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
117 řádky
3.6 KiB
C
117 řádky
3.6 KiB
C
// MIT License
|
|
//
|
|
// Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
|
|
//
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
// of this software and associated documentation files (the "Software"), to deal
|
|
// in the Software without restriction, including without limitation the rights
|
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
// copies of the Software, and to permit persons to whom the Software is
|
|
// furnished to do so, subject to the following conditions:
|
|
//
|
|
// The above copyright notice and this permission notice shall be included in all
|
|
// copies or substantial portions of the Software.
|
|
//
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
// SOFTWARE.
|
|
|
|
#pragma once
|
|
|
|
/**
|
|
* @defgroup SYMBOL_VERSIONING_GROUP Symbol Versions
|
|
*
|
|
* @brief The names used for the shared library versioned symbols.
|
|
*
|
|
* Every function is annotated with one of the version macros defined in this
|
|
* section. Each macro specifies a corresponding symbol version string. After
|
|
* dynamically loading the shared library with @p dlopen, the address of each
|
|
* function can be obtained using @p dlsym with the name of the function and
|
|
* its corresponding symbol version string. An error will be reported by @p
|
|
* dlvsym if the installed library does not support the version for the
|
|
* function specified in this version of the interface.
|
|
*
|
|
* @{
|
|
*/
|
|
|
|
/**
|
|
* @brief The function was introduced in version 10.0 of the interface and has the
|
|
* symbol version string of ``"ROCTX_10.0"``.
|
|
*/
|
|
#define ROCTX_VERSION_10_0
|
|
|
|
/** @} */
|
|
|
|
#if !defined(ROCTX_ATTRIBUTE)
|
|
# if defined(_MSC_VER)
|
|
# define ROCTX_ATTRIBUTE(...) __declspec(__VA_ARGS__)
|
|
# else
|
|
# define ROCTX_ATTRIBUTE(...) __attribute__((__VA_ARGS__))
|
|
# endif
|
|
#endif
|
|
|
|
#if !defined(ROCTX_PUBLIC_API)
|
|
# if defined(_MSC_VER)
|
|
# define ROCTX_PUBLIC_API ROCTX_ATTRIBUTE(dllexport)
|
|
# else
|
|
# define ROCTX_PUBLIC_API ROCTX_ATTRIBUTE(visibility("default"))
|
|
# endif
|
|
#endif
|
|
|
|
#if !defined(ROCTX_HIDDEN_API)
|
|
# if defined(_MSC_VER)
|
|
# define ROCTX_HIDDEN_API
|
|
# else
|
|
# define ROCTX_HIDDEN_API ROCTX_ATTRIBUTE(visibility("hidden"))
|
|
# endif
|
|
#endif
|
|
|
|
#if !defined(ROCTX_EXPORT_DECORATOR)
|
|
# define ROCTX_EXPORT_DECORATOR ROCTX_PUBLIC_API
|
|
#endif
|
|
|
|
#if !defined(ROCTX_IMPORT_DECORATOR)
|
|
# if defined(_MSC_VER)
|
|
# define ROCTX_IMPORT_DECORATOR ROCTX_ATTRIBUTE(dllimport)
|
|
# else
|
|
# define ROCTX_IMPORT_DECORATOR
|
|
# endif
|
|
#endif
|
|
|
|
#define ROCTX_EXPORT ROCTX_EXPORT_DECORATOR
|
|
#define ROCTX_IMPORT ROCTX_IMPORT_DECORATOR
|
|
|
|
#if !defined(ROCTX_API)
|
|
# if defined(rocprofiler_EXPORTS)
|
|
# define ROCTX_API ROCTX_EXPORT
|
|
# else
|
|
# define ROCTX_API ROCTX_IMPORT
|
|
# endif
|
|
#endif
|
|
|
|
#if defined(__has_attribute)
|
|
# if __has_attribute(nonnull)
|
|
# define ROCTX_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
|
|
# else
|
|
# define ROCTX_NONNULL(...)
|
|
# endif
|
|
#else
|
|
# if defined(__GNUC__)
|
|
# define ROCTX_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
|
|
# else
|
|
# define ROCTX_NONNULL(...)
|
|
# endif
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
# define ROCTX_EXTERN_C_INIT extern "C" {
|
|
# define ROCTX_EXTERN_C_FINI }
|
|
#else
|
|
# define ROCTX_EXTERN_C_INIT
|
|
# define ROCTX_EXTERN_C_FINI
|
|
#endif
|