Who is this for?

This Learning Path is an advanced topic for developers who want to accelerate the performance of matrix multiplication using Arm's Scalable Matrix Extension Version 2 (SME2).

What will you learn?

Upon completion of this Learning Path, you will be able to:

  • Implement a baseline matrix multiplication kernel in C without SME2
  • Use SME2 assembly instructions to accelerate matrix multiplication performance
  • Use SME2 intrinsics to vectorize and optimize matrix multiplication
  • Compile code with SME2 intrinsics and assembly
  • Benchmark and validate SME2-accelerated matrix multiplication on Arm hardware or in a Linux-based emulation environment
  • Compare performance metrics between baseline and SME2-optimized implementations

Prerequisites

Before starting, you will need the following:

  • Working knowledge of Arm’s SVE and SME2 instruction sets
  • Intermediate proficiency with the C programming language and the Armv9-A assembly language
  • A computer running Linux, macOS, or Windows
  • Installations of Git, CMake and Ninja for project setup
  • A platform that supports SME2 - see the list of devices with SME2 support or an emulator to run code with SME2 instructions
  • Installation of Docker for SME2 emulation (if you don’t have SME2 available)
  • Installation of Android Development Studio and adb (if you’re targeting an Android phone with SME2 support)
  • Compiler support for SME2 instructions (for example, LLVM 18 or later with SME2 backend support)

Summary

AI-assisted

This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
You’ll start with a baseline C matrix-multiplication kernel, then build SME2-accelerated versions with intrinsics and assembly either on supported Arm hardware or an emulator. You’ll verify the toolchain with CMake, learn how SME streaming mode and ZA state work through Arm C Language Extensions, and implement a row-major reference kernel. Then, you’ll benchmark SME2 versions and validate them against the baseline.

Frequently asked questions

AI-assisted

These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
Should I use native SME2 hardware or emulation?
Use native SME2 hardware if you have a supported device, such as a Mac with an M4 chip or some Android phones. Otherwise, use the emulation option and check the setup section’s device list for native support.
CMake is finding the wrong Clang. What should I do?
Point CMake to the intended Clang when configuring the project. The system default might not support SME2, so select the compiler as described in the environment check.
How do I verify the environment is ready before continuing?
Build the examples in code-examples/learning-paths/cross-platform/multiplying-matrices-with-sme2 using CMake. A successful build and run confirms that the toolchain, compiler, and hardware or emulator are configured correctly.
When should I enable streaming mode, and do I need to handle ZA state myself?
Enable streaming mode on functions that use SME features by applying the appropriate Arm C Language Extensions. The compiler manages streaming transitions and ZA save and restore, so you don’t implement those operations manually.
What result should I expect from the baseline C matrix multiplication?
The baseline row-major implementation computes the reference output matrix. Keep that result and compare it with the intrinsics and assembly versions during benchmarking and validation.
Next