[Openmp-commits] [PATCH] D102229: [libomptarget][nfc] Add hook to easily disable building amdgcn bclib

Jon Chesterfield via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue May 11 04:15:12 PDT 2021


JonChesterfield created this revision.
JonChesterfield added reviewers: protze.joachim, weiwang, jdoerfert, tianshilei1992.
Herald added subscribers: mgorny, jvesely.
JonChesterfield requested review of this revision.
Herald added a project: OpenMP.
Herald added a subscriber: openmp-commits.

[libomptarget][nfc] Add hook to easily disable building amdgcn bclib

This is useful when building LLVM with a toolchain that can't emit code
for amdgcn, e.g. because it overrides the include search path with headers
from another architecture, or the clang compiler is missing builtins.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102229

Files:
  openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt


Index: openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
===================================================================
--- openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
+++ openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
@@ -6,10 +6,18 @@
 #
 ##===----------------------------------------------------------------------===##
 #
-# Build the AMDGCN Device RTL if the ROCM tools are available
+# Build the AMDGCN Device RTL bitcode library using clang -ffreestanding
 #
 ##===----------------------------------------------------------------------===##
 
+set(LIBOMPTARGET_BUILD_AMDGCN_BCLIB TRUE CACHE BOOL
+  "Can be set to false to disable building this library.")
+
+if (NOT LIBOMPTARGET_BUILD_AMDGCN_BCLIB)
+  libomptarget_say("Not building AMDGCN device RTL: Disabled by LIBOMPTARGET_BUILD_AMDGCN_BCLIB")
+  return()
+endif()
+
 # Copied from nvptx CMakeLists
 if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64")
   set(aux_triple x86_64-unknown-linux-gnu)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102229.344352.patch
Type: text/x-patch
Size: 977 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210511/0466697c/attachment.bin>


More information about the Openmp-commits mailing list