-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rbt2.4 calc TSC once, fixes BW calcs #60
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,9 +109,15 @@ elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86") | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") | ||
endif() | ||
|
||
find_package(hsa-runtime64 REQUIRED | ||
PATHS /opt/rocm | ||
if (DEFINED ROCM_HOME) | ||
find_package(hsa-runtime64 REQUIRED | ||
PATHS ${ROCM_HOME} | ||
) | ||
else() | ||
find_package(hsa-runtime64 REQUIRED | ||
PATHS /opt/rocm | ||
) | ||
endif() | ||
message( " hsa-runtime64 found @ ${hsa-runtime64_DIR} " ) | ||
|
||
# Set project requirements | ||
|
@@ -161,6 +167,10 @@ if( DEFINED ENV{ROCM_RPATH}) | |
set ( CMAKE_EXE_LINKER_FLAGS "-Wl,--enable-new-dtags -Wl,--rpath,$ENV{ROCM_RPATH}" ) | ||
endif() | ||
|
||
if (DEFINED ROCM_HOME) | ||
set ( CMAKE_EXE_LINKER_FLAGS "-Wl,--enable-new-dtags -Wl,--rpath,${ROCM_HOME}/hsa/lib:${ROCM_HOME}/lib64:${ROCM_HOME}/lib" ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Path for hsa library is already known to the cmake from find_package(hsa_runtime64). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
No, @paulfreddy. The changes allow the user to specify the parameter value to use instead o relying on cmake crap to find stuff, and code in deduction paths in cmakefiles. This changes take a keep it simple approach, and leaves existing users/jenkins/devops who rely on cmake gymnastics for their environment to continue with them. |
||
endif() | ||
|
||
# Add install directives for rocm_bandwidth_test | ||
install(TARGETS ${TEST_NAME} RUNTIME DESTINATION bin) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,13 +81,14 @@ class PerfTimer { | |
public: | ||
|
||
PerfTimer(); | ||
PerfTimer(double); | ||
~PerfTimer(); | ||
|
||
private: | ||
|
||
// AMD timing method | ||
uint64_t CoarseTimestampUs(); | ||
uint64_t MeasureTSCFreqHz(); | ||
// uint64_t CoarseTimestampUs(); | ||
// uint64_t MeasureTSCFreqHz(); | ||
Comment on lines
+90
to
+91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May be remove this commented code? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch! How about the cleanup of comments be taken care of in the next change in the interest of time? Let's get this integrated so users can relying on RBT to generate correct results can get the fix and build and use RBT for performance tuning. |
||
|
||
// General Linux timing method | ||
|
||
|
@@ -97,6 +98,8 @@ class PerfTimer { | |
int StartTimer(int index); | ||
int StopTimer(int index); | ||
void ResetTimer(int index); | ||
static uint64_t MeasureTSCFreqHz(); | ||
static uint64_t CoarseTimestampUs(); | ||
|
||
public: | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to add extra variables. To find hsa-runtime64-config.cmake from a path other than /opt/rocm, CMAKE_PREFIX_PATH can be used.
CMAKE_PREFIX_PATH="custom path for hsa"
This will function same was as ROCM_HOME="custom path for hsa or rocm"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the optimization of you get out of "No need to add extra variables" or what is the downside? The CMAKE_PREFIX_PATH and other cmake defined paths have side-effects and using those variables to get what user wants cmake to do is incorrect application of those variables, which leads to more headaches.
Read https://cmake.org/cmake/help/v3.0/variable/CMAKE_INSTALL_PREFIX.html
CMAKE_PREFIX_PATH is to specify destination dir. That is not the purpose of the change here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What you are referring here is CMAKE_INSTALL_PREFIX.
CMAKE_PREFIX_PATH gives a different purpose.
https://cmake.org/cmake/help/v3.0/variable/CMAKE_PREFIX_PATH.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, my mistake. But please see my comments on line 170+ as to avoid "deduction logic" and providing user-defined parameter to use with runpath, etc.
My changes allow DevOps and other cmake experts to continue to use CMAKE_PREFIX_PATH to do a find as well as simple users who want to specify the lcoation to use, and use that in runpath.