Re: System.Numerics.Vector not accelerated

Alexander Köplinger via Mono-list <[email protected]> Tue, 16 May 2017 13:32:26 +0000
Newsgroups gmane.comp.gnome.mono.general
Message-ID <[email protected]>
--===============9104711838600115075==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_B786B4C739444D54915ED2154C4F518Bmicrosoftcom_"

--_000_B786B4C739444D54915ED2154C4F518Bmicrosoftcom_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hey,

this was fixed with https://github.com/mono/mono/pull/4762 and should show =
up in the Mono 5.2 release (which should be in the alpha channel soon).

- Alex

On 16 May 2017, at 14:59, Natalia Portillo <[email protected]<mailto:clau=
[email protected]>> wrote:

Hi all,

I've created a little test of MD5 using the System.Cryptography implementat=
ion as well as Mono.Simd and System.Numerics.Vectors.

I've got the following unexpected results:
1.- IsHardwareAccelerated is false in Mono 5.0.0.100 in Linux and macOS. It=
's true in Windows .NET (VS2017 sdk)
2.- Vectors is THOUSANDS of times slower than crypto, managed and mono.simd=
 versions even when accelerated.
3.- Mono.Simd is still slower than just managed.

I don't know if this is a bug or I'm using the intrinsics in an inadequate =
way.

The code is available for inspection in https://na01.safelinks.protection.o=
utlook.com/?url=3Dhttps%3A%2F%2Fgithub.com%2Fclaunia%2FTestSIMD&data=3D02%7=
C01%7Calkpli%40microsoft.com%7C144d2ea4005f459b8c9f08d49c5b6600%7C72f988bf8=
6f141af91ab2d7cd011db47%7C1%7C0%7C636305363754917255&sdata=3D32YqIVi8vguZnu=
pUKmQuE%2B0cH%2BUnK3Vd0ywuUb%2Ft7m0%3D&reserved=3D0

Regards,
Natalia Portillo
Sent from my iPhone
_______________________________________________
Mono-list maillist  -  [email protected]<mailto:[email protected]=
et>
https://na01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Flists.dot=
.net%2Fmailman%2Flistinfo%2Fmono-list&data=3D02%7C01%7Calkpli%40microsoft.c=
om%7C144d2ea4005f459b8c9f08d49c5b6600%7C72f988bf86f141af91ab2d7cd011db47%7C=
1%7C0%7C636305363754917255&sdata=3DmZhk52BdjnaBbWKI0%2B6csF5WEYWf0HcbwSFQH%=
2BxDfHY%3D&reserved=3D0


--_000_B786B4C739444D54915ED2154C4F518Bmicrosoftcom_
Content-Type: text/html; charset="iso-8859-1"
Content-ID: <[email protected]>
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
</head>
<body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-lin=
e-break: after-white-space;" class=3D"">
Hey,
<div class=3D""><br class=3D"">
</div>
<div class=3D"">this was fixed with&nbsp;<a href=3D"https://github.com/mono=
/mono/pull/4762" class=3D"">https://github.com/mono/mono/pull/4762</a>&nbsp=
;and should show up in the Mono 5.2 release (which should be in the alpha c=
hannel soon).</div>
<div class=3D""><br class=3D"">
</div>
<div class=3D"">- Alex</div>
<div class=3D""><br class=3D"">
<div>
<blockquote type=3D"cite" class=3D"">
<div class=3D"">On 16 May 2017, at 14:59, Natalia Portillo &lt;<a href=3D"m=
ailto:[email protected]" class=3D"">[email protected]</a>&gt; wrote:</d=
iv>
<br class=3D"Apple-interchange-newline">
<div class=3D"">
<div class=3D"">Hi all,<br class=3D"">
<br class=3D"">
I've created a little test of MD5 using the System.Cryptography implementat=
ion as well as Mono.Simd and System.Numerics.Vectors.<br class=3D"">
<br class=3D"">
I've got the following unexpected results:<br class=3D"">
1.- IsHardwareAccelerated is false in Mono 5.0.0.100 in Linux and macOS. It=
's true in Windows .NET (VS2017 sdk)<br class=3D"">
2.- Vectors is THOUSANDS of times slower than crypto, managed and mono.simd=
 versions even when accelerated.<br class=3D"">
3.- Mono.Simd is still slower than just managed.<br class=3D"">
<br class=3D"">
I don't know if this is a bug or I'm using the intrinsics in an inadequate =
way.<br class=3D"">
<br class=3D"">
The code is available for inspection in <a href=3D"https://na01.safelinks.p=
rotection.outlook.com/?url=3Dhttps%3A%2F%2Fgithub.com%2Fclaunia%2FTestSIMD&=
amp;data=3D02%7C01%7Calkpli%40microsoft.com%7C144d2ea4005f459b8c9f08d49c5b6=
600%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636305363754917255&amp;sda=
ta=3D32YqIVi8vguZnupUKmQuE%2B0cH%2BUnK3Vd0ywuUb%2Ft7m0%3D&amp;reserved=3D0"=
 class=3D"">
https://na01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgithub.c=
om%2Fclaunia%2FTestSIMD&amp;data=3D02%7C01%7Calkpli%40microsoft.com%7C144d2=
ea4005f459b8c9f08d49c5b6600%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63=
6305363754917255&amp;sdata=3D32YqIVi8vguZnupUKmQuE%2B0cH%2BUnK3Vd0ywuUb%2Ft=
7m0%3D&amp;reserved=3D0</a><br class=3D"">
<br class=3D"">
Regards,<br class=3D"">
Natalia Portillo<br class=3D"">
Sent from my iPhone<br class=3D"">
_______________________________________________<br class=3D"">
Mono-list maillist &nbsp;- &nbsp;<a href=3D"mailto:[email protected]"=
 class=3D"">[email protected]</a><br class=3D"">
<a href=3D"https://na01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%=
2Flists.dot.net%2Fmailman%2Flistinfo%2Fmono-list&amp;data=3D02%7C01%7Calkpl=
i%40microsoft.com%7C144d2ea4005f459b8c9f08d49c5b6600%7C72f988bf86f141af91ab=
2d7cd011db47%7C1%7C0%7C636305363754917255&amp;sdata=3DmZhk52BdjnaBbWKI0%2B6=
csF5WEYWf0HcbwSFQH%2BxDfHY%3D&amp;reserved=3D0" class=3D"">https://na01.saf=
elinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Flists.dot.net%2Fmailman%2=
Flistinfo%2Fmono-list&amp;data=3D02%7C01%7Calkpli%40microsoft.com%7C144d2ea=
4005f459b8c9f08d49c5b6600%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6363=
05363754917255&amp;sdata=3DmZhk52BdjnaBbWKI0%2B6csF5WEYWf0HcbwSFQH%2BxDfHY%=
3D&amp;reserved=3D0</a><br class=3D"">
</div>
</div>
</blockquote>
</div>
<br class=3D"">
</div>
</body>
</html>

--_000_B786B4C739444D54915ED2154C4F518Bmicrosoftcom_--

--===============9104711838600115075==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KTW9uby1saXN0
IG1haWxsaXN0ICAtICBNb25vLWxpc3RAbGlzdHMuZG90Lm5ldApodHRwOi8vbGlzdHMuZG90Lm5l
dC9tYWlsbWFuL2xpc3RpbmZvL21vbm8tbGlzdAo=

--===============9104711838600115075==--