[Openmp-commits] [PATCH] D148870: [OpenMP] Enable the IDE support for the device runtime

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Apr 21 10:38:38 PDT 2023


tianshilei1992 updated this revision to Diff 515826.
tianshilei1992 added a comment.

remove custom variable


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148870/new/

https://reviews.llvm.org/D148870

Files:
  openmp/libomptarget/DeviceRTL/CMakeLists.txt


Index: openmp/libomptarget/DeviceRTL/CMakeLists.txt
===================================================================
--- openmp/libomptarget/DeviceRTL/CMakeLists.txt
+++ openmp/libomptarget/DeviceRTL/CMakeLists.txt
@@ -268,6 +268,24 @@
 
   set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${output_name})
   set_property(TARGET omptarget.devicertl.all_objs APPEND PROPERTY IMPORTED_OBJECTS ${output_name})
+
+  if (CMAKE_EXPORT_COMPILE_COMMANDS)
+    set(ide_target_name omptarget-ide-${target_name}-${target_cpu})
+    add_library(${ide_target_name} STATIC EXCLUDE_FROM_ALL ${src_files})
+    target_compile_options(${ide_target_name} PRIVATE
+      -fopenmp --offload-arch=${target_cpu} -fopenmp-cuda-mode
+      -mllvm -openmp-opt-disable
+      -foffload-lto -fvisibility=hidden --offload-device-only
+      -nocudalib -nogpulib -nostdinc -Wno-unknown-cuda-version
+    )
+    target_compile_definitions(${ide_target_name} PRIVATE SHARED_SCRATCHPAD_SIZE=512)
+    target_include_directories(${ide_target_name} PRIVATE
+      ${include_directory}
+      ${devicertl_base_directory}/../include
+      ${LIBOMPTARGET_LLVM_INCLUDE_DIRS}
+    )
+    install(TARGETS ${ide_target_name} EXCLUDE_FROM_ALL)
+  endif()
 endfunction()
 
 # Generate a Bitcode library for all the gpu architectures the user requested.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148870.515826.patch
Type: text/x-patch
Size: 1332 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20230421/440bae47/attachment-0001.bin>


More information about the Openmp-commits mailing list