How to convert Half-Single to .NET with hardware acceleration?

I have a .NET application where half precision type works fine. To process this data type, there is an "old" C # project . However, Intel processors now offer hardware acceleration from half to one conversion . Does anyone know how to use such hardware acceleration in .NET?

+4
source share
2 answers

To be able to use the built-in CPU support for float16 in C #, you will have to use an unmanaged assembly (for example, C / C ++ dll) to process the data type itself and / or algorithms that depend on the type of float16. Invoking unmanaged code is simple enough using PInvoke , but if you do not have an Intel compiler, you will have to encode parts of the unmanaged library in assembler because MSVC does not directly support the compiler pragmas to generate the x86-64 assembly code needed for type float16.

, , , , , float16.

+3

Source: https://habr.com/ru/post/1618794/


All Articles