3 ms·
Writing SIMD routines can be quite easy, at least much more pleasant than using intrinsic mnemonics. My understanding is that Mojo's portable SIMD builds on to
by neonsunset 2y ago
Writing SIMD routines can be quite easy, at least much more pleasant than using intrinsic mnemonics.
My understanding is that Mojo's portable SIMD builds on top of LLVM vector MLIR dialect, which is good. If this is indeed true, it would make it competitive with C# cross-platform SIMD which usually means just creating variables typed as Vector128/256/512<T> and using either the regular arithmetic operators on them or VectorXXX.Shuffle/PairwiseSomething/etc. for SIMD-specific operations without ever touching mnemonics (those can be intermixed behind branches of if (Arm64?) if an ISA of your interest has a more specific instruction, and these still consume the same vector types). Example: https://github.com/dotnet/runtime/blob/7ffb9a44ab32cd96d5684c1560671695535ae2cb/src/libraries/Common/src/System/HexConverter.cs#L259-L322 https://github.com/dotnet/runtime/blob/7ffb9a44ab32cd96d5684...
Even higher level abstraction can be built on top of that, e.g. Triton or ISPC style (just no one has done that yet, it's a relatively new addition to the language, the closest one is System.Numerics.Tensors which is C#'s own baby BLAS).
I'm very interested in Mojo as it seems like one of the few options where moving away from C# wouldn't be a huge downgrade, giving all the performance bits while being built on top of LLVM, for now waiting until it is fully open-sourced and becomes a public project.
- cupofc0t 2y agoMojo doesn't use most of built-in dialects, they currently only use LLVM and Index dialect, as well as many custom dialects