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

Port asan to 6.3.0.1 #107

Open
wants to merge 1 commit into
base: release/rocm-rel-6.3.0.1
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ Documentation for hipFFT is available at

### Changes

* Building with the address sanitizer option sets xnack+ on relevant GPU
architectures.

## hipFFT 1.0.16 for ROCm 6.3.0

### Changes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Changes
### Changed


* Compile with amdclang++ instead of hipcc for AMD backend; CUDA back-end still uses hipcc-nvcc.
* Replace Boost Program Options with CLI11 as the command line parser for clients.

Expand Down
43 changes: 34 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,37 @@ option(BUILD_ADDRESS_SANITIZER "Build with address sanitizer enabled" OFF)

option( WERROR "Treat warnings as errors" OFF )

set(DEFAULT_GPUS
gfx803
gfx900
gfx906
gfx908
gfx90a
gfx940
gfx941
gfx942
gfx1030
gfx1100
gfx1101
gfx1102
gfx1151
gfx1200
gfx1201)

if(BUILD_ADDRESS_SANITIZER)
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
add_link_options(-shared-libasan)
SET(DEFAULT_GPUS
gfx908:xnack+
gfx90a:xnack+
gfx940:xnack+
gfx941:xnack+
gfx942:xnack+)
add_link_options(-fuse-ld=lld)
add_compile_definitions(ADDRESS_SANITIZER)
endif()

# Set internal BUILD_WITH_COMPILER.
if(NOT (CMAKE_CXX_COMPILER MATCHES ".*hipcc$" OR CMAKE_CXX_COMPILER MATCHES ".*clang\\+\\+"))
set( BUILD_WITH_COMPILER "HOST-default" )
Expand Down Expand Up @@ -121,19 +152,13 @@ if (BUILD_WITH_COMPILER STREQUAL "HIP-NVCC" )
endforeach()
set( WARNING_FLAGS ${NVCC_WARNING_FLAGS} )

else()
else()
# Define GPU targets
set( AMDGPU_TARGETS gfx803;gfx900;gfx906;gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201 CACHE STRING
"List of specific machine types for library to target" )

set(AMDGPU_TARGETS "${DEFAULT_GPUS}" CACHE STRING "Target default GPUs if AMDGPU_TARGETS is not defined.")
#rocm_check_target_ids(AMDGPU_TARGETS TARGETS "${AMDGPU_TARGETS}")
if( BUILD_WITH_COMPILER STREQUAL "HIP-CLANG" )
set( HIP_PLATFORM "amd" )
set( HIP_COMPILER "clang" )
if(BUILD_ADDRESS_SANITIZER)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -shared-libasan")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -shared-libasan")
add_link_options(-fuse-ld=lld)
endif()
endif()
endif()

Expand Down