Vc::currentImplementationSupported() fails
Kay F. Jahnke
[please enable javascript to see the address]
Wed May 3 08:17:48 CEST 2017
Am 02.05.2017 um 21:54 schrieb Matthias Kretz:
> On Dienstag, 2. Mai 2017 19:19:48 CEST Kay F. Jahnke wrote:
>> Am 02.05.2017 um 13:30 schrieb Matthias Kretz:
>>> I think you're seeing this because AVX512 is not
>>> implemented on master. Can you try compiling for AVX2 and running on an
>>> older system? That should give you your expected error message.
>>
>> I tried on my laptop. There I compiled with -mavx2, and it can only
>> handle AVX. same effect:
>>
>> Ungültiger Maschinenbefehl (Speicherabzug geschrieben)
>> (illegal instruction, core dumped)
> [...]
>> That must be what it's doing - I'll try and narrow it down some more,
>> then get in touch again. Maybe there's some code which is executed
>> before main, could that be it?
>
> Yes. E.g. all dynamic initializers of global variables would run before main.
> E.g. if you have global Vc::Vector objects that might be the reason.
Okay, I had two things going on at the same time on my desktop system: I
had code using Vc before main (some static object's constructor). When I
removed that, I came past the currentImplementationSupported() call...
> You can run the application in gdb and produce a backtrace on SIGILL. Call
> `disassemble` to have gdb print the instructions it just executed. Let me know
> where it happens, maybe there's something I can do in Vc.
... just to hit an illegal instruction which, as you suspected, the
compiler had generated itself, having been called with -mavx512f, the
offender being
vpxord %zmm0,%zmm0,%zmm0
which was used to set some variables to zero. My first proof of
functioning autovectorization ;)
Roughly the same on the laptop, though the illegal instruction here
occured in the initialization of another global variable.
While this explains the illegal instructions, it leaves me wondering how
I can safely run the currentImplementationSupported() test. I may be
able to avoid the illegal ops before the test, but if the test is
actually executed, I feel it should not maintain all is well, when the
program hits an illegal instruction just a few ops later.
With regards
Kay
More information about the Vc
mailing list