Parallelism on single Core with .NET C# and SIMD / AVX. First Example.

AIdevOOPs
1,569 views

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

Welcome!

This C# code will shows to us a simple basic examples of SIMD / AVX. We will compare the sum of two arrays of integers without SIMD and with it. The performance increasing is awesome!

The source code is on GitHub, please feel free to come up with proposals to improve it.

Hands-on Demo

Run this ready to use benchmark
1
109
110
111
112
// {...}
public static void run_SIMD_AVX_on_CSharp(){
allBench(loop: 10000, arraySize: 500, rerun: 10); // array size will be multiplied by 16
}
//{...}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content