/* * @@name: declare_variant.2c * @@type: C * @@compilable: yes, omp_5.0 * @@linkable: no * @@expect: success */ #include void base_saxpy(int, float, float *, float *); void avx512_saxpy(int, float, float *, float *); #pragma omp declare variant( avx512_saxpy ) \ match( device={isa("core-avx512")} ) void base_saxpy(int n, float s, float *x, float *y) // base function { #pragma omp parallel for for(int i=0; i #include #include #define N 1000 int main() { static float x[N],y[N] __attribute__ ((aligned(64))); float s=2.0; // Check for 64-byte aligned if( ((intptr_t)y)%64 != 0 || ((intptr_t)x)%64 != 0 ) { printf("ERROR: x|y not 64-Byte aligned\n"); exit(1); } for(int i=0; i