Skip to content

Commit

Permalink
Update CK patch in ORT
Browse files Browse the repository at this point in the history
  • Loading branch information
groenenboomj committed Mar 13, 2024
1 parent 49b5a0d commit a7e8851
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
3 changes: 0 additions & 3 deletions cmake/external/composable_kernel.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
set(PATCH ${PROJECT_SOURCE_DIR}/patches/composable_kernel/Fix_Clang_Build.patch)

include(FetchContent)
FetchContent_Declare(composable_kernel
URL ${DEP_URL_composable_kernel}
URL_HASH SHA1=${DEP_SHA1_composable_kernel}
PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PATCH}
)

FetchContent_GetProperties(composable_kernel)
Expand Down
26 changes: 10 additions & 16 deletions cmake/patches/composable_kernel/Fix_Clang_Build.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 04674124c..12e8b8b00 100644
index 6fc22b18..c2c22925 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,7 +19,7 @@ endif()
Expand All @@ -11,7 +11,7 @@ index 04674124c..12e8b8b00 100644

list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")

@@ -173,27 +173,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -201,27 +201,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
message("CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")

Expand Down Expand Up @@ -39,7 +39,7 @@ index 04674124c..12e8b8b00 100644
## HIP
find_package(HIP REQUIRED)
# Override HIP version in config.h, if necessary.
@@ -215,8 +194,6 @@ if( DEFINED CK_OVERRIDE_HIP_VERSION_PATCH )
@@ -243,8 +222,6 @@ if( DEFINED CK_OVERRIDE_HIP_VERSION_PATCH )
message(STATUS "CK_HIP_VERSION_PATCH overriden with ${CK_OVERRIDE_HIP_VERSION_PATCH}")
endif()
message(STATUS "Build with HIP ${HIP_VERSION}")
Expand All @@ -48,18 +48,7 @@ index 04674124c..12e8b8b00 100644

## tidy
include(EnableCompilerWarnings)
@@ -376,7 +353,9 @@ if(BUILD_DEV)
add_compile_options(-Werror -Weverything)
endif()
#add flags to reduce the size of binaries
-add_compile_options(-Oz -flto=thin)
+# -flto requires ORT to use a linker that support LTO and -flto flag shoud be passed to linker together.
+# add_compile_options(-Oz -flto=thin)
+add_compile_options(-Oz)
message("CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")

add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C ${CMAKE_CFG_INTDIR})
@@ -482,11 +461,3 @@ rocm_install(FILES
@@ -509,11 +486,3 @@ rocm_install(FILES

set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_RPM_PACKAGE_LICENSE "MIT")
Expand All @@ -72,7 +61,7 @@ index 04674124c..12e8b8b00 100644
- HEADER_ONLY
-)
diff --git a/library/src/tensor_operation_instance/gpu/CMakeLists.txt b/library/src/tensor_operation_instance/gpu/CMakeLists.txt
index 9cb5d0e9a..141a46f3d 100644
index ac01c1b4..27f2a720 100644
--- a/library/src/tensor_operation_instance/gpu/CMakeLists.txt
+++ b/library/src/tensor_operation_instance/gpu/CMakeLists.txt
@@ -44,8 +44,14 @@ function(add_instance_library INSTANCE_NAME)
Expand All @@ -90,3 +79,8 @@ index 9cb5d0e9a..141a46f3d 100644
set_target_properties(${INSTANCE_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
clang_tidy_check(${INSTANCE_NAME})
set(result 0)
@@ -281,4 +287,3 @@ set(DEV_OPS_INC_DIRS
${PROJECT_SOURCE_DIR}/library/include/ck/
)
rocm_install(DIRECTORY ${DEV_OPS_INC_DIRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ck)
-

0 comments on commit a7e8851

Please sign in to comment.