Introduction

Currently, SIMT APIs support only SIMD and SIMT programming. The SIMT programming will be supported in later versions.

SIMT APIs are parallel computing programming interfaces oriented to AI processors. They implement efficient parallel data computing based on the SIMT programming model. For details about API classification, see Table 1. In the SIMT programming, every 32 threads are divided into a group, which is called a warp. Warp-level APIs are used to process data of 32 threads in a single warp. Each thread in a warp is called a lane, and the number of each thread in a warp is the lane ID which ranges from 0 to 31.

Table 1 SIMT C API classification

Category

Function

Kernel Function Definition

Used to start a SIMT Vector Function (VF) subtask to launch a specified number of threads for executing the specified SIMT kernel function in SIMD and SIMT programming.

Synchronization Functions

Memory management and synchronization APIs, which are used to resolve data races and thread synchronization issues between threads in different cores.

Mathematical Functions

A set of functions used to process mathematical operations.

Precision Conversion

A series of APIs for converting between different precision types.

Comparison Function

Used to determine whether the data is finite, infinite, or NaN.

Atomic Function

A series of APIs that perform atomic operations on the data or specific data in the Unified Buffer or Global Memory.

Warp Function

A series of APIs for processing data of 32 threads in a single warp.

Type Conversion

Used to convert precisions based on the data types of the source and destination operands.

Vector Type Constructor

Vector type construction APIs.

Load/Store Functions with Cache Hints

Data loading and caching APIs.

Commissioning APIs

APIs used in the SIMT VF debugging scenario.

Ascend C SIMT APIs can call APIs whose input data types are not half, half2, bfloat16_t, bfloat16x2_t, hifloat8x2_t, float8_e4m3x2_t or float8_e5m2x2_t by including the simt_api/asc_simt.h file. The simt_api/asc_fp16.h file is required for calling SIMT APIs whose input data is of the half or half2 type, the simt_api/asc_bf16.h file is required for calling SIMT APIs whose input data is of the bfloat16_t or bfloat16x2_t type, and the simt_api/asc_fp8.h file is required for calling SIMT APIs whose input data is of the hifloat8x2_t, float8_e4m3x2_t, or float8_e5m2x2_t type.

1
2
3
4
#include "simt_api/asc_simt.h"
#include "simt_api/asc_fp16.h"
#include "simt_api/asc_bf16.h"
#include "simt_api/asc_fp8.h"
Table 2 Header file to be included in SIMT C APIs

Category

Any Other Type Excluding half, half2, bfloat16, and bfloat16x2_t

half and half2

bfloat16_t and bfloatx2_t

hifloat8x2_t, float8_e4m3x2_t and float8_e5m2x2_t

Kernel Function Definition

#include "simt_api/common_functions.h"

#include "simt_api/asc_fp16.h"

#include "simt_api/asc_bf16.h"

#include "simt_api/asc_fp8.h"

Synchronization Functions

#include "simt_api/device_sync_functions.h"

Mathematical Functions

Precision Conversion

#include "simt_api/math_functions.h"

Atomic Function

#include "simt_api/device_atomic_functions.h"

Warp Function

#include "simt_api/device_warp_functions.h"

Type Conversion

Load/Store Functions with Cache Hints

#include "simt_api/device_functions.h"

Vector Type Constructor

#include "simt_api/vector_functions.h"