-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrocprofiler.patch
146 lines (137 loc) · 6.1 KB
/
rocprofiler.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
diff --git a/cmake_modules/rocprofiler_env.cmake b/cmake_modules/rocprofiler_env.cmake
index 7b7c472..0aba3ed 100644
--- a/cmake_modules/rocprofiler_env.cmake
+++ b/cmake_modules/rocprofiler_env.cmake
@@ -36,6 +36,7 @@ if(ROCPROFILER_DEBUG_TRACE)
target_compile_definitions(rocprofiler-build-flags INTERFACE DEBUG_TRACE=1)
endif()
+set(ROCPROFILER_LD_AQLPROFILE false)
# Enable direct loading of AQL-profile HSA extension
if(ROCPROFILER_LD_AQLPROFILE)
target_compile_definitions(rocprofiler-build-flags INTERFACE ROCP_LD_AQLPROFILE=1)
@@ -80,9 +81,3 @@ if("${ROCM_ROOT_DIR}" STREQUAL "")
message(FATAL_ERROR "ROCM_ROOT_DIR is not found.")
endif()
-find_library(
- HSA_AMD_AQLPROFILE_LIBRARY
- NAMES hsa-amd-aqlprofile64
- HINTS ${CMAKE_PREFIX_PATH}
- PATHS ${ROCM_ROOT_DIR}
- PATH_SUFFIXES lib REQUIRED)
diff --git a/src/api/CMakeLists.txt b/src/api/CMakeLists.txt
index 61782f0..16c83bf 100644
--- a/src/api/CMakeLists.txt
+++ b/src/api/CMakeLists.txt
@@ -51,15 +51,6 @@ find_file(
NO_DEFAULT_PATH REQUIRED)
get_filename_component(HSA_RUNTIME_INC_PATH ${HSA_H} DIRECTORY)
-find_library(
- AQLPROFILE_LIB "libhsa-amd-aqlprofile64.so"
- HINTS ${CMAKE_PREFIX_PATH}
- PATHS ${ROCM_PATH}
- PATH_SUFFIXES lib)
-
-if(NOT AQLPROFILE_LIB)
- message(FATAL_ERROR "AQL_PROFILE not installed. Please install hsa-amd-aqlprofile!")
-endif()
# ########################################################################################
# Adding Old Library Files
@@ -247,7 +238,7 @@ target_include_directories(
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include/rocprofiler>
PRIVATE ${LIB_DIR} ${ROOT_DIR} ${PROJECT_SOURCE_DIR}/include/rocprofiler)
target_link_libraries(
- ${ROCPROFILER_TARGET} PRIVATE ${AQLPROFILE_LIB} hsa-runtime64::hsa-runtime64 c stdc++
+ ${ROCPROFILER_TARGET} PRIVATE hsa-runtime64::hsa-runtime64 c stdc++
dl rocprofiler::build-flags rocprofiler::memcheck)
get_target_property(ROCPROFILER_LIBRARY_V1_NAME ${ROCPROFILER_TARGET} NAME)
@@ -325,8 +316,7 @@ target_link_options(
-Wl,--no-undefined)
target_link_libraries(
rocprofiler-v2
- PRIVATE ${AQLPROFILE_LIB}
- hsa-runtime64::hsa-runtime64
+ PRIVATE hsa-runtime64::hsa-runtime64
Threads::Threads
atomic
numa
diff --git a/src/util/hsa_rsrc_factory.cpp b/src/util/hsa_rsrc_factory.cpp
index 2c47186..6b39634 100644
--- a/src/util/hsa_rsrc_factory.cpp
+++ b/src/util/hsa_rsrc_factory.cpp
@@ -155,17 +155,6 @@ HsaRsrcFactory::HsaRsrcFactory(bool initialize_hsa) : initialize_hsa_(initialize
if (kern_arg_pool_ == nullptr)
CHECK_STATUS("Kern-arg memory pool is not found", HSA_STATUS_ERROR);
- // Get AqlProfile API table
- aqlprofile_api_ = {};
-#ifdef ROCP_LD_AQLPROFILE
- status = LoadAqlProfileLib(&aqlprofile_api_);
-#else
- status = hsa_api_.hsa_system_get_major_extension_table(HSA_EXTENSION_AMD_AQLPROFILE,
- hsa_ven_amd_aqlprofile_VERSION_MAJOR,
- sizeof(aqlprofile_api_), &aqlprofile_api_);
-#endif
- CHECK_STATUS("aqlprofile API table load failed", status);
-
// Get Loader API table
loader_api_ = {};
status = hsa_api_.hsa_system_get_major_extension_table(HSA_EXTENSION_AMD_LOADER, 1,
diff --git a/test/util/hsa_rsrc_factory.cpp b/test/util/hsa_rsrc_factory.cpp
index 0a44d18..fab5b75 100644
--- a/test/util/hsa_rsrc_factory.cpp
+++ b/test/util/hsa_rsrc_factory.cpp
@@ -137,17 +137,6 @@ HsaRsrcFactory::HsaRsrcFactory(bool initialize_hsa) : initialize_hsa_(initialize
if (cpu_pool_ == NULL) CHECK_STATUS("CPU memory pool is not found", HSA_STATUS_ERROR);
if (kern_arg_pool_ == NULL) CHECK_STATUS("Kern-arg memory pool is not found", HSA_STATUS_ERROR);
- // Get AqlProfile API table
- aqlprofile_api_ = {0};
-#ifdef ROCP_LD_AQLPROFILE
- status = LoadAqlProfileLib(&aqlprofile_api_);
-#else
- status = hsa_api_.hsa_system_get_major_extension_table(HSA_EXTENSION_AMD_AQLPROFILE,
- hsa_ven_amd_aqlprofile_VERSION_MAJOR,
- sizeof(aqlprofile_api_), &aqlprofile_api_);
-#endif
- CHECK_STATUS("aqlprofile API table load failed", status);
-
// Get Loader API table
loader_api_ = {0};
status = hsa_api_.hsa_system_get_major_extension_table(HSA_EXTENSION_AMD_LOADER, 1,
diff --git a/tests-v2/unittests/core/CMakeLists.txt b/tests-v2/unittests/core/CMakeLists.txt
index 107cb51..0f6d4bf 100644
--- a/tests-v2/unittests/core/CMakeLists.txt
+++ b/tests-v2/unittests/core/CMakeLists.txt
@@ -235,8 +235,7 @@ set_target_properties(runCoreUnitTests PROPERTIES
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests")
target_link_libraries(
runCoreUnitTests
- PRIVATE ${AQLPROFILE_LIB}
- test_hsatool_library
+ PRIVATE test_hsatool_library
hsa-runtime64::hsa-runtime64
Threads::Threads
GTest::gtest GTest::gtest_main
@@ -285,4 +284,4 @@ endif()
# for the *_FilePlugin tests
if(NOT EXISTS "${PROJECT_BINARY_DIR}/test-output")
file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/test-output")
-endif()
\ No newline at end of file
+endif()
diff --git a/tests-v2/unittests/profiler/CMakeLists.txt b/tests-v2/unittests/profiler/CMakeLists.txt
index 53180d5..0c4d4a7 100644
--- a/tests-v2/unittests/profiler/CMakeLists.txt
+++ b/tests-v2/unittests/profiler/CMakeLists.txt
@@ -122,7 +122,7 @@ target_compile_definitions(
PRIVATE PROF_API_IMPL HIP_PROF_HIP_API_STRING=1 __HIP_PLATFORM_AMD__=1)
target_link_libraries(
- runUnitTests PRIVATE rocprofiler-v2 ${AQLPROFILE_LIB} hsa-runtime64::hsa-runtime64
+ runUnitTests PRIVATE rocprofiler-v2 hsa-runtime64::hsa-runtime64
GTest::gtest GTest::gtest_main stdc++fs ${PCIACCESS_LIBRARIES} dw elf c dl)
add_dependencies(tests runUnitTests)
@@ -158,4 +158,4 @@ endif()
# for the *_FilePlugin tests
if(NOT EXISTS "${PROJECT_BINARY_DIR}/test-output")
file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/test-output")
-endif()
\ No newline at end of file
+endif()