单指令多数据 [英] single instruction multiple data

查看:91
本文介绍了单指令多数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

simd代码是标准代码,可用于优化任何程序


在考虑此代码时确实存在问题


感谢所有帮助:-D

is simd code a standard code that can be used to optimize any program


really i''v a problem in thinking about this code


Thanks for all helps :-D

推荐答案

SIMD是处理器体系结构. C#是为虚拟通用处理器"(CIL或MSIL)编译的语言,然后对其进行了优化以在物理处理器上运行.因此,C#与物理处理器的体系结构非常遥远.如果C#要利用SIMD架构,这将不是不可能的,但这将是CIL移植到SIMD架构的影响,也是C#所无法实现的优化的结果. C#(4.0)的最新版本已包含各种针对并行化的优化可能性,但尚未针对SIMD架构进行优化.如果您想查看SIMD架构的代码,就必须(今天)以纯汇编语言(例如Intel的MMX指令)来研究非常低级的语言,就我所知.诸如C#或C之类的高级语言可能会尝试从这些指令中受益,但这始终是通过其编译器进行优化来实现的.现在,可能会有更高级的语言为您提供针对这些体系结构的选项,但您属于此处的基础研究领域.我建议您将查询定向到更多的学术"论坛.
哦,是的,顺便说一句,SIMD不能用于优化任何"代码. SIMD的应用领域非常狭窄,并且主要适用于Vector和Matrix运算,这使其非常适合图形和可视化.
SIMD is processor architecture. C# is a language that is compiled for a virtual "universal processor" (the CIL, or MSIL), which is then again optimised to run on the physical processor. As such, C# is very remote from the physical processor''s architecture. If C# was to take advantage of SIMD architectures, this would not be impossible, but it would be an effect of the porting of the CIL to an SIMD architecture, and of optimisations that lay way beyong the reach of C#. The latest incarnation of C# (4.0) already contain various optimisation possiblities towards parallelisation, but NOT optimisations towards SIMD architectures. If you want to look at code for SIMD architectures, you will have to (today) look at very much lower languages, and to my knowledge, at the pure assembly language (for example the instructions for Intel''s MMX instructions). Higher level-languages, like C#, or C, may attempt to profit from these instructions, but this will always be through their compilers attempt at optimisation. Now, there may be higher-level languages that offer you the option of targeting these architectures, but you are in the area of fundamental research here. I suggest you orient your query to more ''academic'' forum.
Oh, yes and BTW, SIMD cannot be used to optimise ''any'' code. The application area of SIMD is quite narrow, and mostly applies to Vector and Matrix operations, which makes it very well suited to graphics and visualisation.


无法在其中显式使用SIMD指令. .网.我很确定CLR将在可用的情况下使用它们,但是要确保在您自己的代码中使用它们,您必须在其他类似C/C ++/assembly的程序中使用SIMD编写例程,然后将它们作为单独的编译器进行编译.本机代码库,然后使用P/Invoke调用它们.
There is no way to explicitly use SIMD instructions in .NET. I''m pretty sure that the CLR will use them if available, but to ensure their use in your own code you''ll have to write the routines using SIMD in something else like C/C++/assembly, compile them as a separate library of native code, and call them using P/Invoke.


为此使用C或C ++,这将是满足您需求的更好选择.
Use C or C++ for this, that would be a better option for your requirement.


这篇关于单指令多数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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