从Microsoft .net调用单c#代码? [英] Calling mono c# code from Microsoft .net?

查看:127
本文介绍了从Microsoft .net调用单c#代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些在c#中编写的神经网络代码,可以使用 SIMD 支持。 Mono 2.2 刚出来支持SIMD,但Microsoft的c#不支持这个。对我的c#设置感到高兴我想知道我是否可以为单片写一个lib并从.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 。 com / default.aspx?showID = 157rel =nofollow noreferrer> podcast 说,对于iphone单声道编译器将允许他们编译到一个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.

我听说Miguel de Icaza在另一个podcast Herding Code Episode 28 说,你可以使用单声道编译器来编译为一个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,如果目标虚拟机支持它,它将使用加速。如果没有,它不会打破。因此,您可以使用该库,并为您的程序的任何用户运行.NET应用程序与Mono的速度提升。

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据说计划添加这样的支持在它的下一个版本的运行时,虽然我找不到链接,没有它的方便的这一秒---如果有人足够感兴趣,可以挖掘历史备份的链接。

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调用单c#代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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