The issues is fixed by pull request #1333:
https://github.com/ispc/ispc/pull/1333

On Mon, Aug 6, 2018 at 3:04 PM <[email protected]> wrote:

> Hi Brian,
>
> Were your tests only for all() or were you able to see the same behavior
> with any() and none() as well? I ran some code samples and do not see the
> same problem with none() and any()
>
>         if (programIndex >= 4) {
>            if (none(programIndex < 4) == true) {
>            print("no lanes are  less than 4. programIndex = %\n",
> programIndex);
>
>         } else{
>             m = 1;
>             print("some lanes are less than 4. programIndex = % \n",
> programIndex);
>
>         }
>
> The above for eg. prints "no lanes are  less than 4" which is what I'd
> expect.
>
> Thanks,
> Deepak
>
> On Tuesday, April 17, 2018 at 10:53:02 AM UTC-7, Brian Green wrote:
>>
>> I tested: 1.4.2, 1.5.0, 1.6.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.2.  Got
>> the same result with all versions.
>>
>> Thanks,
>> -Brian
>>
>> On Monday, April 16, 2018 at 11:25:12 AM UTC-7, Matt Pharr wrote:
>>>
>>> Hm, strange. Here's the implementation of all() from the ispc stdlib:
>>>
>>> __declspec(safe)
>>> static inline uniform bool all(bool v) {
>>>     // As with any(), we need to explicitly mask v with the current
>>> program mask
>>>     // so we're only looking at the current lanes
>>> #if (ISPC_MASK_BITS == 1)
>>>     return __all(v | !__mask);
>>> #else
>>>     return __all((UIntMaskType)__sext_varying_bool(v) | !__mask);
>>> #endif
>>> }
>>>
>>> (Yes, grungy for various reasons), but in theory it should be factoring
>>> in the current mask. I wonder if a compiler change broke this; any chance
>>> you can easily try on an earlier version?
>>>
>>> Thanks,
>>> Matt
>>>
>>>
>>>
>>> On Mon, Apr 16, 2018 at 11:18 AM, Brian Green <[email protected]>
>>> wrote:
>>>
>>>> It looks like all(), any(), and none() examine all lanes regardless if
>>>> those lanes are active or not.  For example,
>>>>
>>>>     if (programIndex < 4) {
>>>>         if (all(programIndex < 4)) {
>>>>             print("all lanes are less than 4\n");
>>>>         } else {
>>>>             print("all lanes are not less than 4\n");
>>>>         }
>>>>     }
>>>>
>>>> will output:
>>>>
>>>> all lanes are not less than 4
>>>>
>>>> This behavior is usually inconvenient.  When using all(), I'm generally
>>>> thinking all of my active lanes - the inactive lanes often contain
>>>> irrelevant values.  Is there a rationale for all(), any(), or none() to
>>>> operate on all lanes, regardless of mask?
>>>>
>>>> -brian
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Intel SPMD Program Compiler Users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>> --
> You received this message because you are subscribed to the Google Groups
> "Intel SPMD Program Compiler Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Intel SPMD Program Compiler Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to