Created
March 19, 2015 00:53
-
-
Save lettergram/e72c572c74ddb36c7918 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double bad_openmp_cache_opt(int ** matrix, long int size, int blocksize){ | |
double total_begin = omp_get_wtime(); | |
for(int x = 0; x < size; x++){ | |
if(x + 1 < size){ __builtin_prefetch(matrix[x+1]); } | |
#pragma omp parallel for | |
for(int y = 0; y < size; y++){ | |
matrix[x][y] = matrix[x][y] * 2; | |
} | |
} | |
double total_end = omp_get_wtime(); | |
return double(total_end - total_begin); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment