Brussels / 2 & 3 February 2019


Intel® Hardware Intrinsics in .NET Core

In this presentation, we will talk about the Intel Hardware Intrinsics in .NET Core, a new feature in .NET Core 3.0. For the first time, .NET developers will have the ability to directly exercise underlying CPU features, very similar to what C/C++ developers could do with intrinsic functions for their performance critical code. The Intel Hardware Intrinsics in .NET Core include more than 1300 intrinsic functions, which cover the instruction set architecture (ISA) SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, FMA, LZCNT, POPCNT, BMI1, BMI2, PCLMULQDQ, and AES. Many of the intrinsic functions are designed for Single Instruction Multiple Data (SIMD) computation, a common used technology to speed up computation intensive algorithms. To illustrate the benefits of using Hardware Intrinsics, we implemented a Structure of Array (SoA) based RayTracer and compared its performance with that of the traditional Array of Structure (AoS) based RayTracer which uses System.Numerics.Vectors. Our experience shows that up to 7x performance improvement is possible when using Hardware Intrinsics for this particular application. Another use case is ML.NET, an open source machine learning framework for .NET developers, which leverages the Intel Hardware Intrinsics to accelerate machine learning scenarios. The average performance gain of the key math operations is up to 20% while the training phase of K-means clustering can be made faster by up to 14%.

We will give an overview of SIMD and the Intel Hardware Intrinsics in .NET Core. In addition, we will talk about the differences of System.Numerics.Vectors and System.Runtime.Intrinsics, which are the two different ways to use SIMD in .NET Core. What’s more, we will use code samples and/or live demos such as Cyclic Redundancy Check (CRC32) and Matrix Multiplication to show how to use them. By the end of the presentation, the audience will learn the current status of the Intel Hardware Intrinsics in .NET Core and how to use the Intel Hardware Intrinsics to speed up their code.


Han Lee