Community
cancel
Showing results for 
Search instead for 
Did you mean: 
63 Views

[OMP] icc does not understand array sections (completely)

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?

0 Kudos
7 Replies
TimP
Black Belt
63 Views

It may be interesting to know in which context you wish to use this. You would need at least icc 14.0.2 to test OpenMP 4. Some additional features are implemented in icc 15.0 beta test. I think [lower-bound:length] is most important in the omp target arena. I don't fully understand why no use of [] is defined for the aligned() clause, but it seems no one asked for it to be included in the standard. I've run into cases with target map where it appears to be necessary to specify length small enough that total data transfer doesn't exceed 64MB, but this doesn't appear necessarily to prevent a data transfer of greater length from succeeding. I notice the gcc 4.9 announcement today where they claim support for this stuff, even though (as far as I know) it is limited to host only. There are some features which are accepted by gcc which are rejected by icc 14.0.2 but it doesn't necessarily mean they work in a useful manner in gcc.
63 Views

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.

Kittur_G_Intel
Employee
63 Views

Alexander, yes [lower-bound:length] should work and will need to investigate and get back to you on this.....
Kittur_G_Intel
Employee
63 Views

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
 

63 Views

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;
}

 

Kittur_G_Intel
Employee
63 Views

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

Kittur_G_Intel
Employee
63 Views

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