|
6 | 6 | #define N 10
|
7 | 7 |
|
8 | 8 | 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 |
11 | 11 |
|
12 | 12 | // clang-format off
|
13 | 13 | // CHECK: Mapping tables after target enter data:
|
14 | 14 | // CHECK-NEXT: omptarget device 0 info: OpenMP Host-Device pointer mappings after block
|
15 | 15 | // 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 |
22 | 18 | #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 |
24 | 21 | printf("Mapping tables after target enter data:\n");
|
25 | 22 | ompx_dump_mapping_tables();
|
26 | 23 |
|
27 | 24 | // clang-format off
|
28 | 25 | // 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 |
35 | 29 | #pragma omp target exit data device(0) map(release : a[ : N])
|
| 30 | + // clang-format on |
36 | 31 | printf("\nMapping tables after target exit data for a:\n");
|
37 | 32 | ompx_dump_mapping_tables();
|
38 | 33 |
|
|
0 commit comments