Open
Description
#include <stdio.h>
#include <stdlib.h>
int main() {
int **a = (int**)malloc(100*sizeof(int*));
for(int i=0;i<100;i++) {
a[i] = (int*)malloc(100*sizeof(int));
}
for(int i=0;i<100;i++) {
for(int j=0;j<100;j++) {
a[i][j]=0;
}
}
#pragma omp target data map(to: a[0:1][0:100])
{
#pragma omp target teams
#pragma omp distribute
for (int j = 0; j < 100; j++) {
a[0][j] += j;
}
#pragma omp target update from(a[0:1][0:100])
}
printf("a[0][10]: %d\n", a[0][10]);
}
<source>:22:44: error: section length is unspecified and cannot be inferred because subscripted value is an array of unknown bound
22 | #pragma omp target update from(a[0:1][0:100])
| ^
1 error generated.
https://godbolt.org/z/KTxcv3MKE
note:
If you change a[0:1][0:100] to a[0][0:100] it will not diagnostic an error.