source: CIVL/examples/omp/simplifier/simd_safelen_ptr.c@ f4bd985

1.23 2.0 main test-branch
Last change on this file since f4bd985 was c5f07b7, checked in by Ziqing Luo <ziqing@…>, 7 years ago

reach relatively a stable point for the OpenMP simplifier. SIMD and its clauses : safelen & simdlen is now supported by the simplifier.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5217 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 427 bytes
Line 
1#include<assert.h>
2int main() {
3 int a[32], b[16];
4 int * p, * q, * r;
5
6 p = a;
7 q = p + 16;
8 r = b;
9#pragma omp simd safelen(9)
10 for (int i = 0; i < 8; i++) {
11 p[i] = 0; // p[i] p[i'], p[i] p[i'+8] |i-i'|<9
12 p[i + 8] = 0;
13 q[i] = 0;
14 q[i + 8] = 0;
15 r[i] = 0;
16 r[i + 8] = 0;
17 }
18
19 for (int i = 0; i < 32; i++)
20 assert(a[i] == 0);
21 for (int i = 0; i < 16; i++)
22 assert(b[i] == 0);
23}
Note: See TracBrowser for help on using the repository browser.