Skip to content

Commit

Permalink
Merge pull request #194 from CongMa13/dbgsym
Browse files Browse the repository at this point in the history
Use compressed debug symbols
  • Loading branch information
cgmillette authored Mar 19, 2024
2 parents 94f058c + 1623d50 commit 919149a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
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)
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

0 comments on commit 919149a

Please sign in to comment.