According to the OpenMP spec one can specify array sections as
[lower-bound:length] or [lower-bound:] or [:length] or [ : ]
However if one tries one except [:] the compiler complains about a missing "]" instead of detecting the number or variable used.
Is this known and going to be fixed?
Link Copied
I'm coding for an Intel MIC (KNC) and use icc 14.0.2 (OpenMP 4)
[lower-bound:length] didn't work, but fortunately [:] did which is the most important one IMO
Which cases are there that only <=64MB of data transfer are allowed? This would be very annoying and might be a show-stopper for some programs.
I hope this is among the features that are implemented in icc 15.x. But I guess I have to stick to the current notation for now.
Hi Alexander,
The latest OpenMP-style array section syntax can only be used in OpenMP clauses and should be fully supported.
Can you please attach a small test case that you have which shows you have a problem with Array Sections? Appreciate much, for your help
Regards,
Kittur
Unfortunately I cannot reproduce the bug, when it complains about the "[lower-bound:length]" part.
But at least "[:length]" does not work:
#include <stdio.h> #include <stdlib.h> int main (int argc, char *argv[]) { int size = 1000; int* values = (int*) malloc(sizeof(int)*size); #pragma omp target map(to:values[:size]) values[0] = 0; return EXIT_SUCCESS; }
Thanks Alexander for attaching the test case on the [:length] case. I tried it using the latest 14.0 version and yes it did error out. I also tried the latest 15.0 beta version of the compiler and it was successful. Can you try the beta version? You can read the sticky post on the beta package at the very top of this forum on how you can get the package.
I'll file this issue with the developers anyways on the failure of the test case with 14.0 version that you attached. I'll update you as soon as the product release (15.0) is out which contains a fix for this issue already, thanks.
_Kittur
Alex, well the issue you find with (length) is fixed in our code branch (14) and the next update (anytime soon) should contain the fix. I'll update you accordingly when the release is out, fyi.
_Kittur
For more complete information about compiler optimizations, see our Optimization Notice.