w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Is it possible to use `__sec_implicit_index` inside an `if` block statement using Cilk Plus Array Notation?

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:

T test[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
#pragma simd
for(int i = 0; i < 10; i++) {
    if(i < 5) {
        test[i] = 10 - i;
    }
}

It of course loses the notational convenience of array notation.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.