问题描述
我有一些用 c# 编写的神经网络代码,可以从使用 SIMD 支持.Mono 2.2 刚出来支持 SIMD 但微软的 c#还不支持这个.对我的 c# 设置感到满意,我想知道是否可以为该片段编写一个单声道库并从 .net 调用它.
I have some neural net code written in c# that would benefit from using SIMD support. Mono 2.2 just came out that supports SIMD but Microsoft's c# does not support this yet. Being happy with my c# setup I was wondering if I could write a lib in mono for that piece and call it from .net.
我想我真正想知道的是是否可以将 mono 编译成类似于 DLL 的东西然后我可以从 dotnet 调用.我在 Miguel de Icaza/default.aspx?showID=157" rel="noreferrer">podcast 说对于 iphone,mono 编译器将允许他们编译为月光的 exe,因此它不会违反 iphone 的服务条款所以这让我开始思考你还能编译成什么.
I guess what I really want to know is it possible to compile mono down to something like a DLL that I then can call from dotnet. I heard Miguel de Icaza on a podcast saying that for the iphone the mono compiler would allow them to compile down to an exe for moonlight so it did not violate the terms of service for iphone so it got me thinking what else can you compile to.
我在另一个播客 Herding Code Episode 28 上听说 Miguel de Icaza 说您可以使用mono 编译器编译为 exe,而不仅仅是中间代码.这意味着什么?
I heard Miguel de Icaza on another pod cast Herding Code Episode 28 say that you could use the mono complier to compile to an exe not just to intermediate code. What are the implications of this?
这引起了我的好奇心,所以我想我会悬赏它.
This got my curiosity up so I thought that I would throw a bounty at it.
推荐答案
本质上,如果你用 Simd 编写它并用你的代码分发 dll,如果目标 VM 支持它,它将使用加速.如果没有,它不会破裂.因此,您可以使用该库并为您的程序中使用 Mono 运行 .NET 应用程序的任何用户提供速度提升.
Essentially, if you write it with Simd and distribute the dll with your code, it will use acceleration if the target VM supports it. If not, it doesn't break. So you can use the library and give any users of your program who run .NET apps with Mono a speed boost.
据说微软计划在其运行时的下一个版本中添加此类支持,但我找不到该链接,并且这一秒也没有它——可以从历史备份中挖掘链接如果有人足够感兴趣.
Microsoft has been said to be planning to add such support in its next release of its runtime, though I cannot find the link and don't have it handy right this sec---can dig the link out of a historic backup if anyone is interested enough.
这篇关于从 Microsoft .net 调用 mono c# 代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!