make_half2
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
x |
|
x |
|
x |
|
x |
|
x |
|
x |
Function Usage
Creates a half2 vector from two given half 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 half2 make_half2(half x, half y) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
x |
Input |
Source operand. |
y |
Input |
Source operand. |
Returns
A new half2 vector consisting of the two half values
Restrictions
For SIMT programming, this API is not supported.
Header Files to Be Included
To use this API, the simt_api/asc_fp16.h header file must be included.
1 | #include "simt_api/asc_fp16.h" |
Examples
1 2 3 4 5 | __simt_vf__ __launch_bounds__(1024) inline void kernel_make_half2(__gm__ half2* dst, __gm__ half* x, __gm__ half* y) { int idx = threadIdx.x + blockIdx.x * blockDim.x; dst[idx] = make_half2(x[idx], y[idx]); } |