Add 'projects/rocprofiler-sdk/' from commit 'bf0fad1d5406fbc51403ba1aa9621a9d4a9bce2b'
git-subtree-dir: projects/rocprofiler-sdk git-subtree-mainline:50a90550e9git-subtree-split:bf0fad1d54
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#
|
||||
#
|
||||
# Installation of public headers
|
||||
#
|
||||
#
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/version.h.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/version.h @ONLY)
|
||||
|
||||
set(ROCPD_HEADER_FILES
|
||||
# core headers
|
||||
rocpd.h
|
||||
# secondary headers
|
||||
defines.h types.h ${CMAKE_CURRENT_BINARY_DIR}/version.h)
|
||||
|
||||
install(
|
||||
FILES ${ROCPD_HEADER_FILES}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk-rocpd
|
||||
COMPONENT rocpd)
|
||||
@@ -0,0 +1,130 @@
|
||||
// MIT License
|
||||
//
|
||||
// Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* @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 0.0 of the interface and has the
|
||||
* symbol version string of ``"ROCPROFILER_SDK_ROCPD_0.0"``.
|
||||
*/
|
||||
#define ROCPROFILER_SDK_ROCPD_VERSION_0_0
|
||||
|
||||
/** @} */
|
||||
|
||||
#if !defined(ROCPD_ATTRIBUTE)
|
||||
# if defined(_MSC_VER)
|
||||
# define ROCPD_ATTRIBUTE(...) __declspec(__VA_ARGS__)
|
||||
# else
|
||||
# define ROCPD_ATTRIBUTE(...) __attribute__((__VA_ARGS__))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(ROCPD_PUBLIC_API)
|
||||
# if defined(_MSC_VER)
|
||||
# define ROCPD_PUBLIC_API ROCPD_ATTRIBUTE(dllexport)
|
||||
# else
|
||||
# define ROCPD_PUBLIC_API ROCPD_ATTRIBUTE(visibility("default"))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(ROCPD_HIDDEN_API)
|
||||
# if defined(_MSC_VER)
|
||||
# define ROCPD_HIDDEN_API
|
||||
# else
|
||||
# define ROCPD_HIDDEN_API ROCPD_ATTRIBUTE(visibility("hidden"))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(ROCPD_EXPORT_DECORATOR)
|
||||
# define ROCPD_EXPORT_DECORATOR ROCPD_PUBLIC_API
|
||||
#endif
|
||||
|
||||
#if !defined(ROCPD_IMPORT_DECORATOR)
|
||||
# if defined(_MSC_VER)
|
||||
# define ROCPD_IMPORT_DECORATOR ROCPD_ATTRIBUTE(dllimport)
|
||||
# else
|
||||
# define ROCPD_IMPORT_DECORATOR
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define ROCPD_EXPORT ROCPD_EXPORT_DECORATOR
|
||||
#define ROCPD_IMPORT ROCPD_IMPORT_DECORATOR
|
||||
|
||||
#if !defined(ROCPD_API)
|
||||
# if defined(rocpd_EXPORTS)
|
||||
# define ROCPD_API ROCPD_EXPORT
|
||||
# else
|
||||
# define ROCPD_API ROCPD_IMPORT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__has_attribute)
|
||||
# if __has_attribute(nonnull)
|
||||
# define ROCPD_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
|
||||
# else
|
||||
# define ROCPD_NONNULL(...)
|
||||
# endif
|
||||
#else
|
||||
# if defined(__GNUC__)
|
||||
# define ROCPD_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
|
||||
# else
|
||||
# define ROCPD_NONNULL(...)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define ROCPD_EXTERN_C_INIT extern "C" {
|
||||
# define ROCPD_EXTERN_C_FINI }
|
||||
#else
|
||||
# define ROCPD_EXTERN_C_INIT
|
||||
# define ROCPD_EXTERN_C_FINI
|
||||
#endif
|
||||
|
||||
#if !defined(ROCPD_EXPERIMENTAL_WARNINGS)
|
||||
# define ROCPD_EXPERIMENTAL_WARNINGS 0
|
||||
#endif
|
||||
|
||||
#define ROCPD_EXPERIMENTAL_MESSAGE \
|
||||
ROCPD_DEPRECATED_MESSAGE("Note: this feature has been marked as experimental. Define " \
|
||||
"ROCPD_EXPERIMENTAL_WARNINGS=0 to silence this message.")
|
||||
|
||||
#if defined(ROCPD_EXPERIMENTAL_WARNINGS) && ROCPD_EXPERIMENTAL_WARNINGS > 0
|
||||
# define ROCPD_EXPERIMENTAL ROCPD_EXPERIMENTAL_MESSAGE
|
||||
#else
|
||||
# define ROCPD_EXPERIMENTAL
|
||||
#endif
|
||||
@@ -0,0 +1,118 @@
|
||||
// MIT License
|
||||
//
|
||||
// Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* @file rocpd.h
|
||||
* @brief rocPD API interface for AMD profiling data analysis
|
||||
*
|
||||
* @mainpage rocPD API Specification
|
||||
*
|
||||
*/
|
||||
|
||||
#include "rocprofiler-sdk-rocpd/defines.h"
|
||||
#include "rocprofiler-sdk-rocpd/types.h"
|
||||
|
||||
/**
|
||||
* @defgroup VERSIONING_GROUP Library Versioning
|
||||
* @brief Version information about the interface and the associated installed library.
|
||||
*
|
||||
* The semantic version of the interface following semver.org rules. A context
|
||||
* that uses this interface is only compatible with the installed library if
|
||||
* the major version numbers match and the interface minor version number is
|
||||
* less than or equal to the installed library minor version number.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include "rocprofiler-sdk-rocpd/version.h"
|
||||
|
||||
ROCPD_EXTERN_C_INIT
|
||||
|
||||
/**
|
||||
* @fn rocpd_status_t rocpd_get_version(uint32_t* major, uint32_t* minor, uint32_t*
|
||||
* patch)
|
||||
* @brief Query the version of the installed library.
|
||||
*
|
||||
* Returns the version of the rocprofiler-sdk library loaded at runtime. This can be used to check
|
||||
* if the runtime version is equal to or compatible with the version of rocprofiler-sdk used during
|
||||
* compilation time. This function can be invoked before tool initialization.
|
||||
*
|
||||
* @param [out] major The major version number is stored if non-NULL.
|
||||
* @param [out] minor The minor version number is stored if non-NULL.
|
||||
* @param [out] patch The patch version number is stored if non-NULL.
|
||||
* @return ::rocpd_status_t
|
||||
* @retval ::ROCPD_STATUS_SUCCESS Always returned
|
||||
*/
|
||||
rocpd_status_t
|
||||
rocpd_get_version(uint32_t* major, uint32_t* minor, uint32_t* patch) ROCPD_API;
|
||||
|
||||
/**
|
||||
* @brief Simplified alternative to ::rocpd_get_version
|
||||
*
|
||||
* Returns the version of the rocprofiler-sdk library loaded at runtime. This can be used to check
|
||||
* if the runtime version is equal to or compatible with the version of rocprofiler-sdk used during
|
||||
* compilation time. This function can be invoked before tool initialization.
|
||||
*
|
||||
* @param [out] info Pointer to version triplet struct which will be populated by the function call.
|
||||
* @return ::rocpd_status_t
|
||||
* @retval ::ROCPD_STATUS_SUCCESS Always returned
|
||||
*/
|
||||
rocpd_status_t
|
||||
rocpd_get_version_triplet(rocpd_version_triplet_t* info) ROCPD_API ROCPD_NONNULL(1);
|
||||
|
||||
ROCPD_EXTERN_C_FINI
|
||||
|
||||
/** @} */
|
||||
|
||||
#include "rocprofiler-sdk-rocpd/sql.h"
|
||||
|
||||
ROCPD_EXTERN_C_INIT
|
||||
|
||||
/**
|
||||
* @defgroup MISCELLANEOUS_GROUP Miscellaneous Utility Functions
|
||||
* @brief utility functions for library
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fn const char* rocpd_get_status_name(rocpd_status_t status)
|
||||
* @brief Return the string encoding of ::rocpd_status_t value
|
||||
* @param [in] status error code value
|
||||
* @return Will return a nullptr if invalid/unsupported ::rocpd_status_t value is provided.
|
||||
*/
|
||||
const char*
|
||||
rocpd_get_status_name(rocpd_status_t status) ROCPD_API;
|
||||
|
||||
/**
|
||||
* @fn const char* rocpd_get_status_string(rocpd_status_t status)
|
||||
* @brief Return the message associated with ::rocpd_status_t value
|
||||
* @param [in] status error code value
|
||||
* @return Will return a nullptr if invalid/unsupported ::rocpd_status_t value is provided.
|
||||
*/
|
||||
const char*
|
||||
rocpd_get_status_string(rocpd_status_t status) ROCPD_API;
|
||||
|
||||
/** @} */
|
||||
|
||||
ROCPD_EXTERN_C_FINI
|
||||
@@ -0,0 +1,151 @@
|
||||
// MIT License
|
||||
//
|
||||
// Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk-rocpd/defines.h>
|
||||
#include <rocprofiler-sdk-rocpd/types.h>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
ROCPD_EXTERN_C_INIT
|
||||
|
||||
/**
|
||||
* @defgroup SQL rocPD SQL Utilities
|
||||
* @brief Functions for reading rocpd SQL schema
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief (experimental) Supported SQL engines. Initial support is for SQLite3, other engines such
|
||||
* as MySQL may be added
|
||||
*/
|
||||
typedef enum ROCPD_EXPERIMENTAL rocpd_sql_engine_t
|
||||
{
|
||||
ROCPD_SQL_ENGINE_NONE = 0,
|
||||
ROCPD_SQL_ENGINE_SQLITE3, ///< Ensure compatibility with SQLite3
|
||||
ROCPD_SQL_ENGINE_LAST,
|
||||
} rocpd_sql_engine_t;
|
||||
|
||||
/**
|
||||
* @brief (experimental) Supported SQL schema kinds
|
||||
*/
|
||||
typedef enum ROCPD_EXPERIMENTAL rocpd_sql_schema_kind_t
|
||||
{
|
||||
ROCPD_SQL_SCHEMA_NONE = 0,
|
||||
ROCPD_SQL_SCHEMA_ROCPD_TABLES,
|
||||
ROCPD_SQL_SCHEMA_ROCPD_INDEXES,
|
||||
ROCPD_SQL_SCHEMA_ROCPD_VIEWS,
|
||||
ROCPD_SQL_SCHEMA_ROCPD_DATA_VIEWS,
|
||||
ROCPD_SQL_SCHEMA_ROCPD_SUMMARY_VIEWS,
|
||||
ROCPD_SQL_SCHEMA_ROCPD_MARKER_VIEWS,
|
||||
ROCPD_SQL_SCHEMA_LAST,
|
||||
} rocpd_sql_schema_kind_t;
|
||||
|
||||
/**
|
||||
* @brief (experimental) Supported SQL options
|
||||
*/
|
||||
typedef enum ROCPD_EXPERIMENTAL rocpd_sql_options_t
|
||||
{
|
||||
ROCPD_SQL_OPTIONS_NONE = 0,
|
||||
ROCPD_SQL_OPTIONS_PERSIST_STRINGS = 0x01, ///< do not delete strings
|
||||
ROCPD_SQL_OPTIONS_SQLITE3_PRAGMA_FOREIGN_KEYS = 0x02, ///< enable SQLite3 foreign keys
|
||||
ROCPD_SQL_OPTIONS_LAST = 0xFFFFFFFF,
|
||||
} rocpd_sql_options_t;
|
||||
|
||||
/**
|
||||
* @brief (experimental) Schema jinja variable substitution values. In general, the struct member
|
||||
* variable replaces jinja variables of the same name, e.g. the struct member variable `uuid`
|
||||
* replaces `{{uuid}}` in the schema definition.
|
||||
*
|
||||
* When the schema variable `{{uuid}}` is a non-null and non-empty string, it
|
||||
* will be prefixed with a leading underscore (`_`) and all hyphens will be replaced with
|
||||
* underscores. This is because this variable is used in SQL table names. The leading
|
||||
* underscore improves the readability of the table name and the replacement of hyphens with
|
||||
* underscores is reduces problems.
|
||||
*/
|
||||
typedef struct ROCPD_EXPERIMENTAL rocpd_sql_schema_jinja_variables_t
|
||||
{
|
||||
uint64_t size; ///< Size of this struct (minus reserved padding)
|
||||
const char* uuid; ///< Substitution for `{{uuid}}` (non-empty adds leading underscore)
|
||||
const char* guid; ///< Substitution for `{{guid}}`
|
||||
} rocpd_sql_schema_jinja_variables_t;
|
||||
|
||||
/**
|
||||
* @brief (experimental) Callback providing the schema content after variable substitution.
|
||||
*
|
||||
* @param [in] engine Schema conforms to this SQL database engine
|
||||
* @param [in] kind Schema category
|
||||
* @param [in] options Schema options included in content
|
||||
* @param [in] variables Jinja variables which were substituted
|
||||
* @param [in] schema_path Filesystem path to base schema file
|
||||
* @param [in] schema_content SQL schema content is pass to database
|
||||
* @param [in] user_data User provided data
|
||||
*/
|
||||
ROCPD_EXPERIMENTAL typedef void (*rocpd_sql_load_schema_cb_t)(
|
||||
rocpd_sql_engine_t engine,
|
||||
rocpd_sql_schema_kind_t kind,
|
||||
rocpd_sql_options_t options,
|
||||
const rocpd_sql_schema_jinja_variables_t* variables,
|
||||
const char* schema_path,
|
||||
const char* schema_content,
|
||||
void* user_data);
|
||||
|
||||
/**
|
||||
* @brief (experimental) Invoke the callback which provides the schema kind definition for the given
|
||||
* SQL engine + the addition of the requested options + jinja variable substitution.
|
||||
*
|
||||
* @param [in] engine SQL schema contents should be compatible with this SQL database engine
|
||||
* @param [in] kind SQL schema kind (tables, indexes, views, etc.)
|
||||
* @param [in] options Options for the callback and schema
|
||||
* @param [in] variables Defines variables for jinja substitution. If nullptr, no jinja variables
|
||||
* will be substituted. For each member variable that is a nullptr, jinja for that member variable
|
||||
* will not be substituted. To replace jinja variables with empty strings, assign all member
|
||||
* variables to empty string.
|
||||
* @param [in] callback Callback function which provides the schema contents
|
||||
* @param [in] schema_path_hints Suggests for where to find the schema templates
|
||||
* @param [in] num_schema_path_hints Number of schema path hints
|
||||
* @param [in] user_data Pointer to pass back into callback
|
||||
* @return ::rocpd_status_t
|
||||
* @retval ROCPD_STATUS_SUCCESS if all parameter specifications were applied and callback
|
||||
* successfully invoked
|
||||
* @retval ROCPD_STATUS_ERROR_INVALID_ARGUMENT Invalid SQL engine
|
||||
* @retval ROCPD_STATUS_ERROR_NOT_AVAILABLE Schema file could not be found
|
||||
* @retval ROCPD_STATUS_ERROR_PERMISSION_DENIED Schema file could not be found
|
||||
* @retval ROCPD_STATUS_ERROR_KIND_NOT_FOUND Invalid SQL schema kind
|
||||
* @retval ROCPD_STATUS_ERROR There was some issue with parameters
|
||||
* @retval ROCPD_STATUS_ERROR_INVALID_ARGUMENT ::rocpd_sql_schema_jinja_variables_t size parameter
|
||||
* not set
|
||||
*/
|
||||
ROCPD_EXPERIMENTAL rocpd_status_t
|
||||
rocpd_sql_load_schema(rocpd_sql_engine_t engine,
|
||||
rocpd_sql_schema_kind_t kind,
|
||||
rocpd_sql_options_t options,
|
||||
const rocpd_sql_schema_jinja_variables_t* variables,
|
||||
rocpd_sql_load_schema_cb_t callback,
|
||||
const char** schema_path_hints,
|
||||
uint64_t num_schema_path_hints,
|
||||
void* user_data) ROCPD_API ROCPD_NONNULL(5);
|
||||
|
||||
/** @} */
|
||||
|
||||
ROCPD_EXTERN_C_FINI
|
||||
@@ -0,0 +1,81 @@
|
||||
// MIT License
|
||||
//
|
||||
// Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rocprofiler-sdk-rocpd/defines.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/** @defgroup DATA_TYPE rocPD Data types
|
||||
*
|
||||
* Data types defined or aliased by rocPD
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
//
|
||||
// ENUMERATIONS
|
||||
//
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
/**
|
||||
* @defgroup BASIC_DATA_TYPES Basic data types
|
||||
* @brief Basic data types and typedefs
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Status codes.
|
||||
*/
|
||||
typedef enum rocpd_status_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPD_STATUS_SUCCESS = 0, ///< No error occurred
|
||||
ROCPD_STATUS_ERROR, ///< Generalized error
|
||||
ROCPD_STATUS_ERROR_INVALID_ARGUMENT, ///< Argument is invalid
|
||||
ROCPD_STATUS_ERROR_SQL_ERROR, ///< General SQL error
|
||||
ROCPD_STATUS_ERROR_SQL_INVALID_ENGINE, ///< SQL engine is invalid
|
||||
ROCPD_STATUS_ERROR_SQL_INVALID_SCHEMA_KIND, ///< SQL schema kind not found
|
||||
ROCPD_STATUS_ERROR_SQL_SCHEMA_NOT_FOUND, ///< SQL schema does not exist
|
||||
ROCPD_STATUS_ERROR_SQL_SCHEMA_PERMISSION_DENIED, ///< SQL schema not accessible
|
||||
ROCPD_STATUS_LAST,
|
||||
} rocpd_status_t;
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
//
|
||||
// STRUCTS
|
||||
//
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
/**
|
||||
* @brief Versioning info.
|
||||
*/
|
||||
typedef struct rocpd_version_triplet_t
|
||||
{
|
||||
uint32_t major;
|
||||
uint32_t minor;
|
||||
uint32_t patch;
|
||||
} rocpd_version_triplet_t;
|
||||
|
||||
/** @} */
|
||||
@@ -0,0 +1,115 @@
|
||||
// MIT License
|
||||
//
|
||||
// Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* @def ROCPD_IS_ROCPROFILER_SDK
|
||||
* @brief Preprocessor define indicating the rocpd header is a rocprofiler-sdk project
|
||||
* @addtogroup VERSIONING_GROUP
|
||||
*
|
||||
* @def ROCPD_VERSION_MAJOR
|
||||
* @brief The major version of the interface as a macro so it can be used
|
||||
* by the preprocessor.
|
||||
* @addtogroup VERSIONING_GROUP
|
||||
*
|
||||
* @def ROCPD_VERSION_MINOR
|
||||
* @brief The minor version of the interface as a macro so it can be used
|
||||
* by the preprocessor.
|
||||
* @addtogroup VERSIONING_GROUP
|
||||
*
|
||||
* @def ROCPD_VERSION_PATCH
|
||||
* @brief The patch version of the interface as a macro so it can be used
|
||||
* by the preprocessor.
|
||||
* @addtogroup VERSIONING_GROUP
|
||||
*
|
||||
* @def ROCPD_VERSION
|
||||
* @brief Numerically increasing version number encoding major, minor, and patch via
|
||||
computing `((10000 * <MAJOR>) + (100 * <MINOR>) + <PATCH>)`.
|
||||
* @addtogroup VERSIONING_GROUP
|
||||
*
|
||||
* @def ROCPD_SOVERSION
|
||||
* @brief Shared object versioning value whose value is at least `(10000 * <MAJOR>)`.
|
||||
* @addtogroup VERSIONING_GROUP
|
||||
*
|
||||
* @def ROCPD_VERSION_STRING
|
||||
* @brief Version string in form: `<MAJOR>.<MINOR>.<PATCH>`.
|
||||
* @addtogroup VERSIONING_GROUP
|
||||
*
|
||||
* @def ROCPD_GIT_DESCRIBE
|
||||
* @brief String encoding of `git describe --tags` when rocprofiler was built.
|
||||
* @addtogroup VERSIONING_GROUP
|
||||
*
|
||||
* @def ROCPD_GIT_REVISION
|
||||
* @brief String encoding of `git rev-parse HEAD` when rocprofiler was built.
|
||||
* @addtogroup VERSIONING_GROUP
|
||||
*
|
||||
* @def ROCPD_LIBRARY_ARCH
|
||||
* @brief Architecture triplet of rocprofiler build.
|
||||
* @addtogroup VERSIONING_GROUP
|
||||
*
|
||||
* @def ROCPD_SYSTEM_NAME
|
||||
* @brief Target operating system for rocprofiler build, e.g. Linux.
|
||||
* @addtogroup VERSIONING_GROUP
|
||||
*
|
||||
* @def ROCPD_SYSTEM_PROCESSOR
|
||||
* @brief Target architecture for rocprofiler build.
|
||||
* @addtogroup VERSIONING_GROUP
|
||||
*
|
||||
* @def ROCPD_SYSTEM_VERSION
|
||||
* @brief Version of the operating system which built rocprofiler
|
||||
* @addtogroup VERSIONING_GROUP
|
||||
*
|
||||
* @def ROCPD_COMPILER_ID
|
||||
* @brief C++ compiler identifier which built rocprofiler, e.g., GNU
|
||||
* @addtogroup VERSIONING_GROUP
|
||||
*
|
||||
* @def ROCPD_COMPILER_VERSION
|
||||
* @brief C++ compiler version which built rocprofiler
|
||||
* @addtogroup VERSIONING_GROUP
|
||||
*/
|
||||
|
||||
#define ROCPD_IS_ROCPROFILER_SDK 1
|
||||
|
||||
// clang-format off
|
||||
#define ROCPD_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
|
||||
#define ROCPD_VERSION_MINOR @PROJECT_VERSION_MINOR@
|
||||
#define ROCPD_VERSION_PATCH @PROJECT_VERSION_PATCH@
|
||||
#define ROCPD_SOVERSION (10000 * @PROJECT_VERSION_MAJOR@)
|
||||
#define ROCPD_VERSION_STRING "@FULL_VERSION_STRING@"
|
||||
#define ROCPD_GIT_DESCRIBE "@ROCPROFILER_SDK_GIT_DESCRIBE@"
|
||||
#define ROCPD_GIT_REVISION "@ROCPROFILER_SDK_GIT_REVISION@"
|
||||
|
||||
// system info during compilation
|
||||
#define ROCPD_LIBRARY_ARCH "@CMAKE_LIBRARY_ARCHITECTURE@"
|
||||
#define ROCPD_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@"
|
||||
#define ROCPD_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@"
|
||||
#define ROCPD_SYSTEM_VERSION "@CMAKE_SYSTEM_VERSION@"
|
||||
|
||||
// compiler information
|
||||
#define ROCPD_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@"
|
||||
#define ROCPD_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@"
|
||||
|
||||
// clang-format on
|
||||
|
||||
#define ROCPD_VERSION \
|
||||
((10000 * ROCPD_VERSION_MAJOR) + (100 * ROCPD_VERSION_MINOR) + ROCPD_VERSION_PATCH)
|
||||
Reference in New Issue
Block a user