From cb7776ef07b705ab866fa2ba044bb5db314dab08 Mon Sep 17 00:00:00 2001 From: Ioannis Assiouras Date: Tue, 18 Jul 2023 22:57:40 +0100 Subject: [PATCH] SWDEV-412496 - treat USE_PROF_API to always be true Change-Id: I77cfac409215a33d11228a0f2da9ffba63c3d73a --- hipamd/src/CMakeLists.txt | 15 ++++++++------- hipamd/src/hip_prof_api.h | 16 ---------------- rocclr/platform/activity.cpp | 4 ---- rocclr/platform/activity.hpp | 10 ---------- 4 files changed, 8 insertions(+), 37 deletions(-) diff --git a/hipamd/src/CMakeLists.txt b/hipamd/src/CMakeLists.txt index ad597e7703..e4d51a8d04 100644 --- a/hipamd/src/CMakeLists.txt +++ b/hipamd/src/CMakeLists.txt @@ -224,9 +224,9 @@ if(USE_PROF_API) if(NOT ${CPP_HEADER_PARSER} EQUAL 0) message(FATAL_ERROR "\ -The \"CppHeaderParser\" Python3 package is not installed. \ -Please install it using the following command: \"pip3 install CppHeaderParser\".\ -") + The \"CppHeaderParser\" Python3 package is not installed. \ + Please install it using the following command: \"pip3 install CppHeaderParser\".\ + ") endif() add_custom_command(OUTPUT ${PROF_API_STR} @@ -242,16 +242,15 @@ Please install it using the following command: \"pip3 install CppHeaderParser\". find_path(PROF_API_HEADER_DIR prof_protocol.h HINTS - ${PROF_API_HEADER_PATH} + ${PROF_API_HEADER_PATH} PATHS - ${ROCM_PATH}/roctracer + ${ROCM_PATH}/roctracer PATH_SUFFIXES - include/ext) + include/ext) if(NOT PROF_API_HEADER_DIR) message(WARNING "Profiling API header not found. Disabling roctracer integration. Use -DPROF_API_HEADER_PATH=") else() - target_compile_definitions(amdhip64 PUBLIC USE_PROF_API=1) target_include_directories(amdhip64 PUBLIC ${PROF_API_HEADER_DIR}) message(STATUS "Profiling API: ${PROF_API_HEADER_DIR}") endif() @@ -259,6 +258,8 @@ Please install it using the following command: \"pip3 install CppHeaderParser\". add_dependencies(amdhip64 gen-prof-api-str-header) endif() +target_compile_definitions(amdhip64 PUBLIC USE_PROF_API=1) + add_custom_command(TARGET amdhip64 POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/.hipInfo ${PROJECT_BINARY_DIR}/lib/.hipInfo) add_custom_command(TARGET amdhip64 POST_BUILD COMMAND diff --git a/hipamd/src/hip_prof_api.h b/hipamd/src/hip_prof_api.h index c552ee5ebc..f85d1a8756 100644 --- a/hipamd/src/hip_prof_api.h +++ b/hipamd/src/hip_prof_api.h @@ -27,7 +27,6 @@ #include #include -#if USE_PROF_API #include "hip/amd_detail/hip_prof_str.h" #include "platform/prof_protocol.h" @@ -80,19 +79,4 @@ template <> class api_callbacks_spawner_t { public: template api_callbacks_spawner_t(Functor) {} }; - -#else - -#define HIP_CB_SPAWNER_OBJECT(x) \ - do { \ - } while (false) - -class api_callbacks_table_t { - public: - bool set_activity(hip_api_id_t, activity_sync_callback_t, void*) { return false; } - bool set_callback(hip_api_id_t, activity_rtapi_callback_t, void*) { return false; } -}; - -#endif - #endif // HIP_SRC_HIP_PROF_API_H diff --git a/rocclr/platform/activity.cpp b/rocclr/platform/activity.cpp index 4868f77e87..c29c997660 100644 --- a/rocclr/platform/activity.cpp +++ b/rocclr/platform/activity.cpp @@ -29,8 +29,6 @@ namespace activity_prof { decltype(report_activity) report_activity{nullptr}; -#if USE_PROF_API - #if defined(__linux__) __thread activity_correlation_id_t correlation_id __attribute__((tls_model("initial-exec"))) = 0; #elif defined(_WIN32) @@ -106,8 +104,6 @@ void ReportActivity(const amd::Command& command) { function(ACTIVITY_DOMAIN_HIP_OPS, operation_id, &record); } -#endif // USE_PROF_API - } // namespace activity_prof #define CASE_STRING(X, C) \ diff --git a/rocclr/platform/activity.hpp b/rocclr/platform/activity.hpp index e6256807ac..46c8852aaa 100644 --- a/rocclr/platform/activity.hpp +++ b/rocclr/platform/activity.hpp @@ -32,10 +32,6 @@ namespace amd { class Command; } // namespace amd -#define USE_PROF_API 1 - -#if USE_PROF_API - enum OpId { OP_ID_DISPATCH = 0, OP_ID_COPY = 1, OP_ID_BARRIER = 2, OP_ID_NUMBER = 3 }; #include "prof_protocol.h" @@ -81,10 +77,4 @@ void ReportActivity(const amd::Command& command); } // namespace activity_prof -#else // !USE_PROF_API - -static inline void ReportActivity(const amd::Command& command) {} - -#endif // !USE_PROF_API - const char* getOclCommandKindString(cl_command_type kind);