在硬件不足的情况下编码 [英] Coding on insufficient hardware

查看:94
本文介绍了在硬件不足的情况下编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用C ++中的SIMD指令进行编码,并尝试使用IDE在实时编码时显示错误,拼写错误等.问题是,我使用的是AVX512指令,我的硬件不支持该指令,仅使用我用于编译的服务器.有没有一种方法可以在IDE中进行带错误检查的代码,而不会受到AVX512功能的干扰而妨碍编译器?

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?

推荐答案

首先,您不需要桌面来支持AVX512来编辑源代码并编译需要AVX512的可执行文件.如果您可以在本地编辑/编译以及在服务器上运行/调试,就可以了.

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.

您可以通过将IDE配置为在支持AVX512的仿真器上运行程序来在本地调试. 英特尔的软件开发模拟器(SDE)是好的选择.它可以充当GDB远程服务器,因此您应该能够调试其中运行的程序.

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.

或者另一个选择是使用一个兼容的内在头文件,该头文件定义了AVX512内在函数,而__m512i则是根据AVX2类型和内在函数定义的.因此,您的源代码可以针对实际的AVX512进行编译,也可以针对AVX2进行编译(速度较慢,但​​您可以对其进行调试.)

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.)

显然,英特尔实际上发布了avxintrin-emu.h标头,用于在仅具有SSE4的计算机上开发AVX代码:

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的漂亮的VCL包装器库(GPL许可证)具有适用于512位和256位向量的兼容组件,但仅适用于VCL类型,不适用于我假设要使用的底层Intel内部函数. https://www.agner.org/optimize/#vectorclass

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

几乎重复-

这篇关于在硬件不足的情况下编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆