Skip to content

Commit

Permalink
Fix format + rename env to ROCPROFCOMPUTE*.
Browse files Browse the repository at this point in the history
  • Loading branch information
xuchen-amd committed Oct 24, 2024
1 parent 9eec64a commit 06e7e70
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
15 changes: 9 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ message(STATUS "Hostname: ${LOCALHOST}")
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" FULL_VERSION_STRING LIMIT_COUNT 1)
string(REGEX REPLACE "(\n|\r)" "" FULL_VERSION_STRING "${FULL_VERSION_STRING}")
set(ROCPROFCOMPUTE_FULL_VERSION "${FULL_VERSION_STRING}")
string(REGEX REPLACE "([0-9]+)\.([0-9]+)\.([0-9]+)(.*)" "\\1.\\2.\\3" ROCPROFCOMPUTE_VERSION
"${FULL_VERSION_STRING}")
string(REGEX REPLACE "([0-9]+)\.([0-9]+)\.([0-9]+)(.*)" "\\1.\\2.\\3"
ROCPROFCOMPUTE_VERSION "${FULL_VERSION_STRING}")

# string(REGEX REPLACE "(${ROCPROFCOMPUTE_VERSION})(.*)" "\\2" ROCPROFCOMPUTE_VERSION_TWEAK
# string(REGEX REPLACE "(${ROCPROFCOMPUTE_VERSION})(.*)" "\\2"
# ROCPROFCOMPUTE_VERSION_TWEAK
# "${FULL_VERSION_STRING}")
# string(REGEX REPLACE "^\\." "" ROCPROFCOMPUTE_VERSION_TWEAK "${ROCPROFCOMPUTE_VERSION_TWEAK}")
# string(REGEX REPLACE "^\\." "" ROCPROFCOMPUTE_VERSION_TWEAK
# "${ROCPROFCOMPUTE_VERSION_TWEAK}")

project(
rocprofiler-compute
Expand Down Expand Up @@ -138,7 +140,7 @@ set(MOD_INSTALL_PATH
CACHE STRING "Install path for modulefile")
message(STATUS "Modulefile install path: ${MOD_INSTALL_PATH}")

set(moduleFileTemplate "omniperf.lua.in")
set(moduleFileTemplate "rocprofcompute.lua.in")

configure_file(
${PROJECT_SOURCE_DIR}/cmake/${moduleFileTemplate}
Expand All @@ -149,7 +151,8 @@ if(LOCALHOST MATCHES "TheraS01|.*\.thera\.amd\.com|thera-hn")
list(APPEND CMAKE_MESSAGE_INDENT " ")
message(STATUS "Using thera-specific modulefile modification")
file(READ ${PROJECT_SOURCE_DIR}/cmake/modfile.thera.mod mod_additions)
file(APPEND ${PROJECT_BINARY_DIR}/${MOD_INSTALL_PATH}/${ROCPROFCOMPUTE_FULL_VERSION}.lua
file(APPEND
${PROJECT_BINARY_DIR}/${MOD_INSTALL_PATH}/${ROCPROFCOMPUTE_FULL_VERSION}.lua
${mod_additions})
list(POP_BACK CMAKE_MESSAGE_INDENT)
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/VERSION.sha.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@OMNIPERF_GIT_REV@
@ROCPROFCOMPUTE_GIT_REV@
10 changes: 5 additions & 5 deletions cmake/omniperf.lua.in → rocprofcompute.lua.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ local help_message = [[
ROCm Compute Profiler is an open-source performance analysis tool for profiling
machine learning/HPC workloads running on AMD MI GPUs.

Version @OMNIPERF_FULL_VERSION@
Version @ROCPROFCOMPUTE_FULL_VERSION@
]]

help(help_message,"\n")

whatis("Name: @PROJECT_NAME@")
whatis("Version: @OMNIPERF_FULL_VERSION@")
whatis("Version: @ROCPROFCOMPUTE_FULL_VERSION@")
whatis("Keywords: Profiling, Performance, GPU")
whatis("Description: tool for GPU performance profiling")
whatis("URL: https://github.com/ROCm/rocprofiler-compute")
Expand All @@ -20,9 +20,9 @@ local binDir="@CMAKE_INSTALL_FULL_BINDIR@"
local shareDir="@CMAKE_INSTALL_FULL_DATADIR@"
local pythonDeps="@PYTHON_DEPS@"

setenv("OMNIPERF_DIR",topDir)
setenv("OMNIPERF_BIN",binDir)
setenv("OMNIPERF_SHARE",shareDir)
setenv("ROCPROFCOMPUTE_DIR",topDir)
setenv("ROCPROFCOMPUTE_BIN",binDir)
setenv("ROCPROFCOMPUTE_SHARE",shareDir)

-- Update relevant PATH variables
prepend_path("PATH",binDir)
Expand Down

0 comments on commit 06e7e70

Please sign in to comment.