asc_stwt

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

x

Atlas A2 training product/Atlas A2 inference product

x

Atlas 200I/500 A2 inference product

x

Atlas inference product AI Core

x

Atlas inference product Vector Core

x

Atlas training product

x

Function Usage

Stores specified data to the address of the global memory and caches the data to the data cache and L2 cache.

Prototype

1
inline void asc_stwt(long int* address, long int val)
1
inline void asc_stwt(unsigned long int* address, unsigned long int val)
1
inline void asc_stwt(long long int* address, long long int val)
1
inline void asc_stwt(unsigned long long int* address, unsigned long long int val)
1
inline void asc_stwt(long2* address, long2 val)
1
inline void asc_stwt(ulong2* address, ulong2 val)
1
inline void asc_stwt(long4* address, long4 val)
1
inline void asc_stwt(ulong4* address, ulong4 val)
1
inline void asc_stwt(longlong2* address, longlong2 val)
1
inline void asc_stwt(ulonglong2* address, ulonglong2 val)
1
inline void asc_stwt(longlong4* address, longlong4 val)
1
inline void asc_stwt(ulonglong4* address, ulonglong4 val)
1
inline void asc_stwt(signed char* address, signed char val)
1
inline void asc_stwt(unsigned char* address, unsigned char val)
1
inline void asc_stwt(char2* address, char2 val)
1
inline void asc_stwt(uchar2* address, uchar2 val)
1
inline void asc_stwt(char4* address, char4 val)
1
inline void asc_stwt(uchar4* address, uchar4 val)
1
inline void asc_stwt(short* address, short val)
1
inline void asc_stwt(unsigned short* address, unsigned short val)
1
inline void asc_stwt(short2* address, short2 val)
1
inline void asc_stwt(ushort2* address, ushort2 val)
1
inline void asc_stwt(short4* address, short4 val)
1
inline void asc_stwt(ushort4* address, ushort4 val)
1
inline void asc_stwt(int* address, int val)
1
inline void asc_stwt(unsigned int* address, unsigned int val)
1
inline void asc_stwt(int2* address, int2 val)
1
inline void asc_stwt(uint2* address, uint2 val)
1
inline void asc_stwt(int4* address, int4 val)
1
inline void asc_stwt(uint4* address, uint4 val)
1
inline void asc_stwt(float* address, float val)
1
inline void asc_stwt(float2* address, float2 val)
1
inline void asc_stwt(float4* address, float4 val)
1
inline void asc_stwt(bfloat16_t* address, bfloat16_t val)
1
inline void asc_stwt(bfloat16x2_t* address, bfloat16x2_t val)
1
inline void asc_stwt(half* address, half val)
1
inline void asc_stwt(half2* address, half2 val)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

address

Input

Address of the Global Memory

val

Input

Source operand.

Returns

None

Restrictions

For SIMT programming, this API is not supported.

Header Files to Be Included

To use APIs of types other than half, half2, bfloat16_t, and bfloat16x2_t, include the simt_api/device_functions.h header file. To use APIs of the half and half2 types, include the simt_api/asc_fp16.h header file. To use APIs of the bfloat16_t and bfloat16x2_t types, include the simt_api/asc_bf16.h header file.

1
#include "simt_api/device_functions.h"
1
#include "simt_api/asc_fp16.h"
1
#include "simt_api/asc_bf16.h"

Examples

For SIMD and SIMT programming:
1
2
3
4
5
__simt_vf__ __launch_bounds__(1024) inline void kernel_asc_stwt(__gm__ float* src, __gm__ float* val)
{
    int idx = threadIdx.x + blockIdx.x * blockDim.x;
    asc_stwt(src + idx, val[idx]);
}