From 6d7a39ae7e608de213effd0260d293dbb9497193 Mon Sep 17 00:00:00 2001 From: Laurent Morichetti Date: Mon, 23 May 2022 20:58:53 -0700 Subject: [PATCH] Fix ROCTX function attributes Change-Id: I32ebbacba7df9059574c31831b13fb2a923fcc97 --- inc/roctx.h | 14 +++++++------- src/roctx/roctx.cpp | 18 +++++++++--------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/inc/roctx.h b/inc/roctx.h index 79e5bf9cae..cec83dc897 100644 --- a/inc/roctx.h +++ b/inc/roctx.h @@ -131,7 +131,7 @@ extern "C" { * * \return Returns the major version number. */ -uint32_t ROCTX_API roctx_version_major() ROCTX_VERSION_4_1; +ROCTX_API uint32_t roctx_version_major() ROCTX_VERSION_4_1; /** * Query the minor version of the installed library. @@ -141,7 +141,7 @@ uint32_t ROCTX_API roctx_version_major() ROCTX_VERSION_4_1; * * \return Returns the minor version number. */ -uint32_t ROCTX_API roctx_version_minor() ROCTX_VERSION_4_1; +ROCTX_API uint32_t roctx_version_minor() ROCTX_VERSION_4_1; /** @} */ @@ -157,7 +157,7 @@ uint32_t ROCTX_API roctx_version_minor() ROCTX_VERSION_4_1; * * \param[in] message The message associated with the event. */ -void ROCTX_API roctxMarkA(const char* message) ROCTX_VERSION_4_1; +ROCTX_API void roctxMarkA(const char* message) ROCTX_VERSION_4_1; #define roctxMark(message) roctxMarkA(message) /** @} */ @@ -179,7 +179,7 @@ void ROCTX_API roctxMarkA(const char* message) ROCTX_VERSION_4_1; * \return Returns the level this nested range is started at. Nested range * levels are 0 based. */ -int ROCTX_API roctxRangePushA(const char* message) ROCTX_VERSION_4_1; +ROCTX_API int roctxRangePushA(const char* message) ROCTX_VERSION_4_1; #define roctxRangePush(message) roctxRangePushA(message) /** @@ -192,7 +192,7 @@ int ROCTX_API roctxRangePushA(const char* message) ROCTX_VERSION_4_1; * \return Returns the level the stopped nested range was started at, or a * negative value if there was no nested range active. */ -int ROCTX_API roctxRangePop() ROCTX_VERSION_4_1; +ROCTX_API int roctxRangePop() ROCTX_VERSION_4_1; /** * ROCTX range ID. @@ -211,13 +211,13 @@ typedef uint64_t roctx_range_id_t; * * \return Returns the ID of the new range. */ -roctx_range_id_t ROCTX_API roctxRangeStartA(const char* message) ROCTX_VERSION_4_1; +ROCTX_API roctx_range_id_t roctxRangeStartA(const char* message) ROCTX_VERSION_4_1; #define roctxRangeStart(message) roctxRangeStartA(message) /** * Stop a process range. */ -void ROCTX_API roctxRangeStop(roctx_range_id_t id) ROCTX_VERSION_4_1; +ROCTX_API void roctxRangeStop(roctx_range_id_t id) ROCTX_VERSION_4_1; /** @} */ diff --git a/src/roctx/roctx.cpp b/src/roctx/roctx.cpp index 70c7c237c7..9da9195862 100644 --- a/src/roctx/roctx.cpp +++ b/src/roctx/roctx.cpp @@ -31,16 +31,16 @@ thread_local int nested_range_level(0); } // namespace -uint32_t ROCTX_API roctx_version_major() { return ROCTX_VERSION_MAJOR; } -uint32_t ROCTX_API roctx_version_minor() { return ROCTX_VERSION_MINOR; } +ROCTX_API uint32_t roctx_version_major() { return ROCTX_VERSION_MAJOR; } +ROCTX_API uint32_t roctx_version_minor() { return ROCTX_VERSION_MINOR; } -void ROCTX_API roctxMarkA(const char* message) { +ROCTX_API void roctxMarkA(const char* message) { roctx_api_data_t api_data{}; api_data.args.roctxMarkA.message = message; callbacks.Invoke(ROCTX_API_ID_roctxMarkA, &api_data); } -int ROCTX_API roctxRangePushA(const char* message) { +ROCTX_API int roctxRangePushA(const char* message) { roctx_api_data_t api_data{}; api_data.args.roctxRangePushA.message = message; callbacks.Invoke(ROCTX_API_ID_roctxRangePushA, &api_data); @@ -48,7 +48,7 @@ int ROCTX_API roctxRangePushA(const char* message) { return nested_range_level++; } -int ROCTX_API roctxRangePop() { +ROCTX_API int roctxRangePop() { roctx_api_data_t api_data{}; callbacks.Invoke(ROCTX_API_ID_roctxRangePop, &api_data); @@ -56,7 +56,7 @@ int ROCTX_API roctxRangePop() { return --nested_range_level; } -roctx_range_id_t ROCTX_API roctxRangeStartA(const char* message) { +ROCTX_API roctx_range_id_t roctxRangeStartA(const char* message) { static std::atomic start_stop_range_id(1); auto id = start_stop_range_id++; @@ -68,19 +68,19 @@ roctx_range_id_t ROCTX_API roctxRangeStartA(const char* message) { return id; } -void ROCTX_API roctxRangeStop(roctx_range_id_t rangeId) { +ROCTX_API void roctxRangeStop(roctx_range_id_t rangeId) { roctx_api_data_t api_data{}; api_data.args.roctxRangeStop.id = rangeId; callbacks.Invoke(ROCTX_API_ID_roctxRangeStop, &api_data); } -extern "C" bool ROCTX_EXPORT RegisterApiCallback(uint32_t op, void* callback, void* arg) { +extern "C" ROCTX_EXPORT bool RegisterApiCallback(uint32_t op, void* callback, void* arg) { if (op >= ROCTX_API_ID_NUMBER) return false; callbacks.Set(op, reinterpret_cast(callback), arg); return true; } -extern "C" bool ROCTX_EXPORT RemoveApiCallback(uint32_t op) { +extern "C" ROCTX_EXPORT bool RemoveApiCallback(uint32_t op) { if (op >= ROCTX_API_ID_NUMBER) return false; callbacks.Set(op, nullptr, nullptr); return true;