Skip to content

Commit d51a5ee

Browse files
committed
[rocisa] Use comgr instead of calling amdclang++
1 parent 5d79977 commit d51a5ee

File tree

7 files changed

+371
-435
lines changed

7 files changed

+371
-435
lines changed

tensilelite/CMakeLists.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ cmake_minimum_required(VERSION 3.15)
3232
# This CMakeLists.txt supports two modes with setting DEVELOP_MODE ON or OFF:
3333
# 1. Script mode (DEVELOP_MODE=ON): It creates a script that can be run after the configuration
3434
# When using mode, you can run it as:
35-
# cmake -DTENSILE_BIN=Tensile -DDEVELOP_MODE=ON ..
35+
# cmake -DCMAKE_CXX_COMPILER=/opt/rocm/lib/llvm/bin/amdclang++ -DTENSILE_BIN=Tensile -DDEVELOP_MODE=ON ..
3636
# The script will be created in the build folder and will be named in Tensile.bat or Tensile.sh
3737
# depending on the platform. You can then run the script as:
3838
# Tensile.sh config.yaml ./
3939
# or
40-
# Tensile.bat config.yaml ./
40+
# Tensile.bat config.yaml ./
4141
# 2. Normal CMake mode: It sets the Python srguments at configuration stage with "BIN_ARGS"
4242
# With this mode, you can run it as:
43-
# cmake -DTENSILE_BIN=Tensile -DBIN_ARGS="config.yaml ./" .. && cmake --build .
43+
# cmake -DCMAKE_CXX_COMPILER=/opt/rocm/lib/llvm/bin/amdclang++ -DTENSILE_BIN=Tensile -DBIN_ARGS="config.yaml ./" .. && cmake --build .
4444
# The script will check if the TENSILE_BIN is valid and if the BIN_ARGS
4545
# are provided. It will then run the specified Tensile binary with the
4646
# provided arguments after the build step.
@@ -123,7 +123,7 @@ else()
123123
message(STATUS "Script set: ${TENSILE_BIN} ${BIN_ARGS_LIST}")
124124

125125
# Ensure the Python script runs after the build
126-
add_custom_target(RunPythonScript
126+
add_custom_target(RunPythonScript
127127
ALL
128128
COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${PYTHONPATH} -- ${Python_EXECUTABLE} ${TENSILE_BIN_ROOT}/${TENSILE_BIN} ${BIN_ARGS_LIST}
129129
COMMENT "Running Python script ${TENSILE_BIN} ${BIN_ARGS_LIST}"

tensilelite/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
** How to Rebuild Object Codes Directly from Assembly
44

5-
During the tuning process, it is of interest to modify an assembly file/s and rebuild the corresponding object file/s and then relink the corresponding co file. Currently, we generate additional source files and a script to provide this workflow.
5+
During the tuning process, it is of interest to modify an assembly file/s and rebuild the corresponding object file/s and then relink the corresponding co file. Currently, we generate additional source files and a script to provide this workflow.
66

77
A new `Makefile` is added that manages rebuilding a co file during iterative development when tuning. One modifies an assembly file of interest, then runs `make` and make will detect what file/s changed and rebuild accordingly.
88

@@ -14,7 +14,7 @@ Assumptions:
1414

1515
Example:
1616

17-
```cmake -DTENSILE_BIN=Tensile -DDEVELOP_MODE=ON -S <path-to-tensilelite-root> -B <tensile-out>```
17+
```cmake -DCMAKE_CXX_COMPILER=/opt/rocm/lib/llvm/bin/amdclang++ -DTENSILE_BIN=Tensile -DDEVELOP_MODE=ON -S <path-to-tensilelite-root> -B <tensile-out>```
1818

1919
The script will be created in the build folder and will be named in Tensile.bat or Tensile.sh depending on the platform. Then you can then run the script under the ``tensile-out`` folder as usual:
2020

tensilelite/rocisa/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ set(CMAKE_CXX_STANDARD 20)
2626
set(CMAKE_CXX_STANDARD_REQUIRED ON)
2727
set(CMAKE_CXX_EXTENSIONS OFF)
2828

29+
find_package(amd_comgr REQUIRED CONFIG)
30+
2931
if(DEFINED Python_EXECUTABLE AND Python_EXECUTABLE)
3032
message(STATUS "Manually set Python_EXECUTABLE to ${Python_EXECUTABLE}")
3133
endif()
@@ -73,5 +75,7 @@ nanobind_add_module(rocisa NOMINSIZE NB_SUPPRESS_WARNINGS
7375
${CMAKE_CURRENT_SOURCE_DIR}/rocisa/src/macro.cpp
7476
${ROCISAINST_SOURCE}
7577
${ROCISAPASS_SOURCE})
78+
7679
target_include_directories(rocisa PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/rocisa/include)
80+
target_link_libraries(rocisa PRIVATE amd_comgr)
7781
set_target_properties(rocisa PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)

0 commit comments

Comments
 (0)