Skip to content

Commit 29849d5

Browse files
authored
[OpenMP] Fix ompx_dump_mapping_tables lit test (#85754)
Fixes ompx_dump_mapping_tables test by only using one device after breaking built bots
1 parent 0d40de7 commit 29849d5

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

openmp/libomptarget/test/api/ompx_dump_mapping_tables.cpp

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,28 @@
66
#define N 10
77

88
int main() {
9-
int *a = new int[N]; // mapped and released from device 0
10-
int *b = new int[N]; // mapped to device 2
9+
int *a = new __int32_t[N]; // mapped and released from device 0
10+
int *b = new __int32_t[2 * N]; // mapped to device 0
1111

1212
// clang-format off
1313
// CHECK: Mapping tables after target enter data:
1414
// CHECK-NEXT: omptarget device 0 info: OpenMP Host-Device pointer mappings after block
1515
// CHECK-NEXT: omptarget device 0 info: Host Ptr Target Ptr Size (B) DynRefCount HoldRefCount Declaration
16-
// CHECK-NEXT: omptarget device 0 info: {{(0x[0-9a-f]{16})}} {{(0x[0-9a-f]{16})}}
17-
// CHECK-NEXT: omptarget device 1 info: OpenMP Host-Device pointer mappings table empty
18-
// CHECK-NEXT: omptarget device 2 info: OpenMP Host-Device pointer mappings after block
19-
// CHECK-NEXT: omptarget device 2 info: Host Ptr Target Ptr Size (B) DynRefCount HoldRefCount Declaration
20-
// CHECK-NEXT: omptarget device 2 info: {{(0x[0-9a-f]{16})}} {{(0x[0-9a-f]{16})}}
21-
// clang-format on
16+
// CHECK-NEXT: omptarget device 0 info: {{(0x[0-9a-f]{16})}} {{(0x[0-9a-f]{16})}} {{[48]}}0
17+
// CHECK-NEXT: omptarget device 0 info: {{(0x[0-9a-f]{16})}} {{(0x[0-9a-f]{16})}} {{[48]}}0
2218
#pragma omp target enter data device(0) map(to : a[ : N])
23-
#pragma omp target enter data device(2) map(to : b[ : N])
19+
#pragma omp target enter data device(0) map(to : b[ : 2*N])
20+
// clang-format on
2421
printf("Mapping tables after target enter data:\n");
2522
ompx_dump_mapping_tables();
2623

2724
// clang-format off
2825
// CHECK: Mapping tables after target exit data for a:
29-
// CHECK-NEXT: omptarget device 0 info: OpenMP Host-Device pointer mappings table empty
30-
// CHECK-NEXT: omptarget device 1 info: OpenMP Host-Device pointer mappings table empty
31-
// CHECK-NEXT: omptarget device 2 info: OpenMP Host-Device pointer mappings after block
32-
// CHECK-NEXT: omptarget device 2 info: Host Ptr Target Ptr Size (B) DynRefCount HoldRefCount Declaration
33-
// CHECK-NEXT: omptarget device 2 info: {{(0x[0-9a-f]{16})}} {{(0x[0-9a-f]{16})}}
34-
// clang-format on
26+
// CHECK-NEXT: omptarget device 0 info: OpenMP Host-Device pointer mappings after block
27+
// CHECK-NEXT: omptarget device 0 info: Host Ptr Target Ptr Size (B) DynRefCount HoldRefCount Declaration
28+
// CHECK-NEXT: omptarget device 0 info: {{(0x[0-9a-f]{16})}} {{(0x[0-9a-f]{16})}} 80
3529
#pragma omp target exit data device(0) map(release : a[ : N])
30+
// clang-format on
3631
printf("\nMapping tables after target exit data for a:\n");
3732
ompx_dump_mapping_tables();
3833

0 commit comments

Comments
 (0)