You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just like how c preprocessing attaches the original filename/line in the processed file. We can add the similar kind info to the transformed file. I believe this is actually used by the debugger. e.g. The original file:
1 #include<stdio.h>
2 #include<omp.h>
3 int main(int argc, char * argv[])
4 {
5 //Initialize array
6 int arr[] = {1, 2, 3, 4, 5};
7 int sum = 0;
8
9 //Calculate length of array arr
10 int length = sizeof(arr)/sizeof(arr[0]);
11
12 //Loop through the array to calculate sum of elements
13 #pragma omp parallel
14 printf("thread %d of team %d\n", omp_get_thread_num(), omp_get_num_threads());
15 #pragma omp parallel for reduction(+:sum)
16 for (int i = 0; i < length; i++) {
17 sum = sum + arr[i];
18 }
19 printf("Sum of all the elements of an array: %d\n", sum);
20 return 0;
21 }
Just like how c preprocessing attaches the original filename/line in the processed file. We can add the similar kind info to the transformed file. I believe this is actually used by the debugger. e.g. The original file:
The preprocessed file:
The text was updated successfully, but these errors were encountered: