Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpenMP][NFC] Move debug declares into CMAKE out of "private.h" #73732

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

jdoerfert
Copy link
Member

Everywhere else we define this in the CMakeLists.txt and "private.h" needs to go. Rename "Libomptarget" into "omptarget", no benefit from "lib".

Everywhere else we define this in the CMakeLists.txt and "private.h"
needs to go. Rename "Libomptarget" into "omptarget", no benefit from
"lib".
@llvmbot
Copy link
Collaborator

llvmbot commented Nov 29, 2023

@llvm/pr-subscribers-openmp

Author: Johannes Doerfert (jdoerfert)

Changes

Everywhere else we define this in the CMakeLists.txt and "private.h" needs to go. Rename "Libomptarget" into "omptarget", no benefit from "lib".


Patch is 26.62 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/73732.diff

24 Files Affected:

  • (modified) openmp/libomptarget/src/CMakeLists.txt (+6)
  • (modified) openmp/libomptarget/src/private.h (-5)
  • (modified) openmp/libomptarget/test/env/omp_target_debug.c (+2-2)
  • (modified) openmp/libomptarget/test/mapping/alloc_fail.c (+3-3)
  • (modified) openmp/libomptarget/test/mapping/ompx_hold/omp_target_disassociate_ptr.c (+1-1)
  • (modified) openmp/libomptarget/test/mapping/padding_not_mapped.c (+3-3)
  • (modified) openmp/libomptarget/test/mapping/present/target.c (+6-6)
  • (modified) openmp/libomptarget/test/mapping/present/target_array_extension.c (+7-7)
  • (modified) openmp/libomptarget/test/mapping/present/target_data.c (+3-3)
  • (modified) openmp/libomptarget/test/mapping/present/target_data_array_extension.c (+5-5)
  • (modified) openmp/libomptarget/test/mapping/present/target_data_at_exit.c (+2-2)
  • (modified) openmp/libomptarget/test/mapping/present/target_enter_data.c (+4-4)
  • (modified) openmp/libomptarget/test/mapping/present/target_exit_data_delete.c (+3-3)
  • (modified) openmp/libomptarget/test/mapping/present/target_exit_data_release.c (+3-3)
  • (modified) openmp/libomptarget/test/mapping/present/target_update.c (+3-3)
  • (modified) openmp/libomptarget/test/mapping/present/target_update_array_extension.c (+3-3)
  • (modified) openmp/libomptarget/test/mapping/present/unified_shared_memory.c (+2-2)
  • (modified) openmp/libomptarget/test/mapping/present/zero_length_array_section.c (+6-6)
  • (modified) openmp/libomptarget/test/mapping/present/zero_length_array_section_exit.c (+3-3)
  • (modified) openmp/libomptarget/test/mapping/target_data_array_extension_at_exit.c (+2-2)
  • (modified) openmp/libomptarget/test/mapping/target_update_array_extension.c (+2-2)
  • (modified) openmp/libomptarget/test/mapping/target_wrong_use_device_addr.c (+1-1)
  • (modified) openmp/libomptarget/test/offloading/info.c (+1-1)
  • (modified) openmp/libomptarget/test/offloading/mandatory_but_no_devices.c (+1-1)
diff --git a/openmp/libomptarget/src/CMakeLists.txt b/openmp/libomptarget/src/CMakeLists.txt
index 4ef0b8124acdb43..a83965f59b3eb04 100644
--- a/openmp/libomptarget/src/CMakeLists.txt
+++ b/openmp/libomptarget/src/CMakeLists.txt
@@ -44,6 +44,12 @@ if (LIBOMP_HAVE_VERSION_SCRIPT_FLAG)
     "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
 endif()
 
+# Define the TARGET_NAME and DEBUG_PREFIX.
+target_compile_definitions(omptarget PRIVATE
+  TARGET_NAME=omptarget
+  DEBUG_PREFIX="omptarget"
+)
+
 # libomptarget.so needs to be aware of where the plugins live as they
 # are now separated in the build directory.
 set_target_properties(omptarget PROPERTIES
diff --git a/openmp/libomptarget/src/private.h b/openmp/libomptarget/src/private.h
index f082f6e3b9fc83a..eb54b1a635418a5 100644
--- a/openmp/libomptarget/src/private.h
+++ b/openmp/libomptarget/src/private.h
@@ -257,11 +257,6 @@ struct TargetMemsetArgsTy {
 }
 #endif
 
-#define TARGET_NAME Libomptarget
-#ifndef DEBUG_PREFIX
-#define DEBUG_PREFIX GETNAME(TARGET_NAME)
-#endif
-
 ////////////////////////////////////////////////////////////////////////////////
 /// dump a table of all the host-target pointer pairs on failure
 static inline void dumpTargetPointerMappings(const ident_t *Loc,
diff --git a/openmp/libomptarget/test/env/omp_target_debug.c b/openmp/libomptarget/test/env/omp_target_debug.c
index 76d182d2481c0d0..ec81873a091f507 100644
--- a/openmp/libomptarget/test/env/omp_target_debug.c
+++ b/openmp/libomptarget/test/env/omp_target_debug.c
@@ -8,6 +8,6 @@ int main(void) {
   return 0;
 }
 
-// DEBUG: Libomptarget
-// NDEBUG-NOT: Libomptarget
+// DEBUG: omptarget
+// NDEBUG-NOT: omptarget
 // NDEBUG-NOT: Target
diff --git a/openmp/libomptarget/test/mapping/alloc_fail.c b/openmp/libomptarget/test/mapping/alloc_fail.c
index d764087723baa42..c4ae70fc730c2d8 100644
--- a/openmp/libomptarget/test/mapping/alloc_fail.c
+++ b/openmp/libomptarget/test/mapping/alloc_fail.c
@@ -2,9 +2,9 @@
 // RUN: %libomptarget-run-fail-generic 2>&1 \
 // RUN: | %fcheck-generic
 
-// CHECK: Libomptarget message: explicit extension not allowed: host address specified is 0x{{.*}} (8 bytes), but device allocation maps to host at 0x{{.*}} (8 bytes)
-// CHECK: Libomptarget error: Call to getTargetPointer returned null pointer (device failure or illegal mapping).
-// CHECK: Libomptarget fatal error 1: failure of target construct while offloading is mandatory
+// CHECK: omptarget message: explicit extension not allowed: host address specified is 0x{{.*}} (8 bytes), but device allocation maps to host at 0x{{.*}} (8 bytes)
+// CHECK: omptarget error: Call to getTargetPointer returned null pointer (device failure or illegal mapping).
+// CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
 
 int main() {
   int arr[4] = {0, 1, 2, 3};
diff --git a/openmp/libomptarget/test/mapping/ompx_hold/omp_target_disassociate_ptr.c b/openmp/libomptarget/test/mapping/ompx_hold/omp_target_disassociate_ptr.c
index ea4a1ffc979a5ea..302bf4ffd0a5f44 100644
--- a/openmp/libomptarget/test/mapping/ompx_hold/omp_target_disassociate_ptr.c
+++ b/openmp/libomptarget/test/mapping/ompx_hold/omp_target_disassociate_ptr.c
@@ -56,7 +56,7 @@ int main(int argc, char *argv[]) {
 #pragma omp target data map(ompx_hold, alloc : X)
 #endif
   {
-    //      CHECK: Libomptarget error: Trying to disassociate a pointer with a
+    //      CHECK: omptarget error: Trying to disassociate a pointer with a
     // CHECK-SAME: non-zero hold reference count
     // CHECK-NEXT: omp_target_disassociate_ptr failed
     if (omp_target_disassociate_ptr(&X, DevNum)) {
diff --git a/openmp/libomptarget/test/mapping/padding_not_mapped.c b/openmp/libomptarget/test/mapping/padding_not_mapped.c
index 9d5ef212ffc2463..3ee70ab64048d4c 100644
--- a/openmp/libomptarget/test/mapping/padding_not_mapped.c
+++ b/openmp/libomptarget/test/mapping/padding_not_mapped.c
@@ -34,9 +34,9 @@ int main() {
   #pragma omp target update from(s.x) // should have no effect
   fprintf(stderr, "s.x = %d\n", s.x);
 
-  // CHECK: Libomptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
-  // CHECK: Libomptarget error: Call to getTargetPointer returned null pointer ('present' map type modifier).
-  // CHECK: Libomptarget fatal error 1: failure of target construct while offloading is mandatory
+  // CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
+  // CHECK: omptarget error: Call to getTargetPointer returned null pointer ('present' map type modifier).
+  // CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
   #pragma omp target enter data map(present, alloc: s.x)
 
   return 0;
diff --git a/openmp/libomptarget/test/mapping/present/target.c b/openmp/libomptarget/test/mapping/present/target.c
index 1bf724e308e5253..4344c42c808ffe8 100644
--- a/openmp/libomptarget/test/mapping/present/target.c
+++ b/openmp/libomptarget/test/mapping/present/target.c
@@ -10,7 +10,7 @@ int main() {
   // CHECK: addr=0x[[#%x,HOST_ADDR:]], size=[[#%u,SIZE:]]
   fprintf(stderr, "addr=%p, size=%ld\n", &i, sizeof i);
 
-  // CHECK-NOT: Libomptarget
+  // CHECK-NOT: omptarget
 #pragma omp target data map(alloc : i)
 #pragma omp target map(present, alloc : i)
   ;
@@ -18,11 +18,11 @@ int main() {
   // CHECK: i is present
   fprintf(stderr, "i is present\n");
 
-  // CHECK: Libomptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
-  // CHECK: Libomptarget error: Call to getTargetPointer returned null pointer ('present' map type modifier).
-  // CHECK: Libomptarget error: Call to targetDataBegin failed, abort target.
-  // CHECK: Libomptarget error: Failed to process data before launching the kernel.
-  // CHECK: Libomptarget fatal error 1: failure of target construct while offloading is mandatory
+  // CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
+  // CHECK: omptarget error: Call to getTargetPointer returned null pointer ('present' map type modifier).
+  // CHECK: omptarget error: Call to targetDataBegin failed, abort target.
+  // CHECK: omptarget error: Failed to process data before launching the kernel.
+  // CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
 #pragma omp target map(present, alloc : i)
   ;
 
diff --git a/openmp/libomptarget/test/mapping/present/target_array_extension.c b/openmp/libomptarget/test/mapping/present/target_array_extension.c
index 063eafd8307f016..873b2b36170ee88 100644
--- a/openmp/libomptarget/test/mapping/present/target_array_extension.c
+++ b/openmp/libomptarget/test/mapping/present/target_array_extension.c
@@ -60,7 +60,7 @@ int main() {
   fprintf(stderr, "addr=%p, size=%ld\n", &arr[LARGE_BEG],
           LARGE_SIZE * sizeof arr[0]);
 
-  // CHECK-NOT: Libomptarget
+  // CHECK-NOT: omptarget
 #pragma omp target data map(alloc : arr[LARGE])
   {
 #pragma omp target map(present, tofrom : arr[SMALL])
@@ -70,12 +70,12 @@ int main() {
   // CHECK: arr is present
   fprintf(stderr, "arr is present\n");
 
-  // CHECK: Libomptarget message: explicit extension not allowed: host address specified is 0x{{0*}}[[#LARGE_ADDR]] ([[#LARGE_BYTES]] bytes), but device allocation maps to host at 0x{{0*}}[[#SMALL_ADDR]] ([[#SMALL_BYTES]] bytes)
-  // CHECK: Libomptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#LARGE_ADDR]] ([[#LARGE_BYTES]] bytes)
-  // CHECK: Libomptarget error: Call to getTargetPointer returned null pointer ('present' map type modifier).
-  // CHECK: Libomptarget error: Call to targetDataBegin failed, abort target.
-  // CHECK: Libomptarget error: Failed to process data before launching the kernel.
-  // CHECK: Libomptarget fatal error 1: failure of target construct while offloading is mandatory
+  // CHECK: omptarget message: explicit extension not allowed: host address specified is 0x{{0*}}[[#LARGE_ADDR]] ([[#LARGE_BYTES]] bytes), but device allocation maps to host at 0x{{0*}}[[#SMALL_ADDR]] ([[#SMALL_BYTES]] bytes)
+  // CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#LARGE_ADDR]] ([[#LARGE_BYTES]] bytes)
+  // CHECK: omptarget error: Call to getTargetPointer returned null pointer ('present' map type modifier).
+  // CHECK: omptarget error: Call to targetDataBegin failed, abort target.
+  // CHECK: omptarget error: Failed to process data before launching the kernel.
+  // CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
 #pragma omp target data map(alloc : arr[SMALL])
   {
 #pragma omp target map(present, tofrom : arr[LARGE])
diff --git a/openmp/libomptarget/test/mapping/present/target_data.c b/openmp/libomptarget/test/mapping/present/target_data.c
index 7acc850d349b88b..f894283a0c99c8c 100644
--- a/openmp/libomptarget/test/mapping/present/target_data.c
+++ b/openmp/libomptarget/test/mapping/present/target_data.c
@@ -10,7 +10,7 @@ int main() {
   // CHECK: addr=0x[[#%x,HOST_ADDR:]], size=[[#%u,SIZE:]]
   fprintf(stderr, "addr=%p, size=%ld\n", &i, sizeof i);
 
-  // CHECK-NOT: Libomptarget
+  // CHECK-NOT: omptarget
 #pragma omp target data map(alloc : i)
 #pragma omp target data map(present, alloc : i)
   ;
@@ -18,8 +18,8 @@ int main() {
   // CHECK: i is present
   fprintf(stderr, "i is present\n");
 
-  // CHECK: Libomptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
-  // CHECK: Libomptarget fatal error 1: failure of target construct while offloading is mandatory
+  // CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
+  // CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
 #pragma omp target data map(present, alloc : i)
   ;
 
diff --git a/openmp/libomptarget/test/mapping/present/target_data_array_extension.c b/openmp/libomptarget/test/mapping/present/target_data_array_extension.c
index 783ab4a9a56a7c0..794543a246040b3 100644
--- a/openmp/libomptarget/test/mapping/present/target_data_array_extension.c
+++ b/openmp/libomptarget/test/mapping/present/target_data_array_extension.c
@@ -60,7 +60,7 @@ int main() {
   fprintf(stderr, "addr=%p, size=%ld\n", &arr[LARGE_BEG],
           LARGE_SIZE * sizeof arr[0]);
 
-  // CHECK-NOT: Libomptarget
+  // CHECK-NOT: omptarget
 #pragma omp target data map(alloc : arr[LARGE])
   {
 #pragma omp target data map(present, tofrom : arr[SMALL])
@@ -70,10 +70,10 @@ int main() {
   // CHECK: arr is present
   fprintf(stderr, "arr is present\n");
 
-  // CHECK: Libomptarget message: explicit extension not allowed: host address specified is 0x{{0*}}[[#LARGE_ADDR]] ([[#LARGE_BYTES]] bytes), but device allocation maps to host at 0x{{0*}}[[#SMALL_ADDR]] ([[#SMALL_BYTES]] bytes)
-  // CHECK: Libomptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#LARGE_ADDR]] ([[#LARGE_BYTES]] bytes)
-  // CHECK: Libomptarget error: Call to getTargetPointer returned null pointer ('present' map type modifier).
-  // CHECK: Libomptarget fatal error 1: failure of target construct while offloading is mandatory
+  // CHECK: omptarget message: explicit extension not allowed: host address specified is 0x{{0*}}[[#LARGE_ADDR]] ([[#LARGE_BYTES]] bytes), but device allocation maps to host at 0x{{0*}}[[#SMALL_ADDR]] ([[#SMALL_BYTES]] bytes)
+  // CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#LARGE_ADDR]] ([[#LARGE_BYTES]] bytes)
+  // CHECK: omptarget error: Call to getTargetPointer returned null pointer ('present' map type modifier).
+  // CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
 #pragma omp target data map(alloc : arr[SMALL])
   {
 #pragma omp target data map(present, tofrom : arr[LARGE])
diff --git a/openmp/libomptarget/test/mapping/present/target_data_at_exit.c b/openmp/libomptarget/test/mapping/present/target_data_at_exit.c
index f4b0af8c3e6749e..c1fbbae6f764d69 100644
--- a/openmp/libomptarget/test/mapping/present/target_data_at_exit.c
+++ b/openmp/libomptarget/test/mapping/present/target_data_at_exit.c
@@ -16,9 +16,9 @@ int main() {
 #pragma omp target exit data map(delete : i)
   }
 
-  // CHECK-NOT: Libomptarget
+  // CHECK-NOT: omptarget
   // CHECK: success
-  // CHECK-NOT: Libomptarget
+  // CHECK-NOT: omptarget
   fprintf(stderr, "success\n");
 
   return 0;
diff --git a/openmp/libomptarget/test/mapping/present/target_enter_data.c b/openmp/libomptarget/test/mapping/present/target_enter_data.c
index 3695fe7ceb4ec39..871a05290ed6548 100644
--- a/openmp/libomptarget/test/mapping/present/target_enter_data.c
+++ b/openmp/libomptarget/test/mapping/present/target_enter_data.c
@@ -10,7 +10,7 @@ int main() {
   // CHECK: addr=0x[[#%x,HOST_ADDR:]], size=[[#%u,SIZE:]]
   fprintf(stderr, "addr=%p, size=%ld\n", &i, sizeof i);
 
-  // CHECK-NOT: Libomptarget
+  // CHECK-NOT: omptarget
 #pragma omp target enter data map(alloc : i)
 #pragma omp target enter data map(present, alloc : i)
 #pragma omp target exit data map(delete : i)
@@ -18,9 +18,9 @@ int main() {
   // CHECK: i is present
   fprintf(stderr, "i is present\n");
 
-  // CHECK: Libomptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
-  // CHECK: Libomptarget error: Call to getTargetPointer returned null pointer ('present' map type modifier).
-  // CHECK: Libomptarget fatal error 1: failure of target construct while offloading is mandatory
+  // CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
+  // CHECK: omptarget error: Call to getTargetPointer returned null pointer ('present' map type modifier).
+  // CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
 #pragma omp target enter data map(present, alloc : i)
 
   // CHECK-NOT: i is present
diff --git a/openmp/libomptarget/test/mapping/present/target_exit_data_delete.c b/openmp/libomptarget/test/mapping/present/target_exit_data_delete.c
index 28f3cf1872ded70..0fb812b2998f93e 100644
--- a/openmp/libomptarget/test/mapping/present/target_exit_data_delete.c
+++ b/openmp/libomptarget/test/mapping/present/target_exit_data_delete.c
@@ -10,15 +10,15 @@ int main() {
   // CHECK: addr=0x[[#%x,HOST_ADDR:]], size=[[#%u,SIZE:]]
   fprintf(stderr, "addr=%p, size=%ld\n", &i, sizeof i);
 
-// CHECK-NOT: Libomptarget
+// CHECK-NOT: omptarget
 #pragma omp target enter data map(alloc : i)
 #pragma omp target exit data map(present, delete : i)
 
   // CHECK: i was present
   fprintf(stderr, "i was present\n");
 
-// CHECK: Libomptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
-// CHECK: Libomptarget fatal error 1: failure of target construct while offloading is mandatory
+// CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
+// CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
 #pragma omp target exit data map(present, delete : i)
 
   // CHECK-NOT: i was present
diff --git a/openmp/libomptarget/test/mapping/present/target_exit_data_release.c b/openmp/libomptarget/test/mapping/present/target_exit_data_release.c
index e03a0ca2e1b4dee..14be22faba6210a 100644
--- a/openmp/libomptarget/test/mapping/present/target_exit_data_release.c
+++ b/openmp/libomptarget/test/mapping/present/target_exit_data_release.c
@@ -10,15 +10,15 @@ int main() {
   // CHECK: addr=0x[[#%x,HOST_ADDR:]], size=[[#%u,SIZE:]]
   fprintf(stderr, "addr=%p, size=%ld\n", &i, sizeof i);
 
-// CHECK-NOT: Libomptarget
+// CHECK-NOT: omptarget
 #pragma omp target enter data map(alloc : i)
 #pragma omp target exit data map(present, release : i)
 
   // CHECK: i was present
   fprintf(stderr, "i was present\n");
 
-// CHECK: Libomptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
-// CHECK: Libomptarget fatal error 1: failure of target construct while offloading is mandatory
+// CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
+// CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
 #pragma omp target exit data map(present, release : i)
 
   // CHECK-NOT: i was present
diff --git a/openmp/libomptarget/test/mapping/present/target_update.c b/openmp/libomptarget/test/mapping/present/target_update.c
index 75f4bc60dcc8a5b..9f6783b6ef69391 100644
--- a/openmp/libomptarget/test/mapping/present/target_update.c
+++ b/openmp/libomptarget/test/mapping/present/target_update.c
@@ -24,7 +24,7 @@ int main() {
   // CHECK: addr=0x[[#%x,HOST_ADDR:]], size=[[#%u,SIZE:]]
   fprintf(stderr, "addr=%p, size=%ld\n", &i, sizeof i);
 
-  // CHECK-NOT: Libomptarget
+  // CHECK-NOT: omptarget
 #pragma omp target enter data map(alloc : i)
 #pragma omp target update CLAUSE(present : i)
 #pragma omp target exit data map(delete : i)
@@ -32,8 +32,8 @@ int main() {
   // CHECK: i is present
   fprintf(stderr, "i is present\n");
 
-  // CHECK: Libomptarget message: device mapping required by 'present' motion modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
-  // CHECK: Libomptarget fatal error 1: failure of target construct while offloading is mandatory
+  // CHECK: omptarget message: device mapping required by 'present' motion modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
+  // CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
 #pragma omp target update CLAUSE(present : i)
 
   // CHECK-NOT: i is present
diff --git a/openmp/libomptarget/test/mapping/present/target_update_array_extension.c b/openmp/libomptarget/test/mapping/present/target_update_array_extension.c
index 45895044e122a86..11ad4a8d4938210 100644
--- a/openmp/libomptarget/test/mapping/present/target_update_array_extension.c
+++ b/openmp/libomptarget/test/mapping/present/target_update_array_extension.c
@@ -57,7 +57,7 @@ int main() {
   // CHECK: addr=0x[[#%x,HOST_ADDR:]], size=[[#%u,SIZE:]]
   fprintf(stderr, "addr=%p, size=%ld\n", arr, sizeof arr);
 
-  // CHECK-NOT: Libomptarget
+  // CHECK-NOT: omptarget
 #pragma omp target data map(alloc : arr[LARGE])
   {
 #pragma omp target update CLAUSE(present : arr[SMALL])
@@ -66,8 +66,8 @@ int main() {
   // CHECK: arr is present
   fprintf(stderr, "arr is present\n");
 
-  // CHECK: Libomptarget message: device mapping required by 'present' motion modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
-  // CHECK: Libomptarget fatal error 1: failure of target construct while offloading is mandatory
+  // CHECK: omptarget message: device mapping required by 'present' motion modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
+  // CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
 #pragma omp target data map(alloc : arr[SMALL])
   {
 #pragma omp target update CLAUSE(present : arr[LARGE])
diff --git a/openmp/libomptarget/test/mapping/present/unified_shared_memory.c b/openmp/libomptarget/test/mapping/present/unified_shared_memory.c
index f0de92f12310e56..ab6e3bd0e5fa70b 100644
--- a/openmp/libomptarget/test/mapping/present/unified_shared_memory.c
+++ b/openmp/libomptarget/test/mapping/present/unified_shared_memory.c
@@ -12,7 +12,7 @@
 int main() {
   int i;
 
-  // CHECK-NOT: Libomptarget
+  // CHECK-NOT: omptarget
 #pragma omp target data map(alloc : i)
 #pragma omp target map(present, alloc : i)
   ;
@@ -20,7 +20,...
[truncated]

Copy link

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 4eb421192479dbecae2621b868e55aaf6d945b02 4fb01419cefae13550b27a8e3c8080ffbb7d11f0 -- openmp/libomptarget/src/private.h openmp/libomptarget/test/env/omp_target_debug.c openmp/libomptarget/test/mapping/alloc_fail.c openmp/libomptarget/test/mapping/ompx_hold/omp_target_disassociate_ptr.c openmp/libomptarget/test/mapping/padding_not_mapped.c openmp/libomptarget/test/mapping/present/target.c openmp/libomptarget/test/mapping/present/target_array_extension.c openmp/libomptarget/test/mapping/present/target_data.c openmp/libomptarget/test/mapping/present/target_data_array_extension.c openmp/libomptarget/test/mapping/present/target_data_at_exit.c openmp/libomptarget/test/mapping/present/target_enter_data.c openmp/libomptarget/test/mapping/present/target_exit_data_delete.c openmp/libomptarget/test/mapping/present/target_exit_data_release.c openmp/libomptarget/test/mapping/present/target_update.c openmp/libomptarget/test/mapping/present/target_update_array_extension.c openmp/libomptarget/test/mapping/present/unified_shared_memory.c openmp/libomptarget/test/mapping/present/zero_length_array_section.c openmp/libomptarget/test/mapping/present/zero_length_array_section_exit.c openmp/libomptarget/test/mapping/target_data_array_extension_at_exit.c openmp/libomptarget/test/mapping/target_update_array_extension.c openmp/libomptarget/test/mapping/target_wrong_use_device_addr.c openmp/libomptarget/test/offloading/info.c openmp/libomptarget/test/offloading/mandatory_but_no_devices.c
View the diff from clang-format here.
diff --git a/openmp/libomptarget/test/mapping/alloc_fail.c b/openmp/libomptarget/test/mapping/alloc_fail.c
index c4ae70fc73..31912d4bdb 100644
--- a/openmp/libomptarget/test/mapping/alloc_fail.c
+++ b/openmp/libomptarget/test/mapping/alloc_fail.c
@@ -2,9 +2,11 @@
 // RUN: %libomptarget-run-fail-generic 2>&1 \
 // RUN: | %fcheck-generic
 
-// CHECK: omptarget message: explicit extension not allowed: host address specified is 0x{{.*}} (8 bytes), but device allocation maps to host at 0x{{.*}} (8 bytes)
-// CHECK: omptarget error: Call to getTargetPointer returned null pointer (device failure or illegal mapping).
-// CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
+// CHECK: omptarget message: explicit extension not allowed: host address
+// specified is 0x{{.*}} (8 bytes), but device allocation maps to host at
+// 0x{{.*}} (8 bytes) CHECK: omptarget error: Call to getTargetPointer returned
+// null pointer (device failure or illegal mapping). CHECK: omptarget fatal
+// error 1: failure of target construct while offloading is mandatory
 
 int main() {
   int arr[4] = {0, 1, 2, 3};
diff --git a/openmp/libomptarget/test/mapping/padding_not_mapped.c b/openmp/libomptarget/test/mapping/padding_not_mapped.c
index 3ee70ab640..88bef3b9c8 100644
--- a/openmp/libomptarget/test/mapping/padding_not_mapped.c
+++ b/openmp/libomptarget/test/mapping/padding_not_mapped.c
@@ -34,10 +34,12 @@ int main() {
   #pragma omp target update from(s.x) // should have no effect
   fprintf(stderr, "s.x = %d\n", s.x);
 
-  // CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
-  // CHECK: omptarget error: Call to getTargetPointer returned null pointer ('present' map type modifier).
-  // CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
-  #pragma omp target enter data map(present, alloc: s.x)
+// CHECK: omptarget message: device mapping required by 'present' map type
+// modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]]
+// bytes) CHECK: omptarget error: Call to getTargetPointer returned null pointer
+// ('present' map type modifier). CHECK: omptarget fatal error 1: failure of
+// target construct while offloading is mandatory
+#pragma omp target enter data map(present, alloc : s.x)
 
   return 0;
 }
diff --git a/openmp/libomptarget/test/mapping/present/target.c b/openmp/libomptarget/test/mapping/present/target.c
index 4344c42c80..e5cab61374 100644
--- a/openmp/libomptarget/test/mapping/present/target.c
+++ b/openmp/libomptarget/test/mapping/present/target.c
@@ -18,11 +18,13 @@ int main() {
   // CHECK: i is present
   fprintf(stderr, "i is present\n");
 
-  // CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
-  // CHECK: omptarget error: Call to getTargetPointer returned null pointer ('present' map type modifier).
-  // CHECK: omptarget error: Call to targetDataBegin failed, abort target.
-  // CHECK: omptarget error: Failed to process data before launching the kernel.
-  // CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
+  // CHECK: omptarget message: device mapping required by 'present' map type
+  // modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]]
+  // bytes) CHECK: omptarget error: Call to getTargetPointer returned null
+  // pointer ('present' map type modifier). CHECK: omptarget error: Call to
+  // targetDataBegin failed, abort target. CHECK: omptarget error: Failed to
+  // process data before launching the kernel. CHECK: omptarget fatal error 1:
+  // failure of target construct while offloading is mandatory
 #pragma omp target map(present, alloc : i)
   ;
 
diff --git a/openmp/libomptarget/test/mapping/present/target_array_extension.c b/openmp/libomptarget/test/mapping/present/target_array_extension.c
index 873b2b3617..3e3d991b40 100644
--- a/openmp/libomptarget/test/mapping/present/target_array_extension.c
+++ b/openmp/libomptarget/test/mapping/present/target_array_extension.c
@@ -70,12 +70,16 @@ int main() {
   // CHECK: arr is present
   fprintf(stderr, "arr is present\n");
 
-  // CHECK: omptarget message: explicit extension not allowed: host address specified is 0x{{0*}}[[#LARGE_ADDR]] ([[#LARGE_BYTES]] bytes), but device allocation maps to host at 0x{{0*}}[[#SMALL_ADDR]] ([[#SMALL_BYTES]] bytes)
-  // CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#LARGE_ADDR]] ([[#LARGE_BYTES]] bytes)
-  // CHECK: omptarget error: Call to getTargetPointer returned null pointer ('present' map type modifier).
-  // CHECK: omptarget error: Call to targetDataBegin failed, abort target.
-  // CHECK: omptarget error: Failed to process data before launching the kernel.
-  // CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
+  // CHECK: omptarget message: explicit extension not allowed: host address
+  // specified is 0x{{0*}}[[#LARGE_ADDR]] ([[#LARGE_BYTES]] bytes), but device
+  // allocation maps to host at 0x{{0*}}[[#SMALL_ADDR]] ([[#SMALL_BYTES]] bytes)
+  // CHECK: omptarget message: device mapping required by 'present' map type
+  // modifier does not exist for host address 0x{{0*}}[[#LARGE_ADDR]]
+  // ([[#LARGE_BYTES]] bytes) CHECK: omptarget error: Call to getTargetPointer
+  // returned null pointer ('present' map type modifier). CHECK: omptarget
+  // error: Call to targetDataBegin failed, abort target. CHECK: omptarget
+  // error: Failed to process data before launching the kernel. CHECK: omptarget
+  // fatal error 1: failure of target construct while offloading is mandatory
 #pragma omp target data map(alloc : arr[SMALL])
   {
 #pragma omp target map(present, tofrom : arr[LARGE])
diff --git a/openmp/libomptarget/test/mapping/present/target_data.c b/openmp/libomptarget/test/mapping/present/target_data.c
index f894283a0c..ae3b762c34 100644
--- a/openmp/libomptarget/test/mapping/present/target_data.c
+++ b/openmp/libomptarget/test/mapping/present/target_data.c
@@ -18,8 +18,10 @@ int main() {
   // CHECK: i is present
   fprintf(stderr, "i is present\n");
 
-  // CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
-  // CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
+  // CHECK: omptarget message: device mapping required by 'present' map type
+  // modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]]
+  // bytes) CHECK: omptarget fatal error 1: failure of target construct while
+  // offloading is mandatory
 #pragma omp target data map(present, alloc : i)
   ;
 
diff --git a/openmp/libomptarget/test/mapping/present/target_data_array_extension.c b/openmp/libomptarget/test/mapping/present/target_data_array_extension.c
index 794543a246..828351ef6b 100644
--- a/openmp/libomptarget/test/mapping/present/target_data_array_extension.c
+++ b/openmp/libomptarget/test/mapping/present/target_data_array_extension.c
@@ -70,10 +70,14 @@ int main() {
   // CHECK: arr is present
   fprintf(stderr, "arr is present\n");
 
-  // CHECK: omptarget message: explicit extension not allowed: host address specified is 0x{{0*}}[[#LARGE_ADDR]] ([[#LARGE_BYTES]] bytes), but device allocation maps to host at 0x{{0*}}[[#SMALL_ADDR]] ([[#SMALL_BYTES]] bytes)
-  // CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#LARGE_ADDR]] ([[#LARGE_BYTES]] bytes)
-  // CHECK: omptarget error: Call to getTargetPointer returned null pointer ('present' map type modifier).
-  // CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
+  // CHECK: omptarget message: explicit extension not allowed: host address
+  // specified is 0x{{0*}}[[#LARGE_ADDR]] ([[#LARGE_BYTES]] bytes), but device
+  // allocation maps to host at 0x{{0*}}[[#SMALL_ADDR]] ([[#SMALL_BYTES]] bytes)
+  // CHECK: omptarget message: device mapping required by 'present' map type
+  // modifier does not exist for host address 0x{{0*}}[[#LARGE_ADDR]]
+  // ([[#LARGE_BYTES]] bytes) CHECK: omptarget error: Call to getTargetPointer
+  // returned null pointer ('present' map type modifier). CHECK: omptarget fatal
+  // error 1: failure of target construct while offloading is mandatory
 #pragma omp target data map(alloc : arr[SMALL])
   {
 #pragma omp target data map(present, tofrom : arr[LARGE])
diff --git a/openmp/libomptarget/test/mapping/present/target_enter_data.c b/openmp/libomptarget/test/mapping/present/target_enter_data.c
index 871a05290e..633277ddf0 100644
--- a/openmp/libomptarget/test/mapping/present/target_enter_data.c
+++ b/openmp/libomptarget/test/mapping/present/target_enter_data.c
@@ -18,9 +18,11 @@ int main() {
   // CHECK: i is present
   fprintf(stderr, "i is present\n");
 
-  // CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
-  // CHECK: omptarget error: Call to getTargetPointer returned null pointer ('present' map type modifier).
-  // CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
+  // CHECK: omptarget message: device mapping required by 'present' map type
+  // modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]]
+  // bytes) CHECK: omptarget error: Call to getTargetPointer returned null
+  // pointer ('present' map type modifier). CHECK: omptarget fatal error 1:
+  // failure of target construct while offloading is mandatory
 #pragma omp target enter data map(present, alloc : i)
 
   // CHECK-NOT: i is present
diff --git a/openmp/libomptarget/test/mapping/present/target_exit_data_delete.c b/openmp/libomptarget/test/mapping/present/target_exit_data_delete.c
index 0fb812b299..d791166147 100644
--- a/openmp/libomptarget/test/mapping/present/target_exit_data_delete.c
+++ b/openmp/libomptarget/test/mapping/present/target_exit_data_delete.c
@@ -17,8 +17,10 @@ int main() {
   // CHECK: i was present
   fprintf(stderr, "i was present\n");
 
-// CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
-// CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
+// CHECK: omptarget message: device mapping required by 'present' map type
+// modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]]
+// bytes) CHECK: omptarget fatal error 1: failure of target construct while
+// offloading is mandatory
 #pragma omp target exit data map(present, delete : i)
 
   // CHECK-NOT: i was present
diff --git a/openmp/libomptarget/test/mapping/present/target_exit_data_release.c b/openmp/libomptarget/test/mapping/present/target_exit_data_release.c
index 14be22faba..083f6c080d 100644
--- a/openmp/libomptarget/test/mapping/present/target_exit_data_release.c
+++ b/openmp/libomptarget/test/mapping/present/target_exit_data_release.c
@@ -17,8 +17,10 @@ int main() {
   // CHECK: i was present
   fprintf(stderr, "i was present\n");
 
-// CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
-// CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
+// CHECK: omptarget message: device mapping required by 'present' map type
+// modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]]
+// bytes) CHECK: omptarget fatal error 1: failure of target construct while
+// offloading is mandatory
 #pragma omp target exit data map(present, release : i)
 
   // CHECK-NOT: i was present
diff --git a/openmp/libomptarget/test/mapping/present/target_update.c b/openmp/libomptarget/test/mapping/present/target_update.c
index 9f6783b6ef..5df4eee6fc 100644
--- a/openmp/libomptarget/test/mapping/present/target_update.c
+++ b/openmp/libomptarget/test/mapping/present/target_update.c
@@ -32,8 +32,10 @@ int main() {
   // CHECK: i is present
   fprintf(stderr, "i is present\n");
 
-  // CHECK: omptarget message: device mapping required by 'present' motion modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
-  // CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
+  // CHECK: omptarget message: device mapping required by 'present' motion
+  // modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]]
+  // bytes) CHECK: omptarget fatal error 1: failure of target construct while
+  // offloading is mandatory
 #pragma omp target update CLAUSE(present : i)
 
   // CHECK-NOT: i is present
diff --git a/openmp/libomptarget/test/mapping/present/target_update_array_extension.c b/openmp/libomptarget/test/mapping/present/target_update_array_extension.c
index 11ad4a8d49..f8f3c94d21 100644
--- a/openmp/libomptarget/test/mapping/present/target_update_array_extension.c
+++ b/openmp/libomptarget/test/mapping/present/target_update_array_extension.c
@@ -66,8 +66,10 @@ int main() {
   // CHECK: arr is present
   fprintf(stderr, "arr is present\n");
 
-  // CHECK: omptarget message: device mapping required by 'present' motion modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
-  // CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
+  // CHECK: omptarget message: device mapping required by 'present' motion
+  // modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]]
+  // bytes) CHECK: omptarget fatal error 1: failure of target construct while
+  // offloading is mandatory
 #pragma omp target data map(alloc : arr[SMALL])
   {
 #pragma omp target update CLAUSE(present : arr[LARGE])
diff --git a/openmp/libomptarget/test/mapping/present/zero_length_array_section.c b/openmp/libomptarget/test/mapping/present/zero_length_array_section.c
index e903a268ef..4759585845 100644
--- a/openmp/libomptarget/test/mapping/present/zero_length_array_section.c
+++ b/openmp/libomptarget/test/mapping/present/zero_length_array_section.c
@@ -20,11 +20,13 @@ int main() {
 
   // arr[0:0] doesn't create an actual mapping in the first directive.
   //
-  // CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] (0 bytes)
-  // CHECK: omptarget error: Call to getTargetPointer returned null pointer ('present' map type modifier).
-  // CHECK: omptarget error: Call to targetDataBegin failed, abort target.
-  // CHECK: omptarget error: Failed to process data before launching the kernel.
-  // CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
+  // CHECK: omptarget message: device mapping required by 'present' map type
+  // modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] (0 bytes)
+  // CHECK: omptarget error: Call to getTargetPointer returned null pointer
+  // ('present' map type modifier). CHECK: omptarget error: Call to
+  // targetDataBegin failed, abort target. CHECK: omptarget error: Failed to
+  // process data before launching the kernel. CHECK: omptarget fatal error 1:
+  // failure of target construct while offloading is mandatory
 #pragma omp target data map(alloc : arr[0 : 0])
 #pragma omp target map(present, alloc : arr[0 : 0])
   ;
diff --git a/openmp/libomptarget/test/mapping/present/zero_length_array_section_exit.c b/openmp/libomptarget/test/mapping/present/zero_length_array_section_exit.c
index 5a7360542e..c88c47f115 100644
--- a/openmp/libomptarget/test/mapping/present/zero_length_array_section_exit.c
+++ b/openmp/libomptarget/test/mapping/present/zero_length_array_section_exit.c
@@ -19,8 +19,10 @@ int main() {
 
   // arr[0:0] doesn't create an actual mapping in the first directive.
   //
-  // CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] (0 bytes)
-  // CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
+  // CHECK: omptarget message: device mapping required by 'present' map type
+  // modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] (0 bytes)
+  // CHECK: omptarget fatal error 1: failure of target construct while
+  // offloading is mandatory
 #pragma omp target enter data map(alloc : arr[0 : 0])
 #pragma omp target exit data map(present, release : arr[0 : 0])
 
diff --git a/openmp/libomptarget/test/offloading/mandatory_but_no_devices.c b/openmp/libomptarget/test/offloading/mandatory_but_no_devices.c
index ecdee72aca..c44b3f6ba8 100644
--- a/openmp/libomptarget/test/offloading/mandatory_but_no_devices.c
+++ b/openmp/libomptarget/test/offloading/mandatory_but_no_devices.c
@@ -47,7 +47,8 @@
 #include <omp.h>
 #include <stdio.h>
 
-// CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
+// CHECK: omptarget fatal error 1: failure of target construct while offloading
+// is mandatory
 int main(void) {
   int X;
 #pragma omp DIR device(omp_get_initial_device())

@jdoerfert jdoerfert merged commit 5d57041 into llvm:main Nov 29, 2023
4 of 5 checks passed
@jdoerfert jdoerfert deleted the offload_prep7 branch November 29, 2023 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openmp:libomptarget OpenMP offload runtime openmp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants