Skip to content

Commit

Permalink
Merge pull request #345 from ohearnk/build-updates-unsupported-ffunc-…
Browse files Browse the repository at this point in the history
…with-gpu-legacy-atomics

Add error checks for builds enabling f-functions with GPU targets requiring legacy atomics (-DUSE_LEGACY_ATOMICS).
  • Loading branch information
agoetz committed Mar 21, 2024
2 parents 1025d42 + ded8daf commit c3c7dab
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
9 changes: 9 additions & 0 deletions cmake/BuildReport.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,13 @@ function(print_build_report)
if(DEFINED PRINT_PACKAGING_REPORT AND PRINT_PACKAGING_REPORT)
print_packaging_report()
endif()


if(ENABLEF AND (DEFINED CUDA OR DEFINED HIP))
message("")
colormsg(HIRED "You have enabled F function support for GPUs. The current version of the F function ")
colormsg(HIRED "code takes very long to compile (hours) and requires a large amount of RAM. ")
colormsg(HIRED "Work is planned to optimize this in future releases. ")
message("")
endif()
endfunction(print_build_report)
8 changes: 8 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,14 @@ if [ "$hip" = 'yes' ] || [ "$hipmpi" = 'yes' ]; then
exit 1
fi

# HIP codes currently do not support f-functions with -DUSE_LEGACY_ATOMICS targets (gfx906 and gfx908)
if [ "$enablef" = 'yes' -a [ "$uspec_arch" -ne 'true' -o "$cuda_arch" = "gfx906" -o "$cuda_arch" = "gfx908" ] ]; then
echo "Error: Unsupported HIP options (ENABLEF with -DUSE_LEGACY_ATOMICS). "
echo " QUICK support for f-functions requires newer HIP architecture targets not using LEGACY_ATOMICS. "
echo " Please specify architectures with --arch not needing LEGACY_ATOMICS (post-gfx908) or disable f-function support. "
exit 1
fi

set_uspec_hip_arch

if [ -z $verbose ]; then
Expand Down
7 changes: 6 additions & 1 deletion quick-cmake/QUICKCudaConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ if(CUDA)
if("${QUICK_USER_ARCH}" MATCHES "maxwell")
message(STATUS "Configuring QUICK for SM5.0")
list(APPEND CUDA_NVCC_FLAGS ${SM50FLAGS})
list(APPEND CUDA_NVCC_FLAGS -DUSE_LEGACY_ATOMICS)
list(APPEND CUDA_NVCC_FLAGS -DUSE_LEGACY_ATOMICS)
set(DISABLE_OPTIMIZER_CONSTANTS TRUE)
set(FOUND "TRUE")
endif()
Expand Down Expand Up @@ -253,6 +253,11 @@ if(HIP)
list(APPEND AMD_HIP_FLAGS -fPIC)
set(TARGET_ID_SUPPORT ON)

# HIP codes currently do not support f-functions with -DUSE_LEGACY_ATOMICS targets (gfx906 and gfx908)
if(ENABLEF AND (("${QUICK_USER_ARCH}" STREQUAL "") OR ("${QUICK_USER_ARCH}" MATCHES "gfx906") OR ("${QUICK_USER_ARCH}" MATCHES "gfx908")))
message(FATAL_ERROR "Error: Unsupported HIP options (ENABLEF with -DUSE_LEGACY_ATOMICS). ${PROJECT_NAME} support for f-functions requires newer HIP architecture targets not using LEGACY_ATOMICS. Please specify architectures with QUICK_USER_ARCH not needing LEGACY_ATOMICS (post-gfx908) or disable f-function support.")
endif()

if( NOT "${QUICK_USER_ARCH}" STREQUAL "")
set(FOUND "FALSE")
if("${QUICK_USER_ARCH}" MATCHES "gfx908")
Expand Down

0 comments on commit c3c7dab

Please sign in to comment.