We're unlikely to get that type of auto-vectorization in the JIT anytime soon. Such support doesn't often light up in practice either. -- Even for C++, it is less than 1% of cases in general code. Some domain specific scenarios (like games) can be higher, but even then specialized implementations tend to perform far better. So using things like Span or LINQ will often already get users the "right behavior". That being said, we are looking at solutions that would allow us to provide easier ways for users to vectorize their own code. Interceptors or source generators might be one possible solution, concrete APIs that take in a struct that does the core "compute kernel" and which handle all the leading/trailing handling, masking, and more are another possibility. I'll be sure to blog or give another talk about whatever we do come up with.
@@tannergooding4103 Am gonna use this opportunity to ask you for this: vectorisation already has some form of rounding like truncate, ceiling and floor. Is it going to get to a point of doing proper rounding like Math.Round(double,int) anytime soon?
Amazing talk. There should be more blogspots and books on Intrinsics and Numerics in .NET ❤
Great talk, we need more of this
Your passion for what you do is contagious.
Hi, thanks for the talk. Where can I find these samples? Do you have a link to github?
I think this was my favourite video of DotNet Conf 2023. Watched it twice, now just to find the sample code...
There was a discussion about using JITINTRINSIC attribute on a method, so that JIT can vectorize it. Is that possible in .NET 8?
We're unlikely to get that type of auto-vectorization in the JIT anytime soon. Such support doesn't often light up in practice either. -- Even for C++, it is less than 1% of cases in general code. Some domain specific scenarios (like games) can be higher, but even then specialized implementations tend to perform far better. So using things like Span or LINQ will often already get users the "right behavior".
That being said, we are looking at solutions that would allow us to provide easier ways for users to vectorize their own code. Interceptors or source generators might be one possible solution, concrete APIs that take in a struct that does the core "compute kernel" and which handle all the leading/trailing handling, masking, and more are another possibility.
I'll be sure to blog or give another talk about whatever we do come up with.
@@tannergooding4103 Am gonna use this opportunity to ask you for this: vectorisation already has some form of rounding like truncate, ceiling and floor. Is it going to get to a point of doing proper rounding like Math.Round(double,int) anytime soon?