Skip to content

Commit f1d277d

Browse files
committed
Update CK patch
1 parent 0c817fa commit f1d277d

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

cmake/patches/composable_kernel/Fix_Clang_Build.patch

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
diff --git a/CMakeLists.txt b/CMakeLists.txt
2-
index 6fc22b18..c2c22925 100644
2+
index bdeba33e..afe406b3 100644
33
--- a/CMakeLists.txt
44
+++ b/CMakeLists.txt
5-
@@ -19,7 +19,7 @@ endif()
5+
@@ -23,7 +23,7 @@ endif()
66

77
set(version 1.1.0)
88
# Check support for CUDA/HIP in Cmake
9-
-project(composable_kernel VERSION ${version})
9+
-project(composable_kernel VERSION ${version} LANGUAGES CXX)
1010
+project(composable_kernel VERSION ${version} LANGUAGES CXX HIP)
11+
include(CTest)
1112

1213
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
13-
14-
@@ -201,27 +201,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
14+
@@ -206,27 +206,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
1515
set(CMAKE_CXX_EXTENSIONS OFF)
1616
message("CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
1717

@@ -39,16 +39,20 @@ index 6fc22b18..c2c22925 100644
3939
## HIP
4040
find_package(HIP REQUIRED)
4141
# Override HIP version in config.h, if necessary.
42-
@@ -243,8 +222,6 @@ if( DEFINED CK_OVERRIDE_HIP_VERSION_PATCH )
42+
@@ -248,12 +227,6 @@ if( DEFINED CK_OVERRIDE_HIP_VERSION_PATCH )
4343
message(STATUS "CK_HIP_VERSION_PATCH overriden with ${CK_OVERRIDE_HIP_VERSION_PATCH}")
4444
endif()
4545
message(STATUS "Build with HIP ${HIP_VERSION}")
4646
-link_libraries(hip::device)
47-
-add_compile_definitions(__HIP_PLATFORM_HCC__=1)
47+
-if(CK_hip_VERSION VERSION_GREATER_EQUAL 6.0.23494)
48+
- add_compile_definitions(__HIP_PLATFORM_AMD__=1)
49+
-else()
50+
- add_compile_definitions(__HIP_PLATFORM_HCC__=1)
51+
-endif()
4852

4953
## tidy
5054
include(EnableCompilerWarnings)
51-
@@ -509,11 +486,3 @@ rocm_install(FILES
55+
@@ -520,11 +493,3 @@ rocm_install(FILES
5256

5357
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
5458
set(CPACK_RPM_PACKAGE_LICENSE "MIT")
@@ -61,10 +65,10 @@ index 6fc22b18..c2c22925 100644
6165
- HEADER_ONLY
6266
-)
6367
diff --git a/library/src/tensor_operation_instance/gpu/CMakeLists.txt b/library/src/tensor_operation_instance/gpu/CMakeLists.txt
64-
index ac01c1b4..27f2a720 100644
68+
index 0a12e1c4..dcdaaf5a 100644
6569
--- a/library/src/tensor_operation_instance/gpu/CMakeLists.txt
6670
+++ b/library/src/tensor_operation_instance/gpu/CMakeLists.txt
67-
@@ -44,8 +44,14 @@ function(add_instance_library INSTANCE_NAME)
71+
@@ -44,8 +44,13 @@ function(add_instance_library INSTANCE_NAME)
6872
endforeach()
6973
#only continue if there are some source files left on the list
7074
if(ARGN)
@@ -73,13 +77,12 @@ index ac01c1b4..27f2a720 100644
7377
+ # Always disable debug symbol and C debug assert due to
7478
+ # - Linker error: ... relocation truncated to fit ..., caused by object files to be linked are too huge.
7579
+ # - https://github.com/ROCmSoftwarePlatform/composable_kernel/issues/622
76-
+ target_compile_options(${INSTANCE_NAME} PRIVATE -g0 -DNDEBUG)
7780
target_compile_features(${INSTANCE_NAME} PUBLIC)
7881
+ target_compile_definitions(${INSTANCE_NAME} PRIVATE "__HIP_PLATFORM_AMD__=1" "__HIP_PLATFORM_HCC__=1")
7982
set_target_properties(${INSTANCE_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
8083
clang_tidy_check(${INSTANCE_NAME})
8184
set(result 0)
82-
@@ -281,4 +287,3 @@ set(DEV_OPS_INC_DIRS
85+
@@ -280,4 +285,3 @@ set(DEV_OPS_INC_DIRS
8386
${PROJECT_SOURCE_DIR}/library/include/ck/
8487
)
8588
rocm_install(DIRECTORY ${DEV_OPS_INC_DIRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ck)

0 commit comments

Comments
 (0)