Basics

SIMT APIs are not supported in pure SIMT programming scenarios.

This section describes how to use the SIMT API for SIMT programming.

Different from SIMD programming, in SIMT programming, data on the Global Memory can be directly read and used. During SIMT programming, data is tiled by organizing thread hierarchies. SIMT BuiltIn keywords such as threadIdx are used to compute the data index to be processed by a thread and complete the compute of the corresponding data. In this way, the function implementation is simplified to scalar compute.

SIMT is the single-instruction multi-thread programming abstraction of Ascend C. It allows an instruction to independently address data, which is more flexible. As shown in the following figure, for operators with discrete access (such as Scatter and Gather operators), SIMT programming is suitable for implementation. In addition, threads can be executed independently. Each thread is highly flexible and can execute different logic branches to implement complex logic.