make_bfloat162
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
x |
|
x |
|
x |
|
x |
|
x |
|
x |
Function Usage
Creates a bfloat16x2_t vector from two given bfloat16_t values. For 16-bit data types, the underlying instructions support performing computations on two data elements simultaneously. Computational efficiency can be improved through vector type construction.
Prototype
1 | inline bfloat16x2_t make_bfloat162(bfloat16_t x, bfloat16_t y) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
x |
Input |
Source operand. |
y |
Input |
Source operand. |
Returns
A new bfloat16x2_t vector consisting of the two bfloat16 values
Restrictions
For SIMT programming, this API is not supported.
Header Files to Be Included
To use this API, the simt_api/asc_bf16.h header file must be included.
1 | #include "simt_api/asc_bf16.h" |
Examples
1 2 3 4 5 | __simt_vf__ __launch_bounds__(1024) inline void kernel_make_bfloat162(__gm__ bfloat16x2_t* dst, __gm__ bfloat16_t* x, __gm__ bfloat16_t* y) { int idx = threadIdx.x + blockIdx.x * blockDim.x; dst[idx] = make_bfloat162(x[idx], y[idx]); } |