[Openmp-commits] [openmp] b917a1d - [OpenMP] Change AMDGCN to AMDGPU in the Cmake Module

via Openmp-commits openmp-commits at lists.llvm.org
Tue Jul 20 09:53:11 PDT 2021


Author: Joseph Huber
Date: 2021-07-20T12:52:53-04:00
New Revision: b917a1d713380ac83b13063e697ff6c65936ac15

URL: https://github.com/llvm/llvm-project/commit/b917a1d713380ac83b13063e697ff6c65936ac15
DIFF: https://github.com/llvm/llvm-project/commit/b917a1d713380ac83b13063e697ff6c65936ac15.diff

LOG: [OpenMP] Change AMDGCN to AMDGPU in the Cmake Module

Summary:
Change the name for targeting AMD offloading.

Added: 
    

Modified: 
    openmp/docs/SupportAndFAQ.rst
    openmp/tools/Modules/FindOpenMPTarget.cmake
    openmp/tools/Modules/README.rst

Removed: 
    


################################################################################
diff  --git a/openmp/docs/SupportAndFAQ.rst b/openmp/docs/SupportAndFAQ.rst
index e693f1e31ec13..17ffae0440e9d 100644
--- a/openmp/docs/SupportAndFAQ.rst
+++ b/openmp/docs/SupportAndFAQ.rst
@@ -240,7 +240,7 @@ offloading provided by LLVM. It will attempt to find OpenMP target offloading
 support for your compiler. The flags necessary for OpenMP target offloading will
 be loaded into the ``OpenMPTarget::OpenMPTarget_<device>`` target or the
 ``OpenMPTarget_<device>_FLAGS`` variable if successful. Currently supported
-devices are ``AMDGCN`` and ``NVPTX``. 
+devices are ``AMDGPU`` and ``NVPTX``. 
 
 To use this module, simply add the path to CMake's current module path and call
 ``find_package``. The module will be installed with your OpenMP installation by

diff  --git a/openmp/tools/Modules/FindOpenMPTarget.cmake b/openmp/tools/Modules/FindOpenMPTarget.cmake
index a8a666512fab6..3591a49f685b1 100644
--- a/openmp/tools/Modules/FindOpenMPTarget.cmake
+++ b/openmp/tools/Modules/FindOpenMPTarget.cmake
@@ -27,7 +27,7 @@ already. It does not need to be included separately to get full OpenMP support.
 Variables
 ^^^^^^^^^
 
-The module exposes the components ``NVPTX`` and ``AMDGCN``.  Each of these
+The module exposes the components ``NVPTX`` and ``AMDGPU``.  Each of these
 controls the various offloading targets to search OpenMP target offloasing
 support for.
 
@@ -38,7 +38,7 @@ Depending on the enabled components the following variables will be set:
   targets have been found.
 
 This module will set the following variables per language in your
-project, where ``<device>`` is one of NVPTX or AMDGCN
+project, where ``<device>`` is one of NVPTX or AMDGPU
 
 ``OpenMPTarget_<device>_FOUND``
   Variable indicating if OpenMP support for the ``<device>`` was detected.
@@ -62,7 +62,7 @@ be used to override the standard flag searching for a given compiler.
 
 ``OpenMPTarget_<device>_ARCH``
   Sets the architecture of ``<device>`` to compile for. Such as `sm_70` for NVPTX
-  or `gfx908` for AMDGCN. 
+  or `gfx908` for AMDGPU. 
 
 ``OpenMPTarget_<device>_DEVICE``
   Sets the name of the device to offload to.
@@ -124,7 +124,7 @@ function(_OPENMP_TARGET_DEVICE_CANDIDATES LANG DEVICE)
       if(DEFINED OMPTarget_DEVICE_${CMAKE_${LANG}_COMPILER_ID})
         set(OpenMPTarget_DEVICE_CANDIDATES "${OMPTarget_DEVICE_${CMAKE_${LANG}_COMPILER_ID}}")
       endif()
-    elseif("${DEVICE}" STREQUAL "AMDGCN")
+    elseif("${DEVICE}" STREQUAL "AMDGPU")
       set(OMPTarget_DEVICE_Clang "amdgcn-amd-amdhsa")
       set(OMPTarget_DEVICE_GNU "hsa")
 
@@ -227,7 +227,7 @@ foreach(LANG IN ITEMS C CXX)
   set(OpenMP_${LANG}_VERSION ${OpenMP_${LANG}_VERSION}
     CACHE STRING "OpenMP Version" FORCE)
   mark_as_advanced(OpenMP_${LANG}_VERSION)
-  foreach(DEVICE IN ITEMS NVPTX AMDGCN)
+  foreach(DEVICE IN ITEMS NVPTX AMDGPU)
     if(CMAKE_${LANG}_COMPILER_LOADED)
       if(NOT DEFINED OpenMPTarget_${LANG}_FLAGS OR NOT DEFINED OpenMPTarget_${LANG}_DEVICE)
         _OPENMP_TARGET_DEVICE_GET_FLAGS(${LANG} ${DEVICE}
@@ -242,9 +242,9 @@ foreach(LANG IN ITEMS C CXX)
             CACHE STRING "${DEVICE} target compile flags for OpenMP target offloading" FORCE)
         set(OpenMPTarget_${DEVICE}_ARCH ${_OpenMPTarget_${DEVICE}_ARCHS}
             CACHE STRING "${DEVICE} target architecture flags for OpenMP target offloading" FORCE)
-        set(OpenMPTarget_${DEVICE}_LIBS ${OpenMPTarget_${DEVICE}_LIBS_WORK}
+        set(OpenMPTarget_${DEVICE}_LIBRARIES ${OpenMPTarget_${DEVICE}_LIBS_WORK}
             CACHE STRING "${DEVICE} target libraries for OpenMP target offloading" FORCE)
-        mark_as_advanced(OpenMPTarget_${DEVICE}_FLAGS OpenMPTarget_${DEVICE}_ARCH OpenMPTarget_${DEVICE}_LIBS)
+        mark_as_advanced(OpenMPTarget_${DEVICE}_FLAGS OpenMPTarget_${DEVICE}_ARCH OpenMPTarget_${DEVICE}_LIBRARIES)
       endif()
     endif()
   endforeach()
@@ -301,7 +301,7 @@ foreach(LANG IN ITEMS C CXX)
           INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${OpenMP_${LANG}_INCLUDE_DIRS}>")
         set_property(TARGET OpenMPTarget::OpenMPTarget_${DEVICE} PROPERTY
           INTERFACE_LINK_LIBRARIES 
-          "${OpenMPTarget_${DEVICE}_LIBS}"
+          "${OpenMPTarget_${DEVICE}_LIBRARIES}"
           "${OpenMP_${LANG}_LIBRARIES}")
         # The offloading flags must also be passed during the linking phase so
         # the compiler can pass the binary to the correct toolchain.

diff  --git a/openmp/tools/Modules/README.rst b/openmp/tools/Modules/README.rst
index 166118fb363f0..24da06b93a7ee 100644
--- a/openmp/tools/Modules/README.rst
+++ b/openmp/tools/Modules/README.rst
@@ -16,7 +16,7 @@ device. The module will attempt to compile a test program using known compiler
 flags for each requested architecture. If successful, the flags required for
 offloading will be loaded into the ``OpenMPTarget::OpenMPTarget_<device>``
 target or the ``OpenMPTarget_<device>_FLAGS`` variable. Currently supported target
-devices are ``NVPTX`` and ``AMDGCN``. This module is still under development so
+devices are ``NVPTX`` and ``AMDGPU``. This module is still under development so
 some features may be missing.
 
 To use this module, simply add the path to CMake's current module path and call


        


More information about the Openmp-commits mailing list