Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use compressed debug symbols #194

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
if( CMAKE_PROJECT_NAME STREQUAL "hiptensor" )
option( HIPTENSOR_BUILD_TESTS "Build hiptensor tests" ON )
option( HIPTENSOR_BUILD_SAMPLES "Build hiptensor samples" ON )
option( HIPTENSOR_BUILD_COMPRESSED_DBG "Enable compressed debug symbols" ON)
option( HIPTENSOR_DATA_LAYOUT_COL_MAJOR "Set hiptensor data layout to column major" ON )
endif()

Expand Down
12 changes: 12 additions & 0 deletions library/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ function(add_hiptensor_component COMPONENT_NAME COMPONENT_SOURCES)
add_library(${COMPONENT_NAME} OBJECT ${COMPONENT_SOURCES})
set_target_properties(${COMPONENT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_link_libraries(${COMPONENT_NAME} PRIVATE hip::device)
if(HIPTENSOR_BUILD_COMPRESSED_DBG)
target_compile_options(${COMPONENT_NAME} PRIVATE
"$<$<CONFIG:Debug>:-gz>"
"$<$<CONFIG:RelWithDebInfo>:-gz>"
)
endif()

endfunction()

Expand Down Expand Up @@ -80,6 +86,12 @@ add_library(hiptensor SHARED
add_library(hiptensor::hiptensor ALIAS hiptensor)

target_compile_options(hiptensor PRIVATE ${CMAKE_CXX_FLAGS})
if(HIPTENSOR_BUILD_COMPRESSED_DBG)
cgmillette marked this conversation as resolved.
Show resolved Hide resolved
target_compile_options(hiptensor PRIVATE
"$<$<CONFIG:Debug>:-gz>"
"$<$<CONFIG:RelWithDebInfo>:-gz>"
)
endif()

set ( hiptensor_SOVERSION 0.1 )
# nvcc can not recognize shared libraray file name with suffix other than *.so when linking.
Expand Down
Loading