Ascend C APIs
- Basic data structures: basic data structures used in kernel APIs, such as GlobalTensor and LocalTensor.
- C APIs at the language extension layer: Open the complete programming capabilities of chips, support memory allocation for arrays, and generally use pointer-based programming, providing a consistent C language programming experience with the industry.
- Basic APIs: implement abstract hardware capabilities and open chip capabilities to ensure completeness and compatibility. The APIs marked as Instruction Set Architecture Special Interface (ISASI, hardware architecture-related APIs) do not guarantee compatibility across hardware versions.
- High-level APIs: implement common compute algorithms to improve programming and development efficiency based on basic APIs. High-level APIs include math library, Matmul, Softmax, and others, and ensure compatibility.
- Single Instruction Multiple Thread (SIMT) APIs: implement parallel computation by executing a single instruction across multiple threads. SIMT programming is mainly used for vector computing and is particularly well-suited for handling discrete memory access and complex control logic.
- Utils APIs (common auxiliary functions): provide various common utility classes, covering functions such as standard library, platform information acquisition, runtime compilation, and log output. These APIs empower you to efficiently develop operators and optimize performance.

Basic Data Structure
|
API |
Function |
|---|---|
|
LocalTensor is used to store data in the local memory of the AI Core. It supports the logical positions (TPosition) VECIN, VECOUT, VECCALC, A2, B1, B2, CO1, and CO2. |
|
|
Stores the global data of the global memory (external storage). |
|
|
Coordinate is essentially a tuple, and is used to indicate location information of a tensor in different dimensions, that is, a coordinate value. |
|
|
The Layout<Shape, Stride> data structure is a basic template class that describes the memory layout of multi-dimensional tensors. It implements the mapping from the logical coordinate space to the one-dimensional memory address space based on the shape and stride information at compile time, providing fundamental support for complex tensor operations and hardware optimization. |
|
|
The TensorTrait data structure is a basic template class that describes tensor-related information, including the tensor data type, logical position, and layout memory layout. |
Basic APIs
|
API |
Function |
|---|---|
|
Performs data movement, including common data movement, enhanced data movement, tiled data movement, and real-time format conversion. |
|
|
Performs the movement instruction between VECIN, VECCALC, and VECOUT, and supports the mask operation and Data Block interval operation. |
|
Category |
API |
Function |
|---|---|---|
|
Basic Arithmetic |
Computes the natural exponent based on elements. |
|
|
Computes the natural logarithm based on elements. |
||
|
Computes the absolute value based on elements. |
||
|
Computes the reciprocal based on elements. |
||
|
Extracts the square root based on elements. |
||
|
Computes the reciprocal after square root extraction based on elements. |
||
|
Performs a ReLU operation based on elements. |
||
|
Performs addition based on elements. |
||
|
Performs subtraction based on elements. |
||
|
Performs multiplication based on elements. |
||
|
Performs division based on elements. |
||
|
Computes the maximum value based on elements. |
||
|
Computes the minimum value based on elements. |
||
|
Performs addition between a scalar and a vector element-wise. |
||
|
Performs multiplication between a scalar and a vector element-wise. |
||
|
Compares each element of a vector with a scalar and returns the larger one. |
||
|
Compares each element of a vector with a scalar and returns the smaller one. |
||
|
Computes Leaky ReLU on the source operand element-wise. |
||
|
Basic Arithmetic |
Performs subtraction between a scalar and each element of a vector. The scalar can be before or after the vector. The scalar input can be a single element from a LocalTensor. |
|
|
Performs division between a scalar and each element of a vector. The scalar can be before or after the vector. The scalar input can be a single element from a LocalTensor. |
||
|
Logical Computation |
Performs bitwise Not based on elements. |
|
|
Performs a bitwise AND operation based on elements. |
||
|
Performs a bitwise OR operation based on elements. |
||
|
Performs left shift on the source operand element-wise. The shift distance is determined by scalarValue. |
||
|
Performs right shift on the source operand element-wise. The shift distance is determined by scalarValue. |
||
|
Logical Computation |
Performs bitwise AND between a scalar and each element of a vector. The scalar can be before or after the vector. The scalar input can be a single element from a LocalTensor. |
|
|
Performs bitwise OR between a scalar and each element of a vector. The scalar can be before or after the vector. The scalar input can be a single element from a LocalTensor. |
||
|
Compound Computation |
Adds the product of each element in the source operand and a scalar to the corresponding element in the destination operand. |
|
|
Quantizes the input and converts the precision. |
||
|
Adds inputs element-wise, compares the result with 0, and selects the larger value. |
||
|
Adds inputs element-wise, compares the result with 0, selects the larger value, and converts precision based on the data types of the source and destination operand tensors. |
||
|
Adds inputs element-wise, performs Deq quantization on the result, and then performs ReLU calculation on the result (compares the result with 0 and selects the larger value). |
||
|
Computes the difference element-wise, compares the result with 0, and selects the larger value. |
||
|
Computes the difference element-wise, compares the result with 0, selects the larger value, and converts precision based on the data types of the source and destination operand tensors. |
||
|
Multiplies src0Local and src1Local element-wise, adds them to dstLocal, and saves the final result to dstLocal. |
||
|
Performs element-wise manipulation and converts the precision based on the data types of the source and destination operand tensors. |
||
|
Multiplies src0Local and dstLocal element-wise, adds src1Local, and saves the result to dstLocal. |
||
|
Multiplies src0Local and dstLocal element-wise, adds them to src1Local, compares the result with 0, selects the larger value, and saves the final result to dstLocal. |
||
|
Comparison and Selection |
Compares the sizes of two tensors element by element. If the comparison result is true, the corresponding bit of the output result is 1. Otherwise, the bit is 0. |
|
|
Compares the sizes of two tensors element by element. If the comparison result is true, the corresponding bit of the output result is 1. Otherwise, the bit is 0. This interface can be used when the mask parameter is required. The result is stored in a register. |
||
|
Compares the sizes of an element in a tensor with that of a scalar element by element. If the comparison result is true, the corresponding bit of the output result is 1. Otherwise, the bit is 0. |
||
|
Selects the source operand src0 or src1 based on the bit value of selMask (mask used for selection) to obtain the destination operand dst. When the bit value of selMask is 1, src0 is selected. When the bit value of selMask is 0, src1 is selected. |
||
|
Selects elements from the source operand and writes them to the destination operand based on a gather mask (for data collection) that corresponds to either the binary of the built-in fixed mode or the binary of the user-defined input tensor values. |
||
|
Precision Conversion Instructions |
Converts precision based on the data types of the source and destination operand tensors. |
|
|
Reduction Computation |
Obtains the maximum value and its corresponding index position among the input data. |
|
|
Obtains the minimum value and its corresponding index position among the input data. |
||
|
Sums up all input data. |
||
|
Computes the maximum value and index of all data in each repeat. |
||
|
Computes the minimum value and index of all data in each repeat. |
||
|
Sums all data in each repeat. |
||
|
Computes the maximum of all elements in each repeat. |
||
|
Computes the minimum of all elements in each repeat. |
||
|
Sums all elements in each repeat. Source operands are added in binary tree mode. |
||
|
Sums two adjacent (odd and even) elements. |
||
|
Sums all data in each repeat. Compared with WholeReduceSum, it does not support the bitwise mask mode. You are advised to use WholeReduceSum with more comprehensive functions. |
||
|
Data Conversion |
Performs transpose on data blocks of a 16 × 16 2D matrix, and conversion between [N,C,H,W] and [N,H,W,C]. |
|
|
Converts the NCHW format to the NC1HWC0 format. It can also be used for transposing a two-dimensional matrix data block. |
||
|
Data Padding |
Copies a variable or an immediate value multiple times and fills the result into a vector. |
|
|
Extracts eight elements from a given input tensor each time and fills them in eight data blocks (32 bytes) in the result tensor. Each element corresponds to a data block. |
||
|
Creates the vector index with firstValue as the start value. |
||
|
Data Scatter/Data Gather |
Gathers given input tensors by element to the result tensor based on the offset address tensor provided. |
|
|
Mask Operations |
Sets mask to counter mode. In this mode, you do not need to perceive the number of iterations or process unaligned tail blocks. You can directly pass in the amount of data to be computed. The actual number of iterations is automatically inferred by the Vector Unit. |
|
|
Sets mask to normal mode. This mode is the default mode. You can configure the number of iterations. |
||
|
Sets mask during Vector computation. |
||
|
Restores the mask value to the default (all 1s), indicating that all elements in each iteration participate in the Vector computation. |
||
|
Quantization Settings |
Sets the value of the DEQSCALE register. |
|
API |
Function |
|---|---|
|
Obtains the number of 0s or 1s in a binary number of the uint64_t type. |
|
|
Computes the number of leading 0s of a uint64_t number (number of 0s from the most significant bit to the first 1 in the binary number). |
|
|
Converts the type of a scalar to a specified type. |
|
|
Computes the number of consecutive bits that are the same as the sign bit from the most significant bit in the binary number of the uint64_t type. |
|
|
Obtains the location where the first 0 or 1 appears in a binary number of the uint64_t type. |
|
|
Converts scalar data of the float type to scalar data of the bfloat16_t type. |
|
|
Converts scalar data of the bfloat16_t type to scalar data of the float type. |
|
API |
Function |
|---|---|
|
Manages resources such as the global memory. It allocates and manages resources such as memory. |
|
|
Obtains the TPipe pointer for the Global Memory managed by the framework. After obtaining the pointer, you can perform TPipe-related operations. |
|
|
Manually manages or reuses the Unified Buffer/L1 Buffer physical memory. It is mainly used when the Unified Buffer/L1 Buffer physical memory is insufficient in multi-stage computing. |
|
|
Performs EnQue and DeQue operations, and implements inter-task synchronization through queues. |
|
|
Binds the source and destination logical locations to determine the memory allocation location and insert the corresponding synchronization event, solving problems such as memory allocation, management, and synchronization. |
|
|
Manages the memory occupied by some temporary variables used during Ascend C programming. The memory occupied by these temporary variables can be managed using the TBuf data structure. |
|
|
Initializes the SPM buffer. |
|
|
Copies the data that needs to be temporarily stored due to overflow into the SPM Buffer. |
|
|
Reads data from the SPM buffer back to the local data. |
|
|
Obtains the workspace pointer used by the user. |
|
|
Sets the pointer to the system workspace, as the system workspace is used by the framework communication mechanism during fused operator programming. |
|
|
Obtains the pointer to the system workspace. |
|
API |
Function |
|---|---|
|
Provides synchronization control. You can use these types of APIs to implement synchronization control. |
|
|
When different AI Cores operate the same global memory block, this function can be called to synchronize the AI Cores to avoid data dependency problems such as write-after-read, read-after-write, and write-after-write. IBSet is called to set the flag bit of a core. IBSet and IBWait are used in pairs to indicate the synchronization waiting instruction between cores, waiting for the completion of a core operation. |
|
|
When different AI Cores operate the same global memory block, this function can be called to synchronize the AI Cores to avoid data dependency problems such as write-after-read, read-after-write, and write-after-write. IBWait and IBSet are used in pairs to indicate the synchronization waiting instruction between cores, waiting for the completion of a core operation. |
|
|
When different AI Cores operate the same global memory block, this function can be called to synchronize the AI Cores to avoid data dependency problems such as write-after-read, read-after-write, and write-after-write. Currently, multi-core synchronization is classified into hardware synchronization and software synchronization. Hardware synchronization uses hardware-provided all-core synchronization instructions to ensure multi-core synchronization. Software synchronization is implemented through software algorithms. |
|
|
Initializes the value of the GM shared memory. WaitPreBlock and NotifyNextBlock can be called only after the initialization is complete. |
|
|
Reads the value in the GM address to determine whether to continue to wait. When the GM value meets the waiting condition of the current core, the core can proceed to the next operation. |
|
|
Writes the GM address to notify the next core that the operation of the current core is completed and the next core can perform the operation. |
|
|
Is called in the subkernels of SuperKernel. After the call, the instructions can be executed in parallel with subsequent subkernels, improving the overall performance. |
|
|
Is called in the subkernels of SuperKernel. Before the call, the instructions can be executed in parallel with earlier subkernels, improving the overall performance. |
|
API |
Function |
|---|---|
|
Preloads data from the specific DDR address where the source address is located to the data cache. |
|
|
Refreshes the cache to ensure cache consistency. |
|
API |
Function |
|---|---|
|
Sets whether to perform atomic addition for data transfer from VECOUT to GM, from L0C to GM, or from L1 to GM. The addition data type can be set based on different parameters. |
|
|
Sets different atomic operation data types using template parameters. |
|
|
Clears the status of an atomic operation. |
|
|
Performs atomic addition on the specified global memory address. |
|
|
Performs atomic minimization on the specified global memory address. |
|
|
Performs atomic maximization on the specified global memory address. |
|
|
Performs an atomic comparison on the specified global memory address. If the current value at that address equals value1, it is replaced with value2. Otherwise, the value at the global memory address remains unchanged. |
|
|
Performs an atomic exchange operation in the global memory. Specifically, it reads data from the specified global memory address, stores the new value back to the same address, and returns the old value. |
|
API |
Function |
|---|---|
|
Dumps the content of specified tensors for operators developed based on operator projects. |
|
|
Implements the formatted output function in CPU- or NPU-side debugging for operators developed based on operator projects. |
|
|
Provides an API for implementing the assert function in both the CPU domain and NPU domain. When the assert condition is not met, the system outputs the assert information and prints it in a formatted manner on the screen. |
|
|
Implements the assert function in CPU/NPU for operators developed based on operator projects. |
|
|
Dumps the content of specified tensors for operators developed based on operator projects. This API can be used to print tensors at a specified offset position. |
|
|
Provides the timestamp logging function to mark key execution points in the operator kernel code. |
|
|
Stops the kernel when a software exception occurs. |
|
|
Creates shared memory during verification of the CPU-side operation of the kernel function. That is, creates a shared file in the /tmp directory and returns the mapping pointer to the file. |
|
|
Functions as the CPU commissioning entry and completes calls to CPU operator programs during verification of the CPU-side operation of the kernel function. |
|
|
Specifies tilingKey used for the current CPU debugging. During debugging, only the branch to which tilingKey corresponds in the operator kernel function is executed. |
|
|
Frees the shared memory allocated by GmAlloc during verification of the CPU-side operation of the kernel function. |
|
|
Sets the kernel mode to the single AIV mode, single AIC mode, or MIX mode to enable CPU commissioning of single AIV (vector) operators, single AIC (cube) operators, or MIX operators, respectively. |
|
|
Performs dotting in any running phase of the operator when the CAModel is used for operator performance simulation, to analyze the pipeline diagrams of different instructions for further performance tuning. Indicates dotting from the start point. This API is used together with TRACE_STOP. |
|
|
Performs dotting in any running phase of the operator when the CAModel is used for operator performance simulation, to analyze the pipeline diagrams of different instructions for further performance tuning. Indicates dotting from the end point. This API is used together with TRACE_START. |
|
|
Starts the profile data collection. This API is used together with MetricsProfStop. When using Operator Tuning (msProf) for on-board operator tuning, you can call MetricsProfStart and MetricsProfStop before and after the code segment on the kernel to specify the scope of the code segment to be optimized. |
|
|
Stops the profile data collection. This API is used together with MetricsProfStart. When using Operator Tuning (msProf) for on-board operator tuning, you can call MetricsProfStart and MetricsProfStop before and after the code segment on the kernel to specify the scope of the code segment to be optimized. |
|
API |
Function |
|---|---|
|
Provides a unified API for executing specific functions in different modes (AIC or AIV), thereby avoiding direct hardware condition judgment in code (such as using ASCEND_IS_AIV or ASCEND_IS_AIC). |
|
|
NumericLimits is a tool class used to query attributes such as the maximum and minimum values of a specified data type. |
|
|
Applies to the separated Cube/Vector mode and obtains the Cube/Vector ratio. |
|
|
Obtains the UB size, in bytes. |
|
|
Obtains the runtime UB size, in bytes. You can calculate the number of cycles based on the UB size. |
|
API |
Function |
|---|---|
|
Obtains the tiling information input by the kernel entry point function of the operator and fills the information in the registered tiling structure. This function is compiled in macro expansion mode. If a user has registered multiple TilingData structures, this API is used to return the default registered structure. |
|
|
Specifies a structure name to obtain the specified tiling information and fills the information in the corresponding tiling structure. This function is compiled in macro expansion mode. |
|
|
Obtains the member variables of a tiling structure. |
|
|
Checks whether the tiling_key in the current kernel function execution is equal to a specific key, so as to identify a kernel branch with tiling_key==key. |
|
|
Registers the default TilingData structure defined by the user using the standard C++ syntax on the kernel. |
|
|
Registers a custom TilingData structure that matches the TilingKey on the kernel. This API requires a logical expression that uses the string TILING_KEY_VAR to represent the actual TilingKey and the range that the TilingKey satisfies. |
|
|
When using a custom TilingData structure defined with the standard C++ syntax in the kernel, if you are unsure which structures need to be registered, you can use this API to inform the framework that you need to use the unregistered standard C++ syntax to define the TilingData. This API works in conjunction with GET_TILING_DATA_WITH_STRUCT, GET_TILING_DATA_MEMBER, and GET_TILING_DATA_PTR_WITH_STRUCT to obtain the corresponding TilingData. |
|
|
Sets the global default kernel type, which applies to all tiling keys. |
|
|
Sets the kernel type corresponding to a specific tiling key. |
|
Category |
API |
Function |
|---|---|---|
|
Scalar Computation |
Writes data to the global memory address without passing through the DCache. |
|
|
Reads data from the global memory address without passing through the DCache. |
||
|
Vector Computation |
Performs the padding operation on the source operand by the data block based on padMode and padSide. |
|
|
Performs bilinear interpolation operations, including vertical iteration and horizontal iteration. |
||
|
Obtains the comparison result of the Compare (Result Stored in a Register) instruction. |
||
|
Sets the comparison register for the APIs where Select does not specify the mask parameter. |
||
|
Obtains the computation result of ReduceSum (based on the first n data elements of a tensor). |
||
|
Obtains the maximum/minimum values and the corresponding index values in the scenario where ReduceMax and ReduceMin are consecutive. |
||
|
Inserts consecutive elements into the corresponding positions in Region Proposals. In each iteration, 16 consecutive elements are inserted into the corresponding positions in 16 Region Proposals. |
||
|
Extracts elements from corresponding positions in Region Proposals and rearranges them. In each iteration, 16 elements are extracted from 16 Region Proposals and arranged consecutively. The functionality of this API is the opposite of that of ProposalConcat. |
||
|
Sorts the Region Proposals based on their score fields in descending order. 16 Region Proposals are sorted in each iteration. |
||
|
Merges up to four sorted Region Proposal lists into one. The results are sorted in descending order of the score fields. |
||
|
Serves as a sorting function that can sort up to 32 elements in each iteration. |
||
|
Merges up to four sorted lists into one. The results are sorted in descending order of the score fields. |
||
|
Obtains the number of region proposals in the queue processed by MrgSort or MrgSort4 and stores the number in the four List input parameters in sequence. |
||
|
Gathers a given input tensor to the result tensor based on the offset address tensor provided. |
||
|
With a given contiguous input tensor and a destination address offset tensor, generates a new result tensor based on the offset address and distributes the input tensor to the result tensor. |
||
|
Vector Computation |
Writes src0 to dst directly if src0 is greater than 0. Otherwise, writes the result of src0 × src1 to dst. |
|
|
Multiplies the first count data elements of src0 and src1 element-wise, and writes the result to dst0Local. If the result overflows, the overflow part is written to dst1Local. |
||
|
Subtracts src1 from src0Local, takes the absolute value, and stores the result to dst. |
||
|
Subtracts src1 from src0, uses the difference as the exponent to compute the power of the natural constant e, and stores the result to dst. |
||
|
Multiplies the first count elements of the vector source operand by a scalar, converts the result to half type in CAST_ROUND mode, and stores the final result to dst. The scalar can be before or after the tensor. |
||
|
Truncates floating-point elements of the source operand to their integer part, while retaining the data type of the source operand. |
||
|
Interleaves the elements from given source operands src0 and src1 and stores them in the result operands dst0 and dst1. |
||
|
Deinterleaves the elements from given source operands src0 and src1 and stores them in the result operands dst0 and dst1. |
||
|
Data Movement |
Enables data non-aligned movement. |
|
|
Sets the value filled by DataCopyPad. |
||
|
Cube Computation |
Performs matrix multiplication and addition. |
|
|
Performs matrix multiplication and addition operations. The input left matrix A is a sparse matrix, and the input right matrix B is a dense matrix. |
||
|
Sets register values. This API is similar to SetHF32TransMode, SetMMRowMajor, and SetMMColumnMajor. SetHF32Mode is used to set the HF32 mode of the MMAD. |
||
|
Sets register values. This API is similar to SetHF32Mode, SetMMRowMajor, and SetMMColumnMajor. SetHF32TransMode is used to set the HF32 rounding mode of the MMAD. It is valid only when the HF32 mode of the MMAD takes effect. |
||
|
Sets register values. This API is similar to SetHF32Mode and SetHF32TransMode. This API sets MMAD computation to traverse preferentially along the N dimension. |
||
|
Sets register values. This API is similar to SetHF32Mode and SetHF32TransMode. This API sets MMAD computation to traverse preferentially along the M dimension. |
||
|
Performs 2D convolution on a given input tensor and a weight tensor and outputs a result tensor. The Conv2d convolution layer is mostly used for image recognition, and a filter is used to extract features in an image. |
||
|
Multiplies two tensors and outputs a result tensor. Multiply matrix A and matrix B to obtain matrix C, and output matrix C. |
||
|
Sets the tensor quantization parameters for the real-time quantization during DataCopy (CO1 -> GM or CO1 -> A1). |
||
|
Sets the NZ2ND configuration for the real-time format conversion (NZ2ND) during DataCopy (CO1 -> GM or CO1 -> A1). |
||
|
Sets the scalar quantization parameters for the real-time quantization process during DataCopy (CO1 -> GM or CO1 -> A1). |
||
|
Sets the maximum value of the ClipReLU operation after real-time quantization during DataCopy (CO1 -> GM). |
||
|
Sets the address of the LocalTensor for the element-wise operation after real-time quantization during DataCopy (CO1->GM). |
||
|
Initializes LocalTensor (TPosition: A1, A2, B1, or B2) to a specific value. |
||
|
Provides the Load2D and Load3D data loading functions. |
||
|
Loads 2D data with transposing from A1/B1 to A2/B2. |
||
|
Sets AI preprocessing (AIPP) parameters for images. |
||
|
Transfers image data from the GM to A1/B1. During the transfer, you can preprocess images, including image flipping, image resizing (clipping, cropping, scaling, and stretching), color space conversion (CSC), and type conversion. |
||
|
Loads the compression index table on the GM to the internal register. |
||
|
Decompress the data on the GM and transfer the data to A1, B1, and B2. |
||
|
Moves the 512-byte dense weight matrix stored in B1 to B2, and reads the 128-byte index matrix for sparseness of the dense matrix. |
||
|
Sets the attribute description of the feature map when Load3Dv1/Load3Dv2 is called. |
||
|
Sets A1/B1 boundary value when Load3D is called. |
||
|
Sets the repeat parameter of the Load3Dv2 API. After the repeat parameter is set, the Load3Dv2 API can be called once to complete the data movement for multiple iterations. |
||
|
Sets padValue for Load3Dv1/Load3Dv2. |
||
|
Processes the result after the matrix computation is complete. For example, the computation result is quantized and the data is moved from CO1 to the Global Memory. |
||
|
Synchronization Control |
Synchronizes different pipelines in the same core. This synchronization operation needs to be inserted between different pipeline instructions with data dependency. |
|
|
Blocks a pipeline. This synchronization operation needs to be inserted between the same pipelines with data dependency. |
||
|
Blocks the execution of subsequent instructions until all previous memory access instructions (the memory location to be waited for can be controlled by parameters) are executed. |
||
|
Sets the synchronization between the Cube Core (AIC) and Vector Core (AIV) on the AI Core for the separated mode. |
||
|
Waits for the synchronization between the Cube Core (AIC) and Vector Core (AIV) on the AI Core for the separated mode. |
||
|
Synchronization Control |
Mutex is used for synchronization between asynchronous pipeline instructions in a core. Its function is similar to the lock mechanism in traditional CPUs. The synchronization dependency between pipelines is implemented by locking specified pipelines and then releasing them. Each lock has a fixed mutex ID, which can be custom (ranging from 0 to 27) or released using AllocMutexID/ReleaseMutexID. |
|
|
Obtains and occupies a MutexID from the framework. This API is used together with ReleaseMutexID to manage the obtaining and release of MutexIDs. |
||
|
Releases a MutexID from the framework. It is used together with AllocMutexID. |
||
|
Cache Processing |
Preloads instructions to the iCache from the DDR address where the instructions are located. |
|
|
Obtains the PreLoad status of the iCache. |
||
|
System Variable Access |
Obtains the pointer to the program counter, which is used to record the current program execution position. |
|
|
Obtains the number of Vector Cores on the AI Core. |
||
|
Obtains the ID of the Vector Core on the AI Core. |
||
|
Obtains the number of cycles in the current system. If the number of cycles is converted to time (unit: μs), the frequency must be 50 MHz. The conversion formula is as follows: Time = (Number of cycles/50) μs. |
||
|
System Variable Access |
Sets specific bits of the CTRL register (control register). |
|
|
Reads the value of a specific bit in the CTRL register (control register). |
||
|
Resets specific bits of the CTRL register (control register). |
||
|
Atomic Operations |
Sets whether to perform atomic comparison for subsequent data transferred from VECOUT to GM, which compares the content to be copied with the existing content in GM and writes the maximum value to GM. |
|
|
Sets whether to perform atomic comparison for subsequent data transferred from VECOUT to GM, which compares the content to be copied with the existing content in GM and writes the minimum value to GM. |
||
|
Sets the atomic operation enabling flag and type. |
||
|
Obtains the value of the enabling flag and type of the atomic operation. |
||
|
Debugging APIs |
Monitors the UB read and write operations within the specified range. If the UB read and write operations within the specified range are monitored, an EXCEPTION error is reported. If the UB read and write operations within the specified range are not monitored, no error is reported. |
|
|
Cube Group Management |
Controls communication between the AIC and the AIV through soft synchronization in the separated mode, to implement AI Core compute resource grouping. |
|
|
When two AIV tasks in the same CubeResGroupHandle object depend on each other, control synchronization by calling GroupBarrier. |
||
|
KfcWorkspace is the communication workspace descriptor, which is used to manage the message communication area division of different CubeResGroupHandle objects. It is used together with CubeResGroupHandle. The KfcWorkspace constructor is used to create a KfcWorkspace object. |
High-Level APIs
|
API |
Function |
|---|---|
|
Computes arc cosine element-wise. |
|
|
Computes inverse hyperbolic cosine element-wise. |
|
|
Computes arcsine element-wise. |
|
|
Computes the hyperbolic arcsine element-wise. |
|
|
Computes the arc tangent of a trigonometric function element-wise. |
|
|
Computes the inverse hyperbolic tangent element-wise. |
|
|
Adds the product of each element of the source operand and a scalar to the corresponding element in the destination operand. |
|
|
Obtains the minimum integer value greater than or equal to x, that is, rounding towards positive infinity. |
|
|
Replaces the number greater than scalar with scalar in srcTensor and retains the number less than or equal to scalar as the dstTensor output. |
|
|
Replaces the number less than scalar with scalar in srcTensor and retains the number greater than or equal to scalar as the dstTensor output. |
|
|
Computes the cosine function element-wise. |
|
|
Computes hyperbolic cosine element-wise. |
|
|
Accumulates data by row or column. |
|
|
Computes the logarithmic derivative of the gamma function of x element-wise. |
|
|
Computes error function or Gaussian error function element-wise. |
|
|
Returns the complementary error function computing result of input x. The integral ranges from x to infinity. |
|
|
Computes the natural exponent element-wise. |
|
|
Obtains the minimum integer value less than or equal to x, that is, rounding towards negative infinity. |
|
|
Computes the remainder of two floating-point numbers element-wise. |
|
|
Returns decimals element-wise. |
|
|
Computes the square root of the sum of squares of two floating-point numbers element-wise. |
|
|
Performs element-wise checks to determine whether the input floating-point numbers are neither NaN nor ±INF. |
|
|
Computes the absolute value and natural logarithm of the gamma function of x element-wise. |
|
|
Computes logarithm of bases e, 2, and 10 element-wise. |
|
|
Computes exponentiation element-wise. |
|
|
Rounds the input element to the nearest integer. |
|
|
Performs the Sign operation element-wise. Sign refers to the symbol that returns the input data. |
|
|
Computes sine element-wise. |
|
|
Computes hyperbolic sine element-wise. |
|
|
Computes tangent element-wise. |
|
|
Performs element-wise logistic regression using the Tanh function. |
|
|
Truncates floating point numbers element-wise, that is, rounding towards zero. |
|
|
Performs the XOR operation element-wise. |
|
|
Computes the result of multiplying two inputs and then adding a third input element-wise. |
|
|
Performs element-wise checks to determine whether the input floating-point numbers are NaN. |
|
|
Performs element-wise checks to determine whether the input floating-point numbers are ±INF. |
|
|
Obtains the integer closest to the input data. |
|
|
Performs sine and cosine computation element-wise to obtain the sine and cosine results. |
|
|
Applies a logical NOT operation element-wise. |
|
|
Performs the AND operation by element. |
|
|
Performs a logical AND operation between each element in an input vector and a scalar. |
|
|
Performs the OR operation by element. |
|
|
Performs a logical OR operation between each element in an input vector and a scalar. |
|
|
Performs the logical exclusive OR operation by element. |
|
|
Performs a bitwise NOT operation on the input. |
|
|
Performs a bitwise AND operation on two inputs. |
|
|
Performs a bitwise OR operation on two inputs. |
|
|
Performs a bitwise XOR operation on two inputs. |
|
|
Selects elements from two source operands based on specified conditions to generate a target operand. |
|
API |
Function |
|---|---|
|
Performs element-wise fake quantization. For example, apply fake quantization to quantize int8_t to half. |
|
|
Performs element-wise fake quantization. For example, apply fake quantization to quantize int8_t to half. |
|
|
Performs element-wise dequantization. For example, it can dequantize int32_t to half or float. |
|
|
Performs dequantization by element. For example, dequantize the int32_t data type to the half/float data type. |
|
|
Performs element-wise quantization. For example, it can quantize half or float into int8_t. |
|
|
Performs quantization by element. For example, quantize the half/float data type to the int8_t data type. |
|
API |
Function |
|---|---|
|
Normalizes each input feature of samples in each batch along the batch dimension. |
|
|
Serves as a replacement for LayerNorm normalization during the training process of a deep neural network. |
|
|
Divides the input C dimension into groups (groupNum) and standardizes each group of data. |
|
|
Normalizes the input data of network layers to the [0, 1] range to standardize the distributions of both input and output data across network layers. |
|
|
Computes the backpropagation gradient of LayerNorm. |
|
|
Obtains the reverse beta/gmma value and outputs pdx, gmma, and beta when used in conjunction with LayerNormGrad. |
|
|
Computes the reciprocal rstd of the standard deviation of the input data with shape [A, R] and the normalized output y based on the known mean value and variance in LayerNorm. |
|
|
Normalizes input data whose shape is [B, S, H] using RmsNorm. |
|
|
Implements preprocessing of the Welford algorithm. |
|
|
Implements postprocessing of the Welford algorithm. |
|
API |
Function |
|---|---|
|
Performs postprocessing on SoftMax compute results and adjusts SoftMax compute results to specified values. |
|
|
Implements an activation function of the simplified FastGelu version. |
|
|
Implements an activation function of the FastGeluV2 version. |
|
|
Serves as a GLU variant that uses GeLU as the activation function. |
|
|
Serves as an important activation function that is inspired by ReLU and dropout. The idea of random regularization is introduced in activation. |
|
|
Performs LogSoftmax computation on the input tensor. |
|
|
Serves as a GLU variant that uses ReLU as the activation function. |
|
|
Performs logistic regression with Sigmoid element-wise. |
|
|
Computes Silu element-wise. |
|
|
Uses the computed sum and max data to perform softmax computation on the input tensor. |
|
|
Performs softmax computation on input tensors by row. |
|
|
Serves as the enhanced version of SoftMax. It not only performs softmaxflash computation on the input tensor but also updates the result of the current softmax computation based on the sum and max values obtained in the previous softmax computation. |
|
|
Serves as the enhanced version of SoftmaxFlash, corresponding to the FlashAttention-2 algorithm. |
|
|
Serves as the enhanced version of SoftmaxFlash, corresponding to the Softmax PASA algorithm. |
|
|
Performs gradient backpropagation on input tensors. |
|
|
Performs gradient backpropagation on input tensors. |
|
|
Serves as a GLU variant that uses Swish as the activation function. |
|
|
Serves as a Swish activation function in neural networks. |
|
API |
Function |
|---|---|
|
Obtains the sum of elements in the last dimension. |
|
|
Computes the mean of elements according to the direction of the last axis. |
|
|
Performs the XOR (bitwise XOR) operation by element and computes the sum of the results using ReduceSum. |
|
|
Accumulates data of a multi-dimensional vector based on a specified dimension. |
|
|
Computes the mean of a multi-dimensional vector along a specified dimension. |
|
|
Returns the maximum value of a multi-dimensional vector along a specified dimension. |
|
|
Returns the minimum value of a multi-dimensional vector along a specified dimension. |
|
|
Computes the logical OR of a multi-dimensional vector along a specified dimension. |
|
|
Computes the logical AND of a multi-dimensional vector along a specified dimension. |
|
|
Computes the product of a multi-dimensional vector along a specified dimension. |
|
API |
Function |
|---|---|
|
Obtains the first k maximum or minimum values of the last dimension and their corresponding indexes. |
|
|
Preprocesses the data and merges the source operand srcLocal to be sorted into the target data concatLocal. After the data is preprocessed, you can sort the data. |
|
|
Processes the sorting result data and outputs the sorted values and indexes. |
|
|
Sorts data in descending order by value. |
|
|
Merges up to four sorted lists into one. The results are sorted in descending order of the score fields. |
|
API |
Function |
|---|---|
|
Given two source operands src0 and src1, selects elements based on the values (non-bit) of corresponding positions of maskTensor to obtain the destination operand dst. |
|
|
Provides the function of filtering the source operand based on the mask tensor to obtain the destination operand. |
|
API |
Function |
|---|---|
|
Performs data format and reshape operations on the input data. |
|
|
Converts the format of the input data to the target format. |
|
|
Broadcasts the input based on the output shape. |
|
|
Pads the two-dimensional tensor (height × width) to 32-bytes alignment in the width direction. |
|
|
Unpads the two-dimensional tensor (height × width) in the width direction. |
|
|
Initializes data in the global memory to a specified value. |
|
API |
Function |
|---|---|
|
Returns an arithmetic sequence given the start value, difference, and length. |
|
API |
Function |
|---|---|
|
Performs matrix multiplications. |
|
API |
Function |
|---|---|
|
Orchestrates collective communication tasks on the AI Core. |
|
API |
Function |
|---|---|
|
Performs 3D convolution forward matrix computation. |
|
|
Computes the backpropagation of a 3D convolution to obtain the backpropagated error of the feature map. |
|
|
Computes the backpropagation of a 3D convolution to obtain the backpropagated error of the weight. |
|
API |
Function |
|---|---|
|
Generates several random numbers based on the Philox random number generation algorithm after a random number seed is given. |
SIMT API
|
API |
Function |
|---|---|
|
Starts a SIMT Vector Function (VF) subtask to launch a specified number of threads for executing the specified SIMT kernel function. |
|
API |
Function |
|---|---|
|
Waits until all threads in the current thread block have reached this function. |
|
|
Ensures the time sequence of write operations when different cores access the same global or shared memory. |
|
|
Coordinates the memory operation sequence of threads in the same thread block to ensure that all memory read and write operations before a thread calls asc_threadfence_block () are visible to other threads in the same thread block. |
|
API |
Function |
|---|---|
|
Obtains the tangent of the input data. |
|
|
Obtains the hyperbolic tangent of the input data. |
|
|
Obtains the hyperbolic tangent of the input data. |
|
|
Obtains the hyperbolic tangent of each element in the input data. |
|
|
Obtains the tangent of the input data multiplied by π. |
|
|
Obtains the arc tangent of the input data. |
|
|
Obtains the arc tangent of y/x of the input data. |
|
|
Obtains the inverse hyperbolic tangent of the input data. |
|
|
Obtains the value of e raised to the power of x. |
|
|
Obtains the value of e raised to the power of x. |
|
|
Obtains the value of e raised to the power of each element of x with a given x. |
|
|
Obtains the value of 2 raised to the power of x. |
|
|
Obtains the value of 2 raised to the power of x. |
|
|
Obtains the value of 2 raised to the power of each element of x with a given x. |
|
|
Obtains the value of 10 raised to the power of x. |
|
|
Obtains the value of 10 raised to the power of x. |
|
|
Obtains the value of 10 raised to the power of each element of x with a given x. |
|
|
Obtains the value of e raised to the power of x minus 1. |
|
|
Obtains the logarithm of the input data with base e. |
|
|
Obtains the logarithm of the input data with base e. |
|
|
Obtains the logarithm of each element in the input data with base e. |
|
|
Obtains the logarithm of the input data with base 2. |
|
|
Obtains the logarithm of the input data with base 2. |
|
|
Obtains the logarithm of each element in the input data with base 2. |
|
|
Obtains the logarithm of the input data with base 10. |
|
|
Obtains the logarithm of the input data with base 10. |
|
|
Obtains the logarithm of each element in the input data with base 10. |
|
|
Obtains the logarithm of the input data plus 1 with base e. |
|
|
Computes the logarithm of the input data with base 2, rounds down the result, and returns it as a floating-point value. |
|
|
Computes the logarithm of the input data with base 2, rounds down the result, and returns an integer. |
|
|
Obtains the cosine of the input data. |
|
|
Obtains the cosine of the input data. |
|
|
Obtains the cosine of each element in the input data. |
|
|
Obtains the hyperbolic cosine of the input data. |
|
|
Obtains the cosine of the input data multiplied by π. |
|
|
Obtains the arc cosine of the input data. |
|
|
Obtains the inverse hyperbolic cosine of the input data. |
|
|
Obtains the sine of the input data. |
|
|
Obtains the sine of the input data. |
|
|
Obtains the sine of each element in the input data. |
|
|
Obtains the hyperbolic sine of the input data. |
|
|
Obtains the sine of the input data multiplied by π. |
|
|
Obtains the inverse sine of the input data. |
|
|
Obtains the inverse hyperbolic sine of the input data. |
|
|
Obtains the sine and cosine of the input data. |
|
|
Obtains the sine and cosine of the input data multiplied by π. |
|
|
Converts x to a normalized signed number in the range [1/2, 1) multiplied by an integral power of 2. |
|
|
Obtains the result of multiplying the input x by 2 raised to the power of exp. |
|
|
Obtains the square root of the input data x. |
|
|
Obtains the square root of the input data x. |
|
|
Obtains the square root of each element in the input data x. |
|
|
Obtains the reciprocal of the square root of the input data x. |
|
|
Obtains the reciprocal of the square root of the input data x. |
|
|
Obtains the reciprocal of the square root of each element in the input data x. |
|
|
Obtains the reciprocal of the input data x. |
|
|
Obtains the reciprocal of each element in the input data x. |
|
|
Obtains the square root of the sum of squares of the input data x and y (x2 + y2). |
|
|
Obtains the reciprocal of the square root of the sum of squares of the input data x and y (x2 + y2). |
|
|
Obtains the input data x raised to the power of y. |
|
|
Obtains the square root of the sum of squares of the input data a, b, and c (a2 + b2 + c2). |
|
|
Obtains the reciprocal of the square root of the sum of squares of the input data a, b, and c (a2 + b2 + c2). |
|
|
Obtains the square root of the sum of squares of the input data a, b, c, and d (a2 + b2 + c2 + d2). |
|
|
Obtains the reciprocal of the square root of the sum of squares of the input data a, b, c, and d (a2 + b2 + c2 + d2). |
|
|
Obtains the square root of the sum of squares of the first n elements in the input data a (a[0]2 + a[1]2 + ... + a[n-1]2). |
|
|
Obtains the reciprocal of the square root of the sum of squares of the first n elements in the input data a (a[0]2 + a[1]2 + ... + a[n-1]2). |
|
|
Obtains the cube root of the input data x. |
|
|
Obtains the reciprocal of the cube root of the input data x. |
|
|
Obtains the error function value of the input data. |
|
|
Obtains the complementary error function value of the input data. |
|
|
Obtains the inverse error function value of the input data. |
|
|
Obtains the inverse complementary error function value of the input data. |
|
|
Obtains the scaled complementary error function value of the input data. |
|
|
Obtains the gamma function value of the input data x. |
|
|
Obtains the absolute value of the gamma value of the input data x and calculates the natural logarithm. |
|
|
Obtains the value of the zeroth-order regular modified cylindrical Bessel function of the input data x. |
|
|
Obtains the value of the first-order regular modified cylindrical Bessel function of the input data x. |
|
|
Obtains the cumulative distribution function value of the standard normal distribution of the input data x. |
|
|
Obtains the inverse function of the standard normal cumulative distribution of the input data x. |
|
|
Obtains the value of the zeroth-order first-type Bessel function j0 of the input data x. |
|
|
Obtains the value of the first-order first-type Bessel function j1 of the input data x. |
|
|
Obtains the value of the nth-order first-type Bessel function jn of the input data x. |
|
|
Obtains the value of the zeroth-order second-type Bessel function y0 of the input data x. |
|
|
Obtains the value of the first-order second-type Bessel function y1 of the input data x. |
|
|
Obtains the value of the nth-order second-type Bessel function yn of the input data x. |
|
|
Obtains the absolute value of the input data. |
|
|
Obtains the absolute value of the input data. |
|
|
Computes the result of x multiplied by y plus z for the input data x, y, and z. |
|
|
Computes the result of x multiplied by y plus z for the input data x, y, and z. |
|
|
Obtains the maximum value between two inputs. |
|
|
Obtains the maximum value between two inputs. |
|
|
Obtains the minimum value between two inputs. |
|
|
Obtains the minimum value between two inputs. |
|
|
Obtains the difference between two inputs. If the difference is less than 0, 0 is returned. |
|
|
Obtains the remainder of input x divided by y. The quotient is rounded to the nearest integer. If the floating-point result of x divided by y is exactly halfway between two integers, the quotient is rounded to the even integer. The quotient is then stored in the variable pointed to by the pointer quo. |
|
|
Obtains the remainder of input x divided by y. The quotient is the integer part of the floating-point result of x divided by y. |
|
|
Obtains the remainder of input x divided by y. The quotient is rounded to the nearest integer. If the floating-point result of x divided by y is exactly halfway between two integers, the quotient is rounded to the even integer. |
|
|
Obtains a floating-point number composed of the magnitude of the first input x and the sign of the second input y. |
|
|
Obtains the integer closest to the input floating-point number. If the input floating-point number is exactly halfway between two integers, the even integer is returned. |
|
|
If y is greater than x, the function returns the next representable floating-point value larger than x, that is, incrementing the least significant bit of the floating-point number's binary representation by one. If y is less than x, the function returns the next representable floating-point value less than x, that is, decrementing the least significant bit of the floating-point number's binary representation by one. If y is equal to x, x is returned. |
|
|
Obtains the product of the input data x and 2 raised to the power of n. |
|
|
Obtains the product of the input data x and 2 raised to the power of n. |
|
|
Decomposes the input data into the fractional part and the integer part. |
|
|
Obtains the absolute value of the input data. |
|
|
Obtains the absolute value of the input data. |
|
|
Obtains the maximum value between two inputs. |
|
|
Obtains the maximum value between two inputs. |
|
|
Obtains the maximum value between two inputs. |
|
|
Obtains the minimum value between two inputs. |
|
|
Obtains the minimum value between two inputs. |
|
|
Obtains the minimum value between two inputs. |
|
|
Obtains the result of dividing two inputs. |
|
|
Obtains the sign bit of the input data. |
|
|
Obtains the upper 32 bits of the product of two int32 inputs, x and y. |
|
|
Obtains the upper 32 bits of the product of two uint32 inputs, x and y. |
|
|
Obtains the upper 64 bits of the product of two int64 inputs, x and y. |
|
|
Obtains the upper 64 bits of the product of two uint64 inputs, x and y. |
|
|
Computes the product of two 32-bit integer inputs, x and y, and returns a 64-bit result. |
|
|
Reverses the bit order of the input data and returns the reversed value. |
|
|
Counts the number of consecutive leading zeros in the binary representation of the input data, starting from the most significant bit (MSB). |
|
|
Scans the binary representation of the input data starting from the least significant bit (LSB) and returns the index (1-based) of the first bit set to 1. If no bits are set to 1, it returns 0. |
|
|
Counts the number of bits set to 1 in the binary representation of the input data, starting from the MSB to the LSB. |
|
|
Combines two 4-byte uint32_t inputs into an 8-byte 64-bit integer. The selector s specifies which 4 bytes to select, and these 4 bytes are concatenated into a uint32_t integer from LSB to MSB. |
|
API |
Function |
|---|---|
|
Returns the integer closest to the input data. If there are two equally close integers, the even one will be returned. |
|
|
Returns the integer closest to the input data. If there are two equally close integers, the even one will be returned. |
|
|
Returns the integer closest to each element of the input data. If there are two equally close integers, the even one will be returned. |
|
|
Returns the integer closest to the input data. If there are two equally close integers, the even one will be returned. |
|
|
Returns the integer closest to the input data. If there are two equally close integers, the even one will be returned. |
|
|
Rounds off the input data to the nearest integer. |
|
|
Rounds off the input data to the nearest integer. |
|
|
Rounds off the input data to the nearest integer. |
|
|
Obtains the largest integer less than or equal to the input data. |
|
|
Obtains the largest integer less than or equal to the input data. |
|
|
Obtains the largest integer less than or equal to each element of the input data. |
|
|
Obtains the smallest integer greater than or equal to the input data. |
|
|
Obtains the smallest integer greater than or equal to the input data. |
|
|
Obtains the smallest integer greater than or equal to each element of the input data. |
|
|
Obtains the integer truncated from the floating-point number of the input data. |
|
|
Obtains the integer truncated from the floating-point number of the input data. |
|
|
Obtains the integer truncated from the floating-point number of each element in the input data. |
|
API |
Function |
|---|---|
|
Checks whether a floating-point number is finite (not inf or nan). |
|
|
Checks whether a floating-point number is nan. |
|
|
Checks whether a floating-point number is nan. |
|
|
Checks whether a floating-point number is infinite. |
|
|
Checks whether a floating-point number is infinite. |
|
API |
Function |
|---|---|
|
Performs an atomic add operation on the data in the Unified Buffer or Global Memory and the specified data, accumulating the specified data into the data in the Unified Buffer or Global Memory. |
|
|
Performs an atomic subtract operation on the data in the Unified Buffer or Global Memory and the specified data, subtracting the specified data from the data in the Unified Buffer or Global Memory. |
|
|
Performs an atomic assignment operation on the address in the Unified Buffer or Global Memory, assigning the specified data to the address in the Unified Buffer or Global Memory. |
|
|
Performs an atomic maximum operation on the data in Unified Buffer or Global Memory, assigning the maximum value between the data in Unified Buffer or Global Memory and the specified data to the address in Unified Buffer or Global Memory. |
|
|
Performs an atomic minimum operation on the data in Unified Buffer or Global Memory, assigning the minimum value between the data in Unified Buffer or Global Memory and the specified data to the address in Unified Buffer or Global Memory. |
|
|
Performs an atomic increment operation on the address value in the Unified Buffer or Global Memory. If the address value is greater than or equal to the specified value val, the address value is set to 0. Otherwise, the address value is incremented by 1. |
|
|
Performs an atomic decrement operation on the address value in the Unified Buffer or Global Memory. If the address value is 0 or greater than the specified value val, the address value is set to val. Otherwise, the address value is decremented by 1. |
|
|
Performs an atomic compare-and-swap operation on the address value in the Unified Buffer or Global Memory. If the address value is equal to the specified value compare, the address value is set to the specified value val. Otherwise, the address value remains unchanged. |
|
|
Performs an atomic AND (&) operation on the address value in the Unified Buffer or Global Memory and the specified value val, assigning the result to the Unified Buffer or Global Memory. |
|
|
Performs an atomic OR (|) operation on the address value in the Unified Buffer or Global Memory and the specified value val, assigning the result to the Unified Buffer or Global Memory. |
|
|
Performs an atomic XOR (^) operation on the address value in the Unified Buffer or Global Memory and the specified value val, assigning the result to the Unified Buffer or Global Memory. |
|
API |
Function |
|---|---|
|
Checks whether the inputs of all active threads are not 0. |
|
|
Checks whether the input of any active thread is not 0. |
|
|
Checks whether the input of each active thread in a warp is not 0. |
|
|
Checks whether all threads in a warp are active. |
|
|
Obtains the var value input by the specified thread srcLane in a warp for swapping. |
|
|
Obtains the var value input by the thread that is delta lanes forward from the current thread in the warp (current LaneId – delta) for swapping. |
|
|
Obtains the var value input by the thread that is delta lanes backward from the current thread in a warp (current LaneId + delta) for swapping. |
|
|
Obtains the var value input by the thread corresponding to dstLaneId (obtained by performing an XOR operation on the current LaneId and the input laneMask: LaneId^laneMask) for swapping. |
|
|
Sums up the val values input by all active threads in a warp. |
|
|
Computes the maximum value of val input by all active threads in a warp. |
|
|
Computes the minimum value of val input by all active threads in a warp. |
|
API |
Function |
|---|---|
|
Returns the floating-point number of the input, rounded according to the CAST_RINT mode. |
|
|
Returns the floating-point number of the input, rounded according to the CAST_TRUNC mode. |
|
|
Returns the floating-point number of the input, rounded according to the CAST_FLOOR mode. |
|
|
Returns the floating-point number of the input, rounded according to the CAST_CEIL mode. |
|
|
Returns the floating-point number of the input, rounded according to the CAST_ROUND mode. |
|
|
Returns the half-precision floating-point number converted from the input in line with the CAST_RINT mode. |
|
|
Returns the half-precision floating-point number converted from the input in line with the CAST_RINT mode. |
|
|
In saturation mode, returns the half-precision floating-point number converted from the input in line with the CAST_RINT mode. |
|
|
Returns the half-precision floating-point number converted from the input in line with the CAST_TRUNC mode. |
|
|
In saturation mode, returns the half-precision floating-point number converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the half-precision floating-point number converted from the input in line with the CAST_FLOOR mode. |
|
|
In saturation mode, returns the half-precision floating-point number converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the half-precision floating-point number converted from the input in line with the CAST_CEIL mode. |
|
|
In saturation mode, returns the half-precision floating-point number converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the half-precision floating-point number converted from the input in line with the CAST_ROUND mode. |
|
|
In saturation mode, returns the half-precision floating-point number converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the half-precision floating-point number converted from the input in line with the CAST_ODD mode. |
|
|
In saturation mode, returns the half-precision floating-point number converted from the input in line with the CAST_ODD mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_RINT mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_RINT mode. |
|
|
In saturation mode, returns the bfloat16 data converted from the input in line with the CAST_RINT mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_TRUNC mode. |
|
|
In saturation mode, returns the bfloat16 data converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_FLOOR mode. |
|
|
In saturation mode, returns the bfloat16 data converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_CEIL mode. |
|
|
In saturation mode, returns the bfloat16 data converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_ROUND mode. |
|
|
In saturation mode, returns the bfloat16 data converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the unsigned integer converted from the input in line with the CAST_RINT mode. |
|
|
Returns the unsigned integer converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the unsigned integer converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the unsigned integer converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the unsigned integer converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the signed integer converted from the input in line with the CAST_RINT mode. |
|
|
Returns the signed integer converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the signed integer converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the signed integer converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the signed integer converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the 64-bit unsigned integer converted from the input in line with the CAST_RINT mode. |
|
|
Returns the 64-bit unsigned integer converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the 64-bit unsigned integer converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the 64-bit unsigned integer converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the 64-bit unsigned integer converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the 64-bit signed integer converted from the input in line with the CAST_RINT mode. |
|
|
Returns the 64-bit signed integer converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the 64-bit signed integer converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the 64-bit signed integer converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the 64-bit signed integer converted from the input in line with the CAST_ROUND mode. |
|
|
In saturation mode, returns the half2 data converted from the two input components in line with the CAST_RINT mode. |
|
|
Returns the half2 data converted from the two input components in line with the CAST_TRUNC mode. |
|
|
In saturation mode, returns the half2 data converted from the two input components in line with the CAST_TRUNC mode. |
|
|
Returns the half2 data converted from the two input components in line with the CAST_FLOOR mode. |
|
|
In saturation mode, returns the half2 data converted from the two input components in line with the CAST_FLOOR mode. |
|
|
Returns the half2 data converted from the two input components in line with the CAST_CEIL mode. |
|
|
In saturation mode, returns the half2 data converted from the two input components in line with the CAST_CEIL mode. |
|
|
Returns the half2 data converted from the two input components in line with the CAST_ROUND mode. |
|
|
In saturation mode, returns the half2 data converted from the two input components in line with the CAST_ROUND mode. |
|
|
Returns the half2 data converted from the two input components in line with the CAST_ODD mode. |
|
|
In saturation mode, returns the half2 data converted from the two input components in line with the CAST_ODD mode. |
|
|
In saturation mode, returns the bfloat16x2_t data converted from the two input components in line with the CAST_RINT mode. |
|
|
Returns the bfloat16x2_t data converted from the two input components in line with the CAST_TRUNC mode. |
|
|
In saturation mode, returns the bfloat16x2_t data converted from the two input components in line with the CAST_TRUNC mode. |
|
|
Returns the bfloat16x2_t data converted from the two input components in line with the CAST_FLOOR mode. |
|
|
In saturation mode, returns the bfloat16x2_t data converted from the two input components in line with the CAST_FLOOR mode. |
|
|
Returns the bfloat16x2_t data converted from the two input components in line with the CAST_CEIL mode. |
|
|
In saturation mode, returns the bfloat16x2_t data converted from the two input components in line with the CAST_CEIL mode. |
|
|
Returns the bfloat16x2_t data converted from the two input components in line with the CAST_ROUND mode. |
|
|
In saturation mode, returns the bfloat16x2_t data converted from the two input components in line with the CAST_ROUND mode. |
|
|
Returns the hifloat8x2_t data converted from the two input components in line with the CAST_ROUND mode. |
|
|
In saturation mode, returns the hifloat8x2_t data converted from the two input components in line with the CAST_ROUND mode. |
|
|
Returns the hifloat8x2_t data converted from the two input components in line with the CAST_HYBRID mode. |
|
|
In saturation mode, returns the hifloat8x2_t data converted from the two input components in line with the CAST_HYBRID mode. |
|
|
In saturation mode, returns the __asc_fp8x2_storage_t data converted from the two input components based on the specified 8-bit floating-point number type and in line with the CAST_RINT mode. |
|
|
Returns the floating-point number converted from the input. |
|
|
Returns the half data rounded from the input in line with the CAST_RINT mode. |
|
|
Returns the half data rounded from the input in line with the CAST_TRUNC mode. |
|
|
Returns the half data rounded from the input in line with the CAST_FLOOR mode. |
|
|
Returns the half data rounded from the input in line with the CAST_CEIL mode. |
|
|
Returns the half data rounded from the input in line with the CAST_ROUND mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_RINT mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the unsigned integer converted from the input in line with the CAST_RINT mode. |
|
|
Returns the unsigned integer converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the unsigned integer converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the unsigned integer converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the unsigned integer converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the signed integer converted from the input in line with the CAST_RINT mode. |
|
|
Returns the signed integer converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the signed integer converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the signed integer converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the signed integer converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the 64-bit unsigned integer converted from the input in line with the CAST_RINT mode. |
|
|
Returns the 64-bit unsigned integer converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the 64-bit unsigned integer converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the 64-bit unsigned integer converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the 64-bit unsigned integer converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the 64-bit signed integer converted from the input in line with the CAST_RINT mode. |
|
|
Returns the 64-bit signed integer converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the 64-bit signed integer converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the 64-bit signed integer converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the 64-bit signed integer converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the hifloat8x2_t data converted from the two input components in line with the CAST_ROUND mode. |
|
|
In saturation mode, returns the hifloat8x2_t data converted from the two input components in line with the CAST_ROUND mode. |
|
|
Returns the hifloat8x2_t data converted from the two input components in line with the CAST_HYBRID mode. |
|
|
In saturation mode, returns the hifloat8x2_t data converted from the two input components in line with the CAST_HYBRID mode. |
|
|
Returns the half data converted from the input in line with the CAST_RINT mode. |
|
|
In saturation mode, returns the half data converted from the input in line with the CAST_RINT mode. |
|
|
Returns the half data converted from the input in line with the CAST_TRUNC mode. |
|
|
In saturation mode, returns the half data converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the half data converted from the input in line with the CAST_FLOOR mode. |
|
|
In saturation mode, returns the half data converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the half data converted from the input in line with the CAST_CEIL mode. |
|
|
In saturation mode, returns the half data converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the half data converted from the input in line with the CAST_ROUND mode. |
|
|
In saturation mode, returns the half data converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the floating-point data converted from the input. |
|
|
Returns the bfloat16_t data rounded from the input in line with the CAST_RINT mode. |
|
|
Returns the bfloat16_t data rounded from the input in line with the CAST_TRUNC mode. |
|
|
Returns the bfloat16_t data rounded from the input in line with the CAST_FLOOR mode. |
|
|
Returns the bfloat16_t data rounded from the input in line with the CAST_CEIL mode. |
|
|
Returns the bfloat16_t data rounded from the input in line with the CAST_ROUND mode. |
|
|
Returns the unsigned integer converted from the input in line with the CAST_RINT mode. |
|
|
Returns the unsigned integer converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the unsigned integer converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the unsigned integer converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the unsigned integer converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the signed integer converted from the input in line with the CAST_RINT mode. |
|
|
Returns the signed integer converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the signed integer converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the signed integer converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the signed integer converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the 64-bit unsigned integer converted from the input in line with the CAST_RINT mode. |
|
|
Returns the 64-bit unsigned integer converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the 64-bit unsigned integer converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the 64-bit unsigned integer converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the 64-bit unsigned integer converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the 64-bit signed integer converted from the input in line with the CAST_RINT mode. |
|
|
Returns the 64-bit signed integer converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the 64-bit signed integer converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the 64-bit signed integer converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the 64-bit signed integer converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the floating-point data converted from the input in line with the CAST_RINT mode. |
|
|
Returns the floating-point data converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the floating-point data converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the floating-point data converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the floating-point data converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the half data converted from the input in line with the CAST_RINT mode. |
|
|
In saturation mode, returns the half data converted from the input uint32 data in line with the CAST_RINT mode. |
|
|
Returns the half data converted from the input in line with the CAST_TRUNC mode. |
|
|
In saturation mode, returns the half data converted from the input uint32 data in line with the CAST_TRUNC mode. |
|
|
Returns the half data converted from the input in line with the CAST_FLOOR mode. |
|
|
In saturation mode, returns the half data converted from the input uint32 data in line with the CAST_FLOOR mode. |
|
|
Returns the half data converted from the input in line with the CAST_CEIL mode. |
|
|
In saturation mode, returns the half data converted from the input uint32 data in line with the CAST_CEIL mode. |
|
|
Returns the half data converted from the input in line with the CAST_ROUND mode. |
|
|
In saturation mode, returns the half data converted from the input uint32 data in line with the CAST_ROUND mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_RINT mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the floating-point data converted from the input in line with the CAST_RINT mode. |
|
|
Returns the floating-point data converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the floating-point data converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the floating-point data converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the floating-point data converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the half data converted from the input in line with the CAST_RINT mode. |
|
|
In saturation mode, returns the half data converted from the input int32 data in line with the CAST_RINT mode. |
|
|
Returns the half data converted from the input in line with the CAST_TRUNC mode. |
|
|
In saturation mode, returns the half data converted from the input int32 data in line with the CAST_TRUNC mode. |
|
|
Returns the half data converted from the input in line with the CAST_FLOOR mode. |
|
|
In saturation mode, returns the half data converted from the input int32 data in line with the CAST_FLOOR mode. |
|
|
Returns the half data converted from the input in line with the CAST_CEIL mode. |
|
|
In saturation mode, returns the half data converted from the input int32 data in line with the CAST_CEIL mode. |
|
|
Returns the half data converted from the input in line with the CAST_ROUND mode. |
|
|
In saturation mode, returns the half data converted from the input int32 data in line with the CAST_ROUND mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_RINT mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the floating-point data converted from the input in line with the CAST_RINT mode. |
|
|
Returns the floating-point data converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the floating-point data converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the floating-point data converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the floating-point data converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the half data converted from the input in line with the CAST_RINT mode. |
|
|
Returns the half data converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the half data converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the half data converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the half data converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_RINT mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the floating-point data converted from the input in line with the CAST_RINT mode. |
|
|
Returns the floating-point data converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the floating-point data converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the floating-point data converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the floating-point data converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the half data converted from the input in line with the CAST_RINT mode. |
|
|
Returns the half data converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the half data converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the half data converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the half data converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_RINT mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_TRUNC mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_FLOOR mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_CEIL mode. |
|
|
Returns the bfloat16 data converted from the input in line with the CAST_ROUND mode. |
|
|
Returns the float2 data converted from the input hifloat8x2_t data. |
|
|
Returns the half2 data converted from the input hifloat8x2_t data. |
|
|
Returns the float2 data converted from the input float8_e4m3x2_t data. |
|
|
Returns the float2 data converted from the input float8_e5m2x2_t data. |
|
|
Converts the float data to the bfloat16 type in line with the CAST_RINT mode, fills both the front and back parts of bfloat16x2, and returns the filled bfloat16x2 data. |
|
|
Converts the input data x and y to the bfloat16 type in line with the CAST_RINT mode, fills both the front and back parts of bfloat16x2, and returns the converted bfloat16x2 data. |
|
|
Converts float2 data to the bfloat16x2 type in line with the CAST_RINT mode and returns the converted bfloat16x2 data. |
|
|
Fills the input data into the front and rear components of bfloat16x2, and returns the converted bfloat16x2 data. |
|
|
Fills the input data into the front and rear components of bfloat16x2 and returns the filled data. |
|
|
Extracts the high 16 bits of the input bfloat16x2 and returns the result. |
|
|
Fills the high 16 bits of the input data into bfloat16x2 and returns the result. |
|
|
Converts the high 16 bits of the input data to the float type and returns the result. |
|
|
Extracts the high 16 bits from each of the two bfloat162 inputs, fills them into bfloat162, and returns the result. |
|
|
Returns the low 16 bits of the input data. |
|
|
Fills the low 16 bits of the input data into bfloat16x2 and returns the result. |
|
|
Converts the low 16 bits of the input data into floating-point data and returns the result. |
|
|
Exchanges the high and low 16 bits of the input data and returns the result. |
|
|
Extracts the low 16 bits from each of the two bfloat162 inputs, fills them into bfloat162, and returns the result. |
|
|
Converts the two components of bfloat16x2 to float values, fills them into float2, and returns the result. |
|
|
Converts the input data x and y to the bfloat16 type in line with the CAST_RINT mode, fills both the front and back parts of half2, and returns the converted half2 data. |
|
|
Converts float2 data to the half2 type in line with the CAST_RINT mode and returns the converted half2 data. |
|
|
Returns the low 16 bits of the input data. |
|
|
Fills the low 16 bits of the input data into half2 and returns the result. |
|
|
Extracts the high 16 bits of the input half2 and returns the result. |
|
|
Fills the high 16 bits of the input data into half2 and returns the result. |
|
|
Extracts the high 16 bits from each of the two half2 inputs, fills them into half2, and returns the result. |
|
|
Extracts the low 16 bits from each of the two half2 inputs, fills them into half2, and returns the result. |
|
|
Fills the input data into the front and rear components of half2 and returns the filled data. |
|
|
Converts the two components of half2 to float values, fills them into float2, and returns the result. |
|
|
Reinterprets the bits in an integer as a floating-point number. |
|
|
Reinterprets the bits in an unsigned integer as a floating-point number. |
|
|
Reinterprets the bits in a floating-point number as a signed integer. |
|
|
Reinterprets the bits in a floating-point number as an unsigned integer. |
|
|
Reinterprets the bits of an unsigned short int as a half-precision floating-point number, reading the stored bits in half format. |
|
|
Reinterprets the bits of an unsigned short int as a bfloat16 value, reading the stored bits in bfloat16 format. |
|
API |
Function |
|---|---|
|
Creates a vector of the int2 type from two given int values. |
|
|
Creates a vector of the int4 type from four given int values. |
|
|
Creates a vector of the uint2 type from two given unsigned int values. |
|
|
Creates a vector of the uint4 type from four given unsigned int values. |
|
|
Creates a vector of the ulonglong2 type from two given unsigned long long int values. |
|
|
Creates a vector of the ulonglong4 type from four given unsigned long long int values. |
|
|
Creates a vector of the longlong2 type from two given long long int values. |
|
|
Creates a vector of the longlong4 type from four given long long int values. |
|
|
Creates a vector of the ulong2 type from two given unsigned long int values. |
|
|
Creates a vector of the ulong4 type from four given unsigned long int values. |
|
|
Creates a vector of the long2 type from two given long int values. |
|
|
Creates a vector of the long4 type from four given long int values. |
|
|
Creates a vector of the float2 type from two given float values. |
|
|
Creates a vector of the float4 type from four given float values. |
|
|
Creates a vector of the short2 type from two given short values. |
|
|
Creates a vector of the short4 type from four given short values. |
|
|
Creates a vector of the ushort2 type from two given unsigned short values. |
|
|
Creates a vector of the ushort4 type from four given unsigned short values. |
|
|
Creates a vector of the uchar2 type from two given unsigned char values. |
|
|
Creates a vector of the uchar4 type from four given unsigned char values. |
|
|
Creates a vector of the char2 type from two given signed char values. |
|
|
Creates a vector of the char4 type from four given signed char values. |
|
|
Creates a vector of the half2 type from two given half values. |
|
|
Creates a vector of the bfloat16x2_t type from two given bfloat16_t values. |
|
API |
Function |
|---|---|
|
Loads cached data from the L2 cache. If the cache hit occurs, the data is returned directly. If the cache miss occurs, the data is preloaded from Global Memory into L2 Cache and then returned. |
|
|
First loads cached data from data cache. If cache miss occurs, it attempts to load from L2 cache. If the required data is not found in either data cache or L2 cache, it is fetched from global memory and then cached into both L2 cache and data cache. |
|
|
Stores specified data to the address of the global memory and caches the data to the L2 cache, but not to the data cache. |
|
|
Stores specified data to the address of the global memory and caches the data to the data cache and L2 cache. |
Utils API
|
API |
Function |
|---|---|
|
Compares two operands of the same data type and returns the larger value. |
|
|
Compares two operands of the same data type and returns the smaller value. |
|
|
Obtains the absolute value of the input data. |
|
|
Computes the square root of the input data. |
|
|
Generates an integer sequence. |
|
|
Stores multiple elements of different types as a container. |
|
|
Extracts elements from the tuple container at a specified position. |
|
|
Creates a tuple object conveniently. |
|
|
Determines whether implicit conversion can be performed between two types during program build. |
|
|
Determines whether a type is a base class of another type during program build. |
|
|
Determines whether two types are the same during program build. |
|
|
Checks whether a type is the void type during program compilation. |
|
|
Checks whether a type is the integer type during program compilation. |
|
|
Checks whether a type is the floating-point type during program compilation. |
|
|
Checks whether a type is the array type during program compilation. |
|
|
Checks whether a type is the pointer type during program compilation. |
|
|
Checks whether a type is the reference type during program compilation. |
|
|
Checks whether a type is const-qualified during program compilation. |
|
|
Removes const qualifiers from the input template parameter type during program compilation. |
|
|
Removes volatile qualifiers from the input template parameter type during program compilation. |
|
|
Removes const or volatile qualifiers or removes both simultaneously from the input template parameter type during program compilation. |
|
|
Removes reference qualifiers from a given type during program compilation. |
|
|
Removes pointer qualifiers from a given type during program compilation. |
|
|
Adds const qualifiers to a specified type during program compilation. |
|
|
Adds volatile qualifiers to a specified type during program compilation. |
|
|
Adds const and volatile qualifiers to a specified type during program compilation. |
|
|
Adds pointer qualifiers to a specified type during program compilation. |
|
|
Adds a left-value reference qualifier to a specified type during program compilation. |
|
|
Adds a right-value reference qualifier to a specified type during program compilation. |
|
|
Enables or disables a specific function template, class template, or template specialization based on a condition during program build. |
|
|
Selects one of two types based on a Boolean condition during program build. |
|
|
Encapsulates a compile-time constant integer value, which is the fundamental component of many type traits and compile-time computations in the standard library. |
|
API |
Function |
|---|---|
|
Obtains hardware platform information, such as the number of cores on a hardware platform for tiling computation to implement the tiling function on the host. The PlatformAscendC class provides a function for obtaining such platform information. |
|
|
Obtains hardware platform information, such as the number of cores on the hardware platform, to call operators in the basic mode (kernel launch) based on the kernel launch operator project. The PlatformAscendCManager class provides the function of obtaining platform information. |
|
API |
Function |
|---|---|
|
Registers the prototype definition of an operator. |
|
|
Defines the operator prototype. |
|
|
Defines operator parameters. |
|
|
Defines operator attributes. |
|
|
Defines the implementation information of the AI Processor and associates the tiling implementation and shape inference functions. |
|
|
Configures AI Core information. |
|
|
Configures the communication domain name of an MC2 operator on the host. Once the domain is configured, the kernel side can retrieve the corresponding context address associated with that communication domain. |
|
API |
Function |
|---|---|
|
Defines a TilingData class and adds required member variables (TilingData fields) to store required TilingData parameters. After the TilingData class is defined, this class inherits the TilingDef class (base class for storing and processing user-defined Tiling structure member variables) to provide APIs for setting, serializing, and saving TilingData fields. |
|
|
Registers the defined TilingData structure and binds it with a custom operator. |
|
API |
Function |
|---|---|
|
Defines the template argument declaration ASCENDC_TPL_ARGS_DECL and the template argument combination ASCENDC_TPL_ARGS_SEL (available template). |
|
|
Automatically generates a TilingKey during tiling template programming. This API converts the passed template arguments into binary values based on the defined bit width, combines the binary values in sequence, and then converts the values into uint64, that is, TilingKey. |
|
|
Automatically generates and configures a TilingKey during tiling template programming. |
|
API |
Function |
|---|---|
|
Compiles a specified program. |
|
|
Creates an instance of the compiler using the given parameters. |
|
|
Destroys an instance of the compiler. |
|
|
Obtains the compiled binary data. |
|
|
Obtains the size of the compiled binary data. This API is used to allocate memory space when the aclrtcGetBinData API is used to obtain the binary data. |
|
|
Obtains the size of the compilation log. This API is used to allocate the memory space when the aclrtcGetCompileLog API is used to obtain the log content. |
|
|
Obtains the content of the compilation log and saves it as a character string. |
|
API |
Function |
|---|---|
|
Provides the function of printing logs on the host. You can use the ASC_CPU_LOG_XXX API in the TilingFunc code of the operator to output related content. |
|
API |
Function |
|---|---|
|
In the operator kernel implementation code, call the printf API to print related content when log information needs to be output. |
|
|
Provides the assert function in SIMT VF debugging scenarios. In the SIMT VF implementation code on the operator kernel side, if the internal assert condition evaluates to false, the condition is output and the input information is formatted and printed to the screen. |
|
|
Calling this API in the SIMT VF implementation code will interrupt the operator execution. |
|
|
Provides the clock timestamp function in the SIMT VF debugging scenario. It records the number of clock cycles (Cycle Count) from program start to the moment of API invocation, enabling precise analysis of execution latency and performance bottlenecks. |