|
3 | 3 |
|
4 | 4 | int compute(int); |
5 | 5 |
|
6 | | -void streaming_openmp_captured_region(int* out) __arm_streaming |
7 | | -{ |
| 6 | +void streaming_openmp_captured_region(int * out) __arm_streaming { |
8 | 7 | // expected-error@+2 {{OpenMP captured regions are not yet supported in streaming functions}} |
9 | 8 | // expected-cpp-error@+1 {{OpenMP captured regions are not yet supported in streaming functions}} |
10 | 9 | #pragma omp parallel for num_threads(32) |
11 | | - for(int ci =0;ci< 8;ci++) |
12 | | - { |
13 | | - out[ci] =compute(ci); |
| 10 | + for (int ci = 0; ci < 8; ci++) { |
| 11 | + out[ci] = compute(ci); |
14 | 12 | } |
15 | 13 | } |
16 | 14 |
|
17 | | -__arm_locally_streaming void locally_streaming_openmp_captured_region(int* out) |
18 | | -{ |
| 15 | +__arm_locally_streaming void locally_streaming_openmp_captured_region(int * out) { |
19 | 16 | // expected-error@+2 {{OpenMP captured regions are not yet supported in streaming functions}} |
20 | 17 | // expected-cpp-error@+1 {{OpenMP captured regions are not yet supported in streaming functions}} |
21 | 18 | #pragma omp parallel for num_threads(32) |
22 | | - for(int ci =0;ci< 8;ci++) |
23 | | - { |
| 19 | + for (int ci = 0; ci < 8; ci++) { |
24 | 20 | out[ci] = compute(ci); |
25 | 21 | } |
26 | 22 | } |
27 | 23 |
|
28 | | -void za_state_captured_region(int* out) __arm_inout("za") |
29 | | -{ |
| 24 | +void za_state_captured_region(int * out) __arm_inout("za") { |
30 | 25 | // expected-error@+2 {{OpenMP captured regions are not yet supported in functions with ZA state}} |
31 | 26 | // expected-cpp-error@+1 {{OpenMP captured regions are not yet supported in functions with ZA state}} |
32 | 27 | #pragma omp parallel for num_threads(32) |
33 | | - for(int ci =0;ci< 8;ci++) |
34 | | - { |
35 | | - out[ci] =compute(ci); |
| 28 | + for (int ci = 0; ci < 8; ci++) { |
| 29 | + out[ci] = compute(ci); |
| 30 | + } |
| 31 | +} |
| 32 | + |
| 33 | +__arm_new("za") void new_za_state_captured_region(int * out) { |
| 34 | + // expected-error@+2 {{OpenMP captured regions are not yet supported in functions with ZA state}} |
| 35 | + // expected-cpp-error@+1 {{OpenMP captured regions are not yet supported in functions with ZA state}} |
| 36 | + #pragma omp parallel for num_threads(32) |
| 37 | + for (int ci = 0; ci < 8; ci++) { |
| 38 | + out[ci] = compute(ci); |
| 39 | + } |
| 40 | +} |
| 41 | + |
| 42 | +void zt0_state_openmp_captured_region(int * out) __arm_inout("zt0") { |
| 43 | + // expected-error@+2 {{OpenMP captured regions are not yet supported in functions with ZT0 state}} |
| 44 | + // expected-cpp-error@+1 {{OpenMP captured regions are not yet supported in functions with ZT0 state}} |
| 45 | + #pragma omp parallel for num_threads(32) |
| 46 | + for (int ci = 0; ci < 8; ci++) { |
| 47 | + out[ci] = compute(ci); |
36 | 48 | } |
37 | 49 | } |
38 | 50 |
|
39 | | -void zt0_state_openmp_captured_region(int* out) __arm_inout("zt0") |
40 | | -{ |
| 51 | +__arm_new("zt0") void new_zt0_state_openmp_captured_region(int * out) { |
41 | 52 | // expected-error@+2 {{OpenMP captured regions are not yet supported in functions with ZT0 state}} |
42 | 53 | // expected-cpp-error@+1 {{OpenMP captured regions are not yet supported in functions with ZT0 state}} |
43 | 54 | #pragma omp parallel for num_threads(32) |
44 | | - for(int ci =0;ci< 8;ci++) |
45 | | - { |
| 55 | + for (int ci = 0; ci < 8; ci++) { |
46 | 56 | out[ci] = compute(ci); |
47 | 57 | } |
48 | 58 | } |
49 | 59 |
|
50 | 60 | /// OpenMP directives that don't create a captured region are okay: |
51 | 61 |
|
52 | | -void streaming_function_openmp(int* out) __arm_streaming __arm_inout("za", "zt0") |
53 | | -{ |
| 62 | +void streaming_function_openmp(int * out) __arm_streaming __arm_inout("za", "zt0") { |
54 | 63 | #pragma omp unroll full |
55 | | - for(int ci =0;ci< 8;ci++) |
56 | | - { |
57 | | - out[ci] =compute(ci); |
| 64 | + for (int ci = 0; ci < 8; ci++) { |
| 65 | + out[ci] = compute(ci); |
| 66 | + } |
| 67 | +} |
| 68 | + |
| 69 | +__arm_locally_streaming void locally_streaming_openmp(int * out) __arm_inout("za", "zt0") { |
| 70 | + #pragma omp unroll full |
| 71 | + for (int ci = 0; ci < 8; ci++) { |
| 72 | + out[ci] = compute(ci); |
58 | 73 | } |
59 | 74 | } |
60 | 75 |
|
61 | | -__arm_locally_streaming void locally_streaming_openmp(int* out) __arm_inout("za", "zt0") |
62 | | -{ |
| 76 | +__arm_new("za", "zt0") void arm_new_openmp(int * out) { |
63 | 77 | #pragma omp unroll full |
64 | | - for(int ci =0;ci< 8;ci++) |
65 | | - { |
| 78 | + for (int ci = 0; ci < 8; ci++) { |
66 | 79 | out[ci] = compute(ci); |
67 | 80 | } |
68 | 81 | } |
0 commit comments