@@ -20,6 +20,7 @@ option(MFC_MPI "Build with MPI" ON
2020option (MFC_OpenACC "Build with OpenACC" OFF )
2121option (MFC_GCov "Build with GCov" OFF )
2222option (MFC_Unified "Build with unified CPU & GPU memory (GH-200 only)" OFF )
23+ option (MFC_Fastmath "Build with -fastmath on NV GPUs" OFF )
2324option (MFC_PRE_PROCESS "Build pre_process" OFF )
2425option (MFC_SIMULATION "Build simulation" OFF )
2526option (MFC_POST_PROCESS "Build post_process" OFF )
@@ -487,6 +488,9 @@ function(MFC_SETUP_TARGET)
487488 "-foffload=amdgcn-amdhsa='-march=gfx90a'"
488489 "-foffload-options=-lgfortran\ -lm"
489490 "-fno-exceptions" )
491+ if (MFC_Fastmath)
492+ message (WARNING "--fastmath has no effect with the GNU compiler" )
493+ endif ()
490494 elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC" OR CMAKE_Fortran_COMPILER_ID STREQUAL "PGI" )
491495 foreach (cc ${MFC_CUDA_CC} )
492496 target_compile_options (${a_target}
@@ -498,6 +502,12 @@ function(MFC_SETUP_TARGET)
498502 PRIVATE -gpu=keep,ptxinfo,lineinfo
499503 )
500504
505+ if (MFC_Fastmath)
506+ target_compile_options (${a_target}
507+ PRIVATE -gpu=fastmath
508+ )
509+ endif ()
510+
501511 # GH-200 Unified Memory Support
502512 if (MFC_Unified)
503513 target_compile_options (${ARGS_TARGET}
@@ -521,11 +531,18 @@ function(MFC_SETUP_TARGET)
521531 PRIVATE -DFRONTIER_UNIFIED)
522532 endif ()
523533
534+ if (MFC_Fastmath)
535+ message (WARNING "--fastmath has no effect with the CCE" )
536+ endif ()
537+
524538 find_package (hipfort COMPONENTS hip CONFIG REQUIRED)
525539 target_link_libraries (${a_target} PRIVATE hipfort::hip hipfort::hipfort-amdgcn)
526540 endif ()
527541 elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "Cray" )
528542 target_compile_options (${a_target} PRIVATE "SHELL:-h noacc" "SHELL:-x acc" )
543+ if (MFC_Fastmath)
544+ message (WARNING "--fastmath has no effect with the CCE" )
545+ endif ()
529546 endif ()
530547
531548 if (CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC" OR CMAKE_Fortran_COMPILER_ID STREQUAL "PGI" )
0 commit comments