C for Metal Software Development Kit (CM SDK)
Overview
C for Metal (CM) is a programming language that allows for creation of high-performance compute and media kernels for Intel® GPUs using an explicit Single Instruction Multiple Data (SIMD) programming model. CM is based on a restricted C++ specification with extensions to support new SIMD constructs and data types, inline assembly, and access to architecture-specific hardware features.
OpenCL™ and SYCL* applications use an implicit SIMD programming model where a kernel (code running on a GPU) operates on a single unit of the data space, for example, a work item in OpenCL code. Intel® Graphics Compiler is responsible for vectorizing kernel code based on hardware-supported SIMD width, with each SIMD lane corresponding to a work item. Implicit model is simple and relatively easy to program for purely data-parallel programs and can satisfy most use cases.
CM uses an explicit SIMD programming model where a kernel contains SIMD constructs that provide fine control of data space layout and operations. Intel® Graphics Compiler is responsible for translating these constructs into appropriate vector instructions. Explicit model is harder to program, but provides higher throughput for the programs with mixed serial/parallel execution and irregular memory accesses.
Features of CM language:
- Predefined vector and matrix types, which are mapped to general register files (GRF)
- Explicit control of data layout (for example, transpose) in GRF, and data movement and caching
- Explicit parallelism expressed via vector and matrix operations
- Mixing SIMD widths within single kernel
- Cross SIMD-lane operations via vector and matrix operations
C for Metal Software Development Kit (CM SDK)
Use this collection of software components to create applications written in the CM language. To accommodate the industry focus on using GPUs for high-performance computing (HPC) and AI applications, the primary target for CM SDK is developers who design high-performance compute applications for Intel GPUs.
Note Targeted development of media kernels in the Intel® C for Metal Development Package is deprecated in favor of CM SDK.
A typical application developed for GPUs is made up of kernel code and host code. Kernel code is written in languages such as CM or OpenCL™ code, and contains instructions that run on GPUs. Host code is written in languages such as C or C++, and uses runtime API functions to set up a kernel for running on a GPU: load kernel code into memory, set up arguments and runtime parameters, and more.
There are currently two distinct runtime APIs that are available in CM SDK:
This industry-standard API can be used with CM and OpenCL™ applications. It's used primarily for compatibility with legacy applications. Although it's supported, no new features are planned. So, Intel encourages all users to use the Level0 API for CM application development.
This open source, unified API provides fine control of running GPUs. It's a part of oneAPI and reflects Intel's long-term software contract. Intel actively develops and maintains it.
Note It is recommended to use Level Zero API for CM SDK application development because in most cases, new features are added to this API.
For more information, see the documentation folder inside the CM SDK package.
If you have issues, report them to GitHub.
Legacy Tools & Downloads
Access prior versions of the C for Metal development package that uses C for Metal Runtime API.
Explore the world of Intel’s open platform projects, contributions, community initiatives, and more at open.intel.com. |