-->

Coding on insufficient hardware

2020-08-09 07:39发布

问题:

I am currently coding with SIMD instructions in C++ and trying to use an IDE which shows errors, spelling mistakes, etc whilst coding in real-time. The Problem is, that i am using AVX512 Instructions, which are not supported by my hardware, only the server i use for compiling. Is there a way to code in an IDE with errorchecking, etc without the interference of the AVX512-functions hindering the compiler?

回答1:

First of all, you don't need your desktop to support AVX512 to edit source and compile an executable that requires AVX512. If you can edit / compile locally, and run/debug on the server, you're fine.


You can debug locally by configuring your IDE to run your program under an emulator that supports AVX512. Intel's Software Development Emulator (SDE) would be a good choice. It can act as a GDB-remote so you should be able to debug a program running inside it.

Or another option is to use a compat intrinsics header file that defines the AVX512 intrinsics, and __m512i, in terms of AVX2 types and intrinsics. So your source code can be compiled for real AVX512, or it can be compiled for AVX2 (slow but you can debug it.)

Apparently Intel actually publishes a avxintrin-emu.h header for developing AVX code on a machine with only SSE4: Intel AVX intrinsics: any compatibility library out? I think @Mysticial mentioned doing the same thing for AVX512, but I can't find any mention of that with google.

Agner Fog's nice VCL wrapper library (GPL license) has this compat thing for 512 and 256-bit vectors, but only for VCL types, not for the underlying Intel intrinsics which I assume you want to use. https://www.agner.org/optimize/#vectorclass


Near duplicates -

  • developing for new instruction sets


标签: c++ ide simd