-
-
Save NielsMinssen/090cddc8f666528658fd136c28bb908e 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
#include <omp.h> | |
#define SIZE 1000 | |
double A[SIZE][SIZE]; | |
double B[SIZE][SIZE]; | |
double C[SIZE][SIZE]; | |
int main() { | |
// Initialize A and B | |
omp_set_num_threads(4); | |
// Parallélisation | |
#pragma omp parallel for | |
for(int i = 0; i < SIZE; i++) { | |
for(int j = 0; j < SIZE; j++) { | |
C[i][j] = 0.0; | |
for(int k = 0; k < SIZE; k++) { | |
C[i][j] += A[i][k] * B[k][j]; | |
} | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment