Skip to content

Commit

Permalink
Remove COMPILING_TARGETS from CMakeLists.txt
Browse files Browse the repository at this point in the history
COMPILING_TARGETS is not actually used for --offload-arch option,
instead GPU_TARGETS is being used implicitly when we call
find_package(hip REQUIRED) (See hip-config-amd.cmake).
  • Loading branch information
sohaibnd authored and Sohaib Nadeem committed Feb 11, 2025
1 parent 3398fa7 commit 3af27ec
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ if (BUILD_ADDRESS_SANITIZER)
endif()
endif()
endforeach()
SET(GPU_TARGETS "${amdgpu_targets}" CACHE STRING "Modified GPU list for Address-Sanitizer enabled build." FORCE)
SET(GPU_TARGETS "${amdgpu_targets}")
endif()

# Check if clang compiler can offload to GPU_TARGETS
Expand All @@ -95,11 +95,11 @@ else()
set(SUPPORTED_GPUS ${DEFAULT_GPUS})
endif()

set(COMPILING_TARGETS "${SUPPORTED_GPUS}" CACHE STRING "GPU targets to compile for.")
message(STATUS "Compiling for ${COMPILING_TARGETS}")
set(GPU_TARGETS "${SUPPORTED_GPUS}")
message(STATUS "Compiling for ${GPU_TARGETS}")

## NOTE: Reload rocm-cmake in order to update COMPILING_TARGETS
include(cmake/Dependencies.cmake) # Reloading to use desired COMPILING_TARGETS instead of defaults
## NOTE: Reload rocm-cmake in order to update GPU_TARGETS
include(cmake/Dependencies.cmake) # Reloading to use desired GPU_TARGETS instead of defaults

# Try to establish ROCM_PATH (for find_package)
#==================================================================================================
Expand Down Expand Up @@ -307,7 +307,7 @@ endif()

## Disable building MSCCL++ if the build environment is invalid
## Currently MSCCL++ is supported only on gfx942, and only on Ubuntu and CentOS
if (ENABLE_MSCCLPP AND NOT ("gfx942" IN_LIST COMPILING_TARGETS OR "gfx942:xnack-" IN_LIST COMPILING_TARGETS OR "gfx942:xnack+" IN_LIST COMPILING_TARGETS))
if (ENABLE_MSCCLPP AND NOT ("gfx942" IN_LIST GPU_TARGETS OR "gfx942:xnack-" IN_LIST GPU_TARGETS OR "gfx942:xnack+" IN_LIST GPU_TARGETS))
set(ENABLE_MSCCLPP OFF)
message(WARNING "Can only build MSCCL++ for gfx942; disabling MSCCL++ build")
endif()
Expand Down Expand Up @@ -779,7 +779,7 @@ if (HAVE_KERNARG_PRELOAD)
endif()

## NOTE: This is currently being handled by rocm-cmake, however may need to be re-enabled in the future
#foreach(target ${COMPILING_TARGETS})
#foreach(target ${GPU_TARGETS})
# target_compile_options(rccl PRIVATE --offload-arch=${target})
#endforeach()

Expand Down Expand Up @@ -904,7 +904,7 @@ if(NOT BUILD_SHARED_LIBS)
endif()
endforeach()

foreach(target ${COMPILING_TARGETS})
foreach(target ${GPU_TARGETS})
list(APPEND static_link_flags --offload-arch=${target})
endforeach()
list(JOIN static_link_flags " " flags_str)
Expand Down

0 comments on commit 3af27ec

Please sign in to comment.