Skip to content

Instantly share code, notes, and snippets.

@thoughtpolice
Created May 11, 2014 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thoughtpolice/8b597b8f5f68153a7be4 to your computer and use it in GitHub Desktop.
Save thoughtpolice/8b597b8f5f68153a7be4 to your computer and use it in GitHub Desktop.
Auto-parallelism and vectorization in the Intel compiler.
#include <stdio.h>
#define ARR_SIZE 500 //Define array
int main() {
int matrix[ARR_SIZE][ARR_SIZE];
int arrA[ARR_SIZE]={10};
int arrB[ARR_SIZE]={30};
int i, j;
for(i=0;i<ARR_SIZE;i++) {
for(j=0;j<ARR_SIZE;j++) { matrix[i][j] = arrB[i]*(arrA[i]%2+10); }
} printf("%d\n",matrix[0][0]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment