Skip to content

Commit 174a587

Browse files
authored
Merge pull request #1377 from mhalk/mhalk/feat/run-ck-install
[CK] Add CL flag to install Composable Kernels
2 parents f20a6e3 + abe5550 commit 174a587

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

bin/run_composable-kernels.sh

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ export PATH=$AOMP/bin:$PATH
1818
function printHelp {
1919
echo "Usage: run_composable-kernels.sh"
2020
echo " -h: Show this help message"
21+
echo " -i: Install the (incremental) CK build"
2122
echo " -r: Rebuild the CK repo"
2223
echo " -u: Update the CK repo"
2324
echo " -b: Update the CK benchmarks repo"
2425
exit 0
2526
}
2627

28+
# Some tests may require an installed instance of CK.
29+
ShouldInstallCK='no'
2730
# For some situations during testing it may not be desired to rebuild the CK repo.
2831
ShouldRebuildCK='no'
2932
# While doing perf / other compiler work, keeping CK fix is useful.
@@ -32,11 +35,15 @@ ShouldUpdateCKRepo='no'
3235
# CK Benchmarks is priate, maybe do not want to update it.
3336
ShouldUpdateCKBenchmarks='no'
3437

35-
while getopts "hrub" opt; do
38+
while getopts "hirub" opt; do
3639
case $opt in
3740
h)
3841
printHelp
3942
;;
43+
i)
44+
# Install the CK build
45+
ShouldInstallCK='yes'
46+
;;
4047
r)
4148
# Rebuild the CK repo
4249
ShouldRebuildCK='yes'
@@ -63,6 +70,7 @@ done
6370
: ${CK_BENCHMARK_REPO:=$CK_TOP/ck-benchmark}
6471
# Move this to its own place, to avoid potential permission conflicts with certain setups.
6572
: ${CK_BENCHMARK_RESULT:=$CK_TOP/ck-benchmark-result}
73+
: ${CK_INSTALL:=$CK_TOP/ck-install}
6674

6775
# Get some info on the system
6876
: ${ROCM_PATH:=/opt/rocm}
@@ -89,7 +97,7 @@ elif [ "${ShouldUpdateCKRepo}" == 'yes' ]; then
8997
fi
9098

9199
# TODO Fix / Finalize the cmake command
92-
CKCmakeCmd="cmake -GNinja -B ${CK_BUILD} -S ${CK_REPO} -DCMAKE_PREFIX_PATH=${ROCM_PATH} "
100+
CKCmakeCmd="cmake -GNinja -B ${CK_BUILD} -S ${CK_REPO} -DCMAKE_PREFIX_PATH=${ROCM_PATH} -DCMAKE_INSTALL_PREFIX=${CK_INSTALL} "
93101
CKCmakeCmd+="-DCMAKE_CXX_COMPILER=${AOMP}/bin/clang++ -DCMAKE_HIP_COMPILER=${AOMP}/bin/clang++ "
94102
CKCmakeCmd+="-DCMAKE_CXX_COMPILER_LAUNCHER=ccache "
95103
CKCmakeCmd+="-DCMAKE_BUILD_TYPE=Release -DGPU_TARGETS=${CK_GPU_TARGETS}"
@@ -116,6 +124,23 @@ if [ "${ShouldRebuildCK}" == 'yes' ]; then
116124
popd
117125
fi
118126

127+
if [ "${ShouldInstallCK}" == 'yes' ]; then
128+
pushd ${CK_BUILD} || exit 1
129+
130+
time ninja -j ${CKBuildParallelism}
131+
if [ $? -ne 0 ]; then
132+
exit 1
133+
fi
134+
135+
# TODO: Check parallelism. This may use all available threads.
136+
time ninja install
137+
if [ $? -ne 0 ]; then
138+
exit 1
139+
fi
140+
141+
popd
142+
fi
143+
119144
# The CK benchmarks repo appears to be private (for the time being).
120145

121146
if [ ! -d ${CK_BENCHMARK_REPO} ]; then

0 commit comments

Comments
 (0)