[Openmp-commits] [openmp] [OpenMP] Fix ompx_dump_mapping_tables lit test (PR #85754)

via Openmp-commits openmp-commits at lists.llvm.org
Tue Mar 19 02:13:15 PDT 2024


https://github.com/nicebert updated https://github.com/llvm/llvm-project/pull/85754

>From af9d596d29912b4d209cc1558bdd28681faaf79d Mon Sep 17 00:00:00 2001
From: Nicole Aschenbrenner <nicole.aschenbrenner at amd.com>
Date: Tue, 19 Mar 2024 04:40:10 -0400
Subject: [PATCH] [OpenMP] Fix ompx_dump_mapping_tables lit test

Fixes ompx_dump_mapping_tables test by only using one device after breaking built bots
---
 .../test/api/ompx_dump_mapping_tables.cpp     | 25 ++++++++-----------
 1 file changed, 10 insertions(+), 15 deletions(-)

diff --git a/openmp/libomptarget/test/api/ompx_dump_mapping_tables.cpp b/openmp/libomptarget/test/api/ompx_dump_mapping_tables.cpp
index a57d0c8a6d2bf4..c170c2d7387338 100644
--- a/openmp/libomptarget/test/api/ompx_dump_mapping_tables.cpp
+++ b/openmp/libomptarget/test/api/ompx_dump_mapping_tables.cpp
@@ -6,33 +6,28 @@
 #define N 10
 
 int main() {
-  int *a = new int[N]; // mapped and released from device 0
-  int *b = new int[N]; // mapped to device 2
+  int *a = new __int32_t[N];     // mapped and released from device 0
+  int *b = new __int32_t[2 * N]; // mapped to device 0
 
   // clang-format off
   // CHECK: Mapping tables after target enter data:
   // CHECK-NEXT: omptarget device 0 info: OpenMP Host-Device pointer mappings after block
   // CHECK-NEXT: omptarget device 0 info: Host Ptr Target Ptr Size (B) DynRefCount HoldRefCount Declaration
-  // CHECK-NEXT: omptarget device 0 info: {{(0x[0-9a-f]{16})}} {{(0x[0-9a-f]{16})}}
-  // CHECK-NEXT: omptarget device 1 info: OpenMP Host-Device pointer mappings table empty
-  // CHECK-NEXT: omptarget device 2 info: OpenMP Host-Device pointer mappings after block
-  // CHECK-NEXT: omptarget device 2 info: Host Ptr Target Ptr Size (B) DynRefCount HoldRefCount Declaration
-  // CHECK-NEXT: omptarget device 2 info: {{(0x[0-9a-f]{16})}} {{(0x[0-9a-f]{16})}}
-  // clang-format on
+  // CHECK-NEXT: omptarget device 0 info: {{(0x[0-9a-f]{16})}} {{(0x[0-9a-f]{16})}} {{[48]}}0
+  // CHECK-NEXT: omptarget device 0 info: {{(0x[0-9a-f]{16})}} {{(0x[0-9a-f]{16})}} {{[48]}}0
 #pragma omp target enter data device(0) map(to : a[ : N])
-#pragma omp target enter data device(2) map(to : b[ : N])
+#pragma omp target enter data device(0) map(to : b[ : 2*N])
+  // clang-format on
   printf("Mapping tables after target enter data:\n");
   ompx_dump_mapping_tables();
 
   // clang-format off
   // CHECK: Mapping tables after target exit data for a:
-  // CHECK-NEXT: omptarget device 0 info: OpenMP Host-Device pointer mappings table empty
-  // CHECK-NEXT: omptarget device 1 info: OpenMP Host-Device pointer mappings table empty
-  // CHECK-NEXT: omptarget device 2 info: OpenMP Host-Device pointer mappings after block
-  // CHECK-NEXT: omptarget device 2 info: Host Ptr Target Ptr Size (B) DynRefCount HoldRefCount Declaration
-  // CHECK-NEXT: omptarget device 2 info: {{(0x[0-9a-f]{16})}} {{(0x[0-9a-f]{16})}}
-  // clang-format on
+  // CHECK-NEXT: omptarget device 0 info: OpenMP Host-Device pointer mappings after block
+  // CHECK-NEXT: omptarget device 0 info: Host Ptr Target Ptr Size (B) DynRefCount HoldRefCount Declaration
+  // CHECK-NEXT: omptarget device 0 info: {{(0x[0-9a-f]{16})}} {{(0x[0-9a-f]{16})}} 80
 #pragma omp target exit data device(0) map(release : a[ : N])
+  // clang-format on
   printf("\nMapping tables after target exit data for a:\n");
   ompx_dump_mapping_tables();
 



More information about the Openmp-commits mailing list