Last active
May 9, 2020 14:59
-
-
Save smspillaz/72ff76e053e35506aa500fca72e8e6f1 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
for (int size = 1; size < n; size = 2 * size) { | |
int nSegments = n / size; | |
#pragma omp for | |
for(int segment = 0; segment < nSegments; ++segment) { | |
int leftStart = segment * size; | |
int mid = min(leftStart + (size / 2), n-1); | |
int rightEnd = min(leftStart + size, n-1); | |
merge(data, leftStart, mid, rightEnd); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment