#pragma omp declare simd
#pragma omp declare simd simdlen(2)
#pragma omp declare simd simdlen(6)
#pragma omp declare simd simdlen(8)
double foo(float x);
void foo_loop(double *x, float *y, int N) {
for (int i = 0; i < N; ++i) {
x[i] = foo(y[i]);
}
}
#pragma omp declare simd notinbranch
float bar(double x);
#pragma omp declare simd notinbranch
double baz(float x);
void baz_bar_loop(double *x, float *y, int N) {
for (int i = 0; i < N; ++i) {
x[i] = baz(y[i]);
y[i] = bar(x[i]);
}
}
#pragma omp declare simd
#pragma omp declare simd simdlen(2)
#pragma omp declare simd simdlen(6)
#pragma omp declare simd simdlen(8)
long foo_int(int x);
void foo_int_loop(long *x, int *y, int N) {
for (int i = 0; i < N; ++i) {
x[i] = foo_int(y[i]);
}
}
#pragma omp declare simd
char simple_8bit(char);
#pragma omp declare simd
short simple_16bit(short);
#pragma omp declare simd
int simple_32bit(int);
#pragma omp declare simd
long simple_64bit(long);
#pragma omp declare simd
#pragma omp declare simd simdlen(32)
char a01(int x);
#pragma omp declare simd
#pragma omp declare simd simdlen(2)
long a02(short x);
#pragma omp declare simd
int b01(int *x);
#pragma omp declare simd
char b02(char *);
#pragma omp declare simd
double *b03(double *);
#pragma omp declare simd inbranch
int c01(double *x, short y);
#pragma omp declare simd inbranch uniform(x)
double c02(double *x, char y);
#pragma omp declare simd notinbranch linear(i)
double constlinear(const int i);
#pragma omp declare simd linear(sin) linear(cos)
void sincos(double in, double *sin, double *cos);
#pragma omp declare simd linear(sin : 1) linear(cos : 2)
void SinCos(double in, double *sin, double *cos);
#pragma omp declare simd inbranch uniform(x) linear(val(i) : 4)
int foo2(int *x, int i);
#pragma omp declare simd inbranch uniform(x, c) linear(i \
: c)
int foo3(int *x, int i, unsigned char c);
#pragma omp declare simd linear(x) aligned(x : 16) simdlen(4)
int foo4(int *x, float y);
static int *I;
static char *C;
static short *S;
static long *L;
static float *F;
static double *D;
void do_something() {
simple_8bit(*C);
simple_16bit(*S);
simple_32bit(*I);
simple_64bit(*L);
*C = a01(*I);
*L = a02(*S);
*I = b01(I);
*C = b02(C);
D = b03(D);
*I = c01(D, *S);
*D = c02(D, *S);
constlinear(*I);
sincos(*D, D, D);
SinCos(*D, D, D);
foo2(I, *I);
foo3(I, *I, *C);
foo4(I, *F);
}
typedef struct S {
char R, G, B;
} STy;
#pragma omp declare simd notinbranch
STy DoRGB(STy x);
static STy *RGBData;
void do_rgb_stuff() {
DoRGB(*RGBData);
}