Skip to content

Commit

Permalink
Remove SINGLE_LIB cmake option and all rocfft device sub-lib cmake code.
Browse files Browse the repository at this point in the history
  • Loading branch information
malcolmroberts authored Jan 5, 2024
1 parent d046b5d commit a137724
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 96 deletions.
4 changes: 2 additions & 2 deletions .jenkins/performance.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ def runCompileCommand(platform, project, jobName, boolean debug=false, boolean b
set -e
mkdir -p build/${buildTypeDir} && pushd build/${buildTypeDir}
${auxiliary.gfxTargetParser()}
${cmake} -DCMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc -DCMAKE_C_COMPILER=/opt/rocm/bin/hipcc -DAMDGPU_TARGETS=\$gfx_arch -DSINGLELIB=on ${buildTypeArg} ${clientArgs} ${warningArgs} ${rtcBuildCache} ../..
${cmake} -DCMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc -DCMAKE_C_COMPILER=/opt/rocm/bin/hipcc -DAMDGPU_TARGETS=\$gfx_arch ${buildTypeArg} ${clientArgs} ${warningArgs} ${rtcBuildCache} ../..
make -j\$(nproc)
popd
cd ref-repo
mkdir -p build/${buildTypeDir} && pushd build/${buildTypeDir}
${auxiliary.gfxTargetParser()}
${cmake} -DCMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc -DCMAKE_C_COMPILER=/opt/rocm/bin/hipcc -DAMDGPU_TARGETS=\$gfx_arch -DSINGLELIB=on ${buildTypeArg} ${noclientArgs} ${warningArgs} ${rtcBuildCache} ../..
${cmake} -DCMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc -DCMAKE_C_COMPILER=/opt/rocm/bin/hipcc -DAMDGPU_TARGETS=\$gfx_arch ${buildTypeArg} ${noclientArgs} ${warningArgs} ${rtcBuildCache} ../..
make -j\$(nproc)
"""
platform.runCommand(this, command)
Expand Down
10 changes: 0 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,6 @@ rocm_check_target_ids(DEFAULT_AMDGPU_TARGETS
set(AMDGPU_TARGETS "${DEFAULT_AMDGPU_TARGETS}" CACHE STRING "List of specific machine types for library to target")
list(LENGTH AMDGPU_TARGETS AMDGPU_TARGETS_LENGTH)

if(SINGLELIB AND ${AMDGPU_TARGETS_LENGTH} GREATER 2 )
message(
FATAL_ERROR
"SINGLELIB build requires at most two architecture in AMDGPU_TARGETS. "
"A multi-arch SINGLELIB library may exceed size limits and fail to build. "
"SINGLELIB builds are only for benchmarking and should be built for exactly "
"the architectures being benchmarked."
)
endif()

# HIP is required - library and clients use HIP to access the device
find_package( HIP REQUIRED )

Expand Down
84 changes: 0 additions & 84 deletions library/src/device/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,87 +182,3 @@ foreach( pool rocfft-function-pool )
add_dependencies(${pool} gen_headers_target)
endforeach()

list( LENGTH rocfft_device_source rocfft_device_source_len )
math(EXPR split_len "${rocfft_device_source_len} / 4")
math(EXPR split_idx_2 "${rocfft_device_source_len} / 4 * 2")
math(EXPR split_idx_3 "${rocfft_device_source_len} / 4 * 3")

list( SUBLIST rocfft_device_source 0 ${split_len} rocfft_device_source_0 )
list( SUBLIST rocfft_device_source ${split_len} ${split_len} rocfft_device_source_1 )
list( SUBLIST rocfft_device_source ${split_idx_2} ${split_len} rocfft_device_source_2 )
list( SUBLIST rocfft_device_source ${split_idx_3} -1 rocfft_device_source_3 )

foreach( sub RANGE 3 )
set( rocfft_device_source_var rocfft_device_source_${sub} )
if( NOT ${rocfft_device_source_var} )
continue()
endif()
if(NOT SINGLELIB)
add_library( rocfft-device-${sub}
${${rocfft_device_source_var}} )
else()
# Compile the device lib as a static library, which is then linked
# into librocfft.so Useful for testing purposes.
add_library( rocfft-device-${sub} STATIC
${${rocfft_device_source_var}} )

# if we're building singlelib, we don't want to export any of the
# device library symbols to the main library
set_target_properties( rocfft-device-${sub} PROPERTIES CXX_VISIBILITY_PRESET "hidden" VISIBILITY_INLINES_HIDDEN ON )
endif()

set_property(TARGET rocfft-device-${sub} PROPERTY POSITION_INDEPENDENT_CODE ON)

if(ROCFFT_CALLBACKS_ENABLED)
target_compile_definitions( rocfft-device-${sub} PRIVATE ROCFFT_CALLBACKS_ENABLED )
endif()

add_library( roc::rocfft-device-${sub} ALIAS rocfft-device-${sub} )

# To help "make" to figure out the dependency, in which make sure
# the kernel generator runs only once.
add_dependencies(rocfft-device-${sub} gen_headers_target)

if( NOT BUILD_SHARED_LIBS )
target_link_libraries( rocfft-device-${sub} INTERFACE ${ROCFFT_HOST_LINK_LIBS} )
endif()
target_link_libraries( rocfft-device-${sub} PRIVATE ${ROCFFT_DEVICE_LINK_LIBS} ${ROCFFT_HOST_LINK_LIBS} )

target_compile_options( rocfft-device-${sub} PRIVATE -fno-gpu-rdc )

# Set AMD GPU architecture options

# Enable compilation of desired architectures
foreach( target ${AMDGPU_TARGETS} )
target_compile_options( rocfft-device-${sub} PRIVATE --offload-arch=${target} )
endforeach( )

target_include_directories( rocfft-device-${sub}
PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/kernels>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/generator>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/library/include>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
)

rocm_set_soversion( rocfft-device-${sub} ${rocfft_SOVERSION} )
set_target_properties( rocfft-device-${sub} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
"${PROJECT_BINARY_DIR}/staging" )
set_target_properties( rocfft-device-${sub} PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
)

# Following Boost conventions of prefixing 'lib' on static built
# libraries, across all platforms
if( NOT BUILD_SHARED_LIBS )
set_target_properties( rocfft-device-${sub} PROPERTIES PREFIX "lib" )
endif( )

rocm_install_targets(
TARGETS
rocfft-device-${sub}
)
endforeach()

0 comments on commit a137724

Please sign in to comment.