F# 中的 SSE3 指令
如何使用 SSE3 指令集并行化我的 F# 程序? F#编译器支持吗?
How do I parallelize my F# program using SSE3 instruction set? Does the F# compiler support it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
.Net 不与该级别的硬件通信。如果您想显式控制所使用的指令集,则需要调用以更合适的语言编写的库。我想到了 C/C++。
.Net doesn't talk to the hardware at that level. If you want explicit control over the instruction set used, you'll need to call out to a library written in a more appropriate language. C/C++ comes to mind.
我对此一无所知,但是:
链接
I don't know anything about this, but:
Link
可能没用,但您可以使用委托上的内部字段来使其调用任意代码: http://www.atrevido.net/blog/2005/01/28/Inline+X86+ASM+In+C.aspx
查看评论了解更多注意事项和其他方法。直接使用委托目标的好处是(AFAIK)您不会像使用 GetDelegateForFunctionPointer 或其他互操作方法一样获得托管-非托管转换。
不利的一面是,这意味着您必须手动编码并确保调用约定一致等等。它可能很脆弱,并且委托调用开销可能使其不值得。
Probably not useful, but you can play with the internal fields on a delegate to make it call to arbitrary code: http://www.atrevido.net/blog/2005/01/28/Inline+X86+ASM+In+C.aspx
See the comments for more caveats and other approaches. The benefit of playing with a delegates target directly is (AFAIK) you won't get a managed-unmanaged transition as if you did GetDelegateForFunctionPointer or other interop approaches.
On the downside, this means you have to code it by hand and make sure the calling conventions line up and so on. It's probably fragile, and the delegate call overhead might make it not worth it.