My goal is to conditionally assign values to an array based on the implicit index value, using Cilk Plus Array Notation with Intel's icc
compiler, version 13.1.3 20130607
.
Consider the following code:
T test[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
if(test[:] < 5) {
test[:] = 10 - __sec_implicit_index(0);
}
This code compiles fine, but when I try to run it, I get the following error:
undefined symbol: __sec_implicit_index
Note Although this might look like a linking error, it is not, since the following code compiles and runs fine (the condition has been removed):
T test[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
test[:] = 10 - __sec_implicit_index(0);
So, my question: is it possible to accomplish the behaviour of the conditional code below using Cilk Plus Array Notation?
T test[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
for(int i = 0; i < 10; i++) {
if(i < 5) {
test[i] = 10 - i;
}
}
The example is correct. The problem is a bug in icc 13.1.3. icc 14.0 beta correctly compiled and executed the example for me.
For icc 13.1.3, I have found #pragma simd to be more reliable, in general, as a way to indicate permission to vectorize. With it, your example looks like:
It of course loses the notational convenience of array notation.