[PATCH] D156071: [HIP] Update compile options

Yaxun Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 23 20:57:20 PDT 2023


yaxunl created this revision.
yaxunl added a reviewer: tra.
Herald added a subscriber: tpr.
Herald added a project: All.
yaxunl requested review of this revision.

Use `--rocm-path` to specify ROCM path. Update AMDGPU archs. Remove some outdated options.


Repository:
  rT test-suite

https://reviews.llvm.org/D156071

Files:
  External/HIP/CMakeLists.txt


Index: External/HIP/CMakeLists.txt
===================================================================
--- External/HIP/CMakeLists.txt
+++ External/HIP/CMakeLists.txt
@@ -50,9 +50,6 @@
     get_version(RocmVersion ${RocmDir})
     message(STATUS "Found ROCm ${RocmVersion}")
     list(APPEND ROCM_PATHS ${RocmDir})
-    add_library(amdhip64-${RocmVersion} SHARED IMPORTED)
-    set_property(TARGET amdhip64-${RocmVersion} PROPERTY IMPORTED_LOCATION
-      ${RocmDir}/lib/libamdhip64.so)
   endforeach(RocmDir)
 
   if(NOT ROCM_PATHS)
@@ -67,17 +64,15 @@
     COMMENT "Run all simple HIP tests")
 
   if(NOT AMDGPU_ARCHS)
-    list(APPEND AMDGPU_ARCHS "gfx906;gfx908")
+    list(APPEND AMDGPU_ARCHS "gfx906;gfx90a;gfx1030;gfx1100")
   endif()
 
   foreach(_RocmPath ${ROCM_PATHS})
     get_version(_RocmVersion ${_RocmPath})
     set(_HIP_Suffix "hip-${_RocmVersion}")
     # Set up HIP test flags
-    set(_HIP_CPPFLAGS -D__HIP_ROCclr__ -xhip --hip-device-lib-path=${_RocmPath}/amdgcn/bitcode
-                      -I${_RocmPath}/include)
-    set(_HIP_LDFLAGS -L${_RocmPath}/lib -lamdhip64)
-    set(_HIP_Libs amdhip64-${RocmVersion})
+    set(_HIP_CPPFLAGS --rocm-path=${_RocmPath})
+    set(_HIP_LDFLAGS --rocm-path=${_RocmPath} --hip-link -rtlib=compiler-rt -frtlib-add-rpath)
 
     # Unset these for each iteration of rocm path.
     set(_ArchFlags)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156071.543360.patch
Type: text/x-patch
Size: 1357 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230724/51f0f454/attachment.bin>


More information about the llvm-commits mailing list