Skip to content

[OpenMP] Fix ompx_dump_mapping_tables lit test #85754

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

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 10 additions & 15 deletions openmp/libomptarget/test/api/ompx_dump_mapping_tables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down