mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-14 02:02:46 +00:00
SWDEV-506789 - composable_kernel does not honor cmake BUILD_SHARED (#1844)
* Honor BUILD_SHARED_LIBS
* Add .so versioning when building shared libraries
[ROCm/composable_kernel commit: 9c5b2f3936]
This commit is contained in:
@@ -285,9 +285,14 @@ ENDFOREACH()
|
||||
|
||||
|
||||
if(CK_DEVICE_OTHER_INSTANCES)
|
||||
add_library(device_other_operations STATIC ${CK_DEVICE_OTHER_INSTANCES})
|
||||
add_library(device_other_operations ${CK_DEVICE_OTHER_INSTANCES})
|
||||
add_library(composablekernels::device_other_operations ALIAS device_other_operations)
|
||||
set_target_properties(device_other_operations PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
set_target_properties(device_other_operations
|
||||
PROPERTIES
|
||||
VERSION ${CMAKE_PROJECT_VERSION}
|
||||
SOVERSION ${CMAKE_PROJECT_VERSION_MAJOR}
|
||||
)
|
||||
target_include_directories(device_other_operations PUBLIC
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ck>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ck/utility>
|
||||
@@ -316,10 +321,15 @@ if(CK_DEVICE_OTHER_INSTANCES)
|
||||
)
|
||||
endif()
|
||||
if(CK_DEVICE_GEMM_INSTANCES)
|
||||
add_library(device_gemm_operations STATIC ${CK_DEVICE_GEMM_INSTANCES})
|
||||
add_library(device_gemm_operations ${CK_DEVICE_GEMM_INSTANCES})
|
||||
add_library(composablekernels::device_gemm_operations ALIAS device_gemm_operations)
|
||||
target_compile_features(device_gemm_operations PUBLIC)
|
||||
set_target_properties(device_gemm_operations PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
set_target_properties(device_gemm_operations
|
||||
PROPERTIES
|
||||
VERSION ${CMAKE_PROJECT_VERSION}
|
||||
SOVERSION ${CMAKE_PROJECT_VERSION_MAJOR}
|
||||
)
|
||||
target_include_directories(device_gemm_operations PUBLIC
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ck/library/tensor_operation_instance/gpu>
|
||||
)
|
||||
@@ -332,10 +342,15 @@ if(CK_DEVICE_GEMM_INSTANCES)
|
||||
)
|
||||
endif()
|
||||
if(CK_DEVICE_CONV_INSTANCES)
|
||||
add_library(device_conv_operations STATIC ${CK_DEVICE_CONV_INSTANCES})
|
||||
add_library(device_conv_operations ${CK_DEVICE_CONV_INSTANCES})
|
||||
add_library(composablekernels::device_conv_operations ALIAS device_conv_operations)
|
||||
target_compile_features(device_conv_operations PUBLIC)
|
||||
set_target_properties(device_conv_operations PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
set_target_properties(device_conv_operations
|
||||
PROPERTIES
|
||||
VERSION ${CMAKE_PROJECT_VERSION}
|
||||
SOVERSION ${CMAKE_PROJECT_VERSION_MAJOR}
|
||||
)
|
||||
target_include_directories(device_conv_operations PUBLIC
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ck/library/tensor_operation_instance/gpu>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ck/library/tensor_operation_instance/gpu/conv_tensor_rearrange>
|
||||
@@ -354,7 +369,12 @@ endif()
|
||||
if(CK_DEVICE_MHA_INSTANCES)
|
||||
set(gpu_list ${INST_TARGETS})
|
||||
if(gpu_list MATCHES "gfx94" OR gpu_list MATCHES "gfx90a")
|
||||
add_library(device_mha_operations STATIC ${CK_DEVICE_MHA_INSTANCES})
|
||||
add_library(device_mha_operations ${CK_DEVICE_MHA_INSTANCES})
|
||||
set_target_properties(device_mha_operations
|
||||
PROPERTIES
|
||||
VERSION ${CMAKE_PROJECT_VERSION}
|
||||
SOVERSION ${CMAKE_PROJECT_VERSION_MAJOR}
|
||||
)
|
||||
add_library(composablekernels::device_mha_operations ALIAS device_mha_operations)
|
||||
target_compile_features(device_mha_operations PUBLIC)
|
||||
set_target_properties(device_mha_operations PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
@@ -369,10 +389,15 @@ if(CK_DEVICE_MHA_INSTANCES)
|
||||
endif()
|
||||
endif()
|
||||
if(CK_DEVICE_CONTRACTION_INSTANCES)
|
||||
add_library(device_contraction_operations STATIC ${CK_DEVICE_CONTRACTION_INSTANCES})
|
||||
add_library(device_contraction_operations ${CK_DEVICE_CONTRACTION_INSTANCES})
|
||||
add_library(composablekernels::device_contraction_operations ALIAS device_contraction_operations)
|
||||
target_compile_features(device_contraction_operations PUBLIC)
|
||||
set_target_properties(device_contraction_operations PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
set_target_properties(device_contraction_operations
|
||||
PROPERTIES
|
||||
VERSION ${CMAKE_PROJECT_VERSION}
|
||||
SOVERSION ${CMAKE_PROJECT_VERSION_MAJOR}
|
||||
)
|
||||
target_include_directories(device_contraction_operations PUBLIC
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ck/library/tensor_operation_instance/gpu>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ck/library/tensor_operation_instance/gpu/contraction>
|
||||
@@ -386,10 +411,15 @@ if(CK_DEVICE_CONTRACTION_INSTANCES)
|
||||
)
|
||||
endif()
|
||||
if(CK_DEVICE_REDUCTION_INSTANCES)
|
||||
add_library(device_reduction_operations STATIC ${CK_DEVICE_REDUCTION_INSTANCES})
|
||||
add_library(device_reduction_operations ${CK_DEVICE_REDUCTION_INSTANCES})
|
||||
add_library(composablekernels::device_reduction_operations ALIAS device_reduction_operations)
|
||||
target_compile_features(device_reduction_operations PUBLIC)
|
||||
set_target_properties(device_reduction_operations PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
set_target_properties(device_reduction_operations
|
||||
PROPERTIES
|
||||
VERSION ${CMAKE_PROJECT_VERSION}
|
||||
SOVERSION ${CMAKE_PROJECT_VERSION_MAJOR}
|
||||
)
|
||||
target_include_directories(device_reduction_operations PUBLIC
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ck/library/tensor_operation_instance/gpu/reduce>
|
||||
)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
add_library(utility STATIC
|
||||
add_library(utility
|
||||
device_memory.cpp
|
||||
host_tensor.cpp
|
||||
convolution_parameter.cpp
|
||||
@@ -6,6 +6,10 @@ add_library(utility STATIC
|
||||
|
||||
add_library(composable_kernel::utility ALIAS utility)
|
||||
set_target_properties(utility PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
set_target_properties(utility
|
||||
PROPERTIES
|
||||
VERSION ${CMAKE_PROJECT_VERSION}
|
||||
SOVERSION ${CMAKE_PROJECT_VERSION_MAJOR})
|
||||
target_compile_options(utility PRIVATE ${CMAKE_COMPILER_WARNINGS})
|
||||
target_include_directories(utility PUBLIC
|
||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ck>"
|
||||
|
||||
Reference in New Issue
Block a user