[Openmp-commits] [PATCH] D119747: [Libomptarget][NFC] Remove constexpr to hide warnings

Joseph Huber via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Feb 14 11:05:11 PST 2022


jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, tianshilei1992, JonChesterfield.
jhuber6 requested review of this revision.
Herald added a project: OpenMP.
Herald added a subscriber: openmp-commits.

Currently whenever we compile the device runtime we get the following
'Mapping.cpp:32:32: warning: inline function '_OMP::impl::getGridValue'
is not defined [-Wundefined-inline]' warning. This can be silenced by
removing the constexpr attribute for this function. Doing this doesn't
change the generated bitcode at all but prevents the screen from getting
filled with warnings whenver we build the runtime.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119747

Files:
  openmp/libomptarget/DeviceRTL/src/Mapping.cpp


Index: openmp/libomptarget/DeviceRTL/src/Mapping.cpp
===================================================================
--- openmp/libomptarget/DeviceRTL/src/Mapping.cpp
+++ openmp/libomptarget/DeviceRTL/src/Mapping.cpp
@@ -29,7 +29,7 @@
 ///{
 #pragma omp begin declare variant match(device = {arch(amdgcn)})
 
-constexpr const llvm::omp::GV &getGridValue() {
+static const llvm::omp::GV &getGridValue() {
   return llvm::omp::getAMDGPUGridValues<__AMDGCN_WAVEFRONT_SIZE>();
 }
 
@@ -104,7 +104,7 @@
   return __nvvm_read_ptx_sreg_ntid_x();
 }
 
-constexpr const llvm::omp::GV &getGridValue() {
+static const llvm::omp::GV &getGridValue() {
   return llvm::omp::NVPTXGridValues;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119747.408516.patch
Type: text/x-patch
Size: 686 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220214/4797f0de/attachment.bin>


More information about the Openmp-commits mailing list