From 50ec07c3e3c2fedf035e2d87a0adc0fbbad5111c Mon Sep 17 00:00:00 2001 From: bibek <108366729+bghimireamd@users.noreply.github.com> Date: Fri, 13 Sep 2024 23:15:04 -0500 Subject: [PATCH] Fix duplicate CMake tidy-target issue (#1513) [ROCm/composable_kernel commit: 49e012dee1a2224606981cc7fb3347184cfb6e78] --- .../src/tensor_operation_instance/gpu/mha/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/src/tensor_operation_instance/gpu/mha/CMakeLists.txt b/library/src/tensor_operation_instance/gpu/mha/CMakeLists.txt index 8bfda97e71..89dee21fb1 100644 --- a/library/src/tensor_operation_instance/gpu/mha/CMakeLists.txt +++ b/library/src/tensor_operation_instance/gpu/mha/CMakeLists.txt @@ -27,6 +27,11 @@ rocm_install(FILES ${MHA_HEADERS} DESTINATION include/ck_tile/ops) # headers for building lib file(COPY ${MHA_HEADERS} DESTINATION ${FMHA_CPP_FOLDER}) +# Delete the blob file if it exists to avoid append of old content. +if(EXISTS ${FMHA_CPP_FOLDER}/blob_list.txt) + file(REMOVE ${FMHA_CPP_FOLDER}/blob_list.txt) +endif() + # generate a list of kernels, but not actually emit files at config stage execute_process( COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/example/ck_tile/01_fmha/generate.py @@ -39,7 +44,7 @@ else() file(STRINGS ${FMHA_CPP_FOLDER}/blob_list.txt FMHA_FWD_GEN_BLOBS) endif() -# actually generate the cpp files +# actually generate the kernel content now add_custom_command( OUTPUT ${FMHA_FWD_GEN_BLOBS} COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/example/ck_tile/01_fmha/generate.py