| @@ -2105,6 +2105,7 @@ | |||
| 2105 | - [\_\_float22hif82\_rh](SIMT-API/math_functions/fp8_type/fp8_conversion_functions/__float22hif82_rh.md) | 2105 | - [\_\_float22hif82\_rh](SIMT-API/math_functions/fp8_type/fp8_conversion_functions/__float22hif82_rh.md) |
| 2106 | - [\_\_float22hif82\_rh\_sat](SIMT-API/math_functions/fp8_type/fp8_conversion_functions/__float22hif82_rh_sat.md) | 2106 | - [\_\_float22hif82\_rh\_sat](SIMT-API/math_functions/fp8_type/fp8_conversion_functions/__float22hif82_rh_sat.md) |
| 2107 | - [\_\_asc\_cvt\_float2\_to\_fp8x2](SIMT-API/math_functions/fp8_type/fp8_conversion_functions/__asc_cvt_float2_to_fp8x2.md) | 2107 | - [\_\_asc\_cvt\_float2\_to\_fp8x2](SIMT-API/math_functions/fp8_type/fp8_conversion_functions/__asc_cvt_float2_to_fp8x2.md) |
| 2108 | + - [\_\_asc\_cvt\_float\_to\_fp8](SIMT-API/math_functions/fp8_type/fp8_conversion_functions/__asc_cvt_float_to_fp8.md) | ||
| 2108 | - [\_\_half22hif82\_rna](SIMT-API/math_functions/fp8_type/fp8_conversion_functions/__half22hif82_rna.md) | 2109 | - [\_\_half22hif82\_rna](SIMT-API/math_functions/fp8_type/fp8_conversion_functions/__half22hif82_rna.md) |
| 2109 | - [\_\_half22hif82\_rna\_sat](SIMT-API/math_functions/fp8_type/fp8_conversion_functions/__half22hif82_rna_sat.md) | 2110 | - [\_\_half22hif82\_rna\_sat](SIMT-API/math_functions/fp8_type/fp8_conversion_functions/__half22hif82_rna_sat.md) |
| 2110 | - [\_\_half22hif82\_rh](SIMT-API/math_functions/fp8_type/fp8_conversion_functions/__half22hif82_rh.md) | 2111 | - [\_\_half22hif82\_rh](SIMT-API/math_functions/fp8_type/fp8_conversion_functions/__half22hif82_rh.md) |
| @@ -2205,6 +2206,16 @@ | |||
| 2205 | - [\_\_half2int\_ru](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2int_ru.md) | 2206 | - [\_\_half2int\_ru](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2int_ru.md) |
| 2206 | - [\_\_half2ull\_rn](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2ull_rn.md) | 2207 | - [\_\_half2ull\_rn](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2ull_rn.md) |
| 2207 | - [\_\_half2int\_rna](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2int_rna.md) | 2208 | - [\_\_half2int\_rna](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2int_rna.md) |
| 2209 | + - [\_\_half2char\_rz](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2char_rz.md) | ||
| 2210 | + - [\_\_half2uchar\_rz](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2uchar_rz.md) | ||
| 2211 | + - [\_\_half2short\_rn](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2short_rn.md) | ||
| 2212 | + - [\_\_half2short\_rz](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2short_rz.md) | ||
| 2213 | + - [\_\_half2short\_rd](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2short_rd.md) | ||
| 2214 | + - [\_\_half2short\_ru](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2short_ru.md) | ||
| 2215 | + - [\_\_half2ushort\_rn](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2ushort_rn.md) | ||
| 2216 | + - [\_\_half2ushort\_rz](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2ushort_rz.md) | ||
| 2217 | + - [\_\_half2ushort\_rd](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2ushort_rd.md) | ||
| 2218 | + - [\_\_half2ushort\_ru](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2ushort_ru.md) | ||
| 2208 | - [\_\_half2ull\_rz](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2ull_rz.md) | 2219 | - [\_\_half2ull\_rz](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2ull_rz.md) |
| 2209 | - [\_\_half2ull\_rd](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2ull_rd.md) | 2220 | - [\_\_half2ull\_rd](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2ull_rd.md) |
| 2210 | - [\_\_half2ull\_ru](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2ull_ru.md) | 2221 | - [\_\_half2ull\_ru](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2ull_ru.md) |
| @@ -2244,6 +2255,14 @@ | |||
| 2244 | - [\_\_int2half\_ru\_sat](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__int2half_ru_sat.md) | 2255 | - [\_\_int2half\_ru\_sat](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__int2half_ru_sat.md) |
| 2245 | - [\_\_int2half\_rna](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__int2half_rna.md) | 2256 | - [\_\_int2half\_rna](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__int2half_rna.md) |
| 2246 | - [\_\_int2half\_rna\_sat](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__int2half_rna_sat.md) | 2257 | - [\_\_int2half\_rna\_sat](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__int2half_rna_sat.md) |
| 2258 | + - [\_\_short2half\_rn](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__short2half_rn.md) | ||
| 2259 | + - [\_\_short2half\_rz](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__short2half_rz.md) | ||
| 2260 | + - [\_\_short2half\_rd](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__short2half_rd.md) | ||
| 2261 | + - [\_\_short2half\_ru](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__short2half_ru.md) | ||
| 2262 | + - [\_\_ushort2half\_rn](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__ushort2half_rn.md) | ||
| 2263 | + - [\_\_ushort2half\_rz](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__ushort2half_rz.md) | ||
| 2264 | + - [\_\_ushort2half\_rd](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__ushort2half_rd.md) | ||
| 2265 | + - [\_\_ushort2half\_ru](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__ushort2half_ru.md) | ||
| 2247 | - [\_\_ull2half\_rn](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__ull2half_rn.md) | 2266 | - [\_\_ull2half\_rn](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__ull2half_rn.md) |
| 2248 | - [\_\_ull2half\_rz](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__ull2half_rz.md) | 2267 | - [\_\_ull2half\_rz](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__ull2half_rz.md) |
| 2249 | - [\_\_ull2half\_rd](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__ull2half_rd.md) | 2268 | - [\_\_ull2half\_rd](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__ull2half_rd.md) |
| @@ -2256,6 +2275,7 @@ | |||
| 2256 | - [\_\_ll2half\_rna](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__ll2half_rna.md) | 2275 | - [\_\_ll2half\_rna](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__ll2half_rna.md) |
| 2257 | - [\_\_floats2half2\_rn](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__floats2half2_rn.md) | 2276 | - [\_\_floats2half2\_rn](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__floats2half2_rn.md) |
| 2258 | - [\_\_float22half2\_rn](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__float22half2_rn.md) | 2277 | - [\_\_float22half2\_rn](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__float22half2_rn.md) |
| 2278 | + - [\_\_float2half2\_rn](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__float2half2_rn.md) | ||
| 2259 | - [\_\_low2half](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__low2half.md) | 2279 | - [\_\_low2half](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__low2half.md) |
| 2260 | - [\_\_low2half2](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__low2half2.md) | 2280 | - [\_\_low2half2](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__low2half2.md) |
| 2261 | - [\_\_low2float](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__low2float.md) | 2281 | - [\_\_low2float](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__low2float.md) |
| @@ -2266,7 +2286,11 @@ | |||
| 2266 | - [\_\_highs2half2](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__highs2half2.md) | 2286 | - [\_\_highs2half2](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__highs2half2.md) |
| 2267 | - [\_\_lows2half2](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__lows2half2.md) | 2287 | - [\_\_lows2half2](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__lows2half2.md) |
| 2268 | - [\_\_halves2half2](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__halves2half2.md) | 2288 | - [\_\_halves2half2](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__halves2half2.md) |
| 2289 | + - [\_\_half2half2](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2half2.md) | ||
| 2269 | - [\_\_half22float2](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half22float2.md) | 2290 | - [\_\_half22float2](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half22float2.md) |
| 2291 | + - [\_\_half\_as\_short](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half_as_short.md) | ||
| 2292 | + - [\_\_half\_as\_ushort](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half_as_ushort.md) | ||
| 2293 | + - [\_\_short\_as\_half](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__short_as_half.md) | ||
| 2270 | - [\_\_ushort\_as\_half](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__ushort_as_half.md) | 2294 | - [\_\_ushort\_as\_half](SIMT-API/math_functions/half_type/half_precision_conversion_functions/__ushort_as_half.md) |
| 2271 | 2295 | ||
| 2272 | - [half2类型算术函数](SIMT-API/math_functions/half_type/half2_arithmetic_functions/half2_arithmetic_functions.md) | 2296 | - [half2类型算术函数](SIMT-API/math_functions/half_type/half2_arithmetic_functions/half2_arithmetic_functions.md) |
| @@ -2432,6 +2456,16 @@ | |||
| 2432 | - [\_\_bfloat162int\_rd](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162int_rd.md) | 2456 | - [\_\_bfloat162int\_rd](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162int_rd.md) |
| 2433 | - [\_\_bfloat162int\_ru](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162int_ru.md) | 2457 | - [\_\_bfloat162int\_ru](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162int_ru.md) |
| 2434 | - [\_\_bfloat162int\_rna](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162int_rna.md) | 2458 | - [\_\_bfloat162int\_rna](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162int_rna.md) |
| 2459 | + - [\_\_bfloat162char\_rz](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162char_rz.md) | ||
| 2460 | + - [\_\_bfloat162uchar\_rz](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162uchar_rz.md) | ||
| 2461 | + - [\_\_bfloat162short\_rn](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162short_rn.md) | ||
| 2462 | + - [\_\_bfloat162short\_rz](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162short_rz.md) | ||
| 2463 | + - [\_\_bfloat162short\_rd](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162short_rd.md) | ||
| 2464 | + - [\_\_bfloat162short\_ru](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162short_ru.md) | ||
| 2465 | + - [\_\_bfloat162ushort\_rn](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ushort_rn.md) | ||
| 2466 | + - [\_\_bfloat162ushort\_rz](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ushort_rz.md) | ||
| 2467 | + - [\_\_bfloat162ushort\_rd](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ushort_rd.md) | ||
| 2468 | + - [\_\_bfloat162ushort\_ru](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ushort_ru.md) | ||
| 2435 | - [\_\_bfloat162ull\_rn](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ull_rn.md) | 2469 | - [\_\_bfloat162ull\_rn](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ull_rn.md) |
| 2436 | - [\_\_bfloat162ull\_rz](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ull_rz.md) | 2470 | - [\_\_bfloat162ull\_rz](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ull_rz.md) |
| 2437 | - [\_\_bfloat162ull\_rd](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ull_rd.md) | 2471 | - [\_\_bfloat162ull\_rd](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ull_rd.md) |
| @@ -2452,6 +2486,14 @@ | |||
| 2452 | - [\_\_int2bfloat16\_rd](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__int2bfloat16_rd.md) | 2486 | - [\_\_int2bfloat16\_rd](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__int2bfloat16_rd.md) |
| 2453 | - [\_\_int2bfloat16\_ru](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__int2bfloat16_ru.md) | 2487 | - [\_\_int2bfloat16\_ru](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__int2bfloat16_ru.md) |
| 2454 | - [\_\_int2bfloat16\_rna](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__int2bfloat16_rna.md) | 2488 | - [\_\_int2bfloat16\_rna](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__int2bfloat16_rna.md) |
| 2489 | + - [\_\_short2bfloat16\_rn](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__short2bfloat16_rn.md) | ||
| 2490 | + - [\_\_short2bfloat16\_rz](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__short2bfloat16_rz.md) | ||
| 2491 | + - [\_\_short2bfloat16\_rd](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__short2bfloat16_rd.md) | ||
| 2492 | + - [\_\_short2bfloat16\_ru](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__short2bfloat16_ru.md) | ||
| 2493 | + - [\_\_ushort2bfloat16\_rn](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort2bfloat16_rn.md) | ||
| 2494 | + - [\_\_ushort2bfloat16\_rz](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort2bfloat16_rz.md) | ||
| 2495 | + - [\_\_ushort2bfloat16\_rd](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort2bfloat16_rd.md) | ||
| 2496 | + - [\_\_ushort2bfloat16\_ru](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort2bfloat16_ru.md) | ||
| 2455 | - [\_\_ull2bfloat16\_rn](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ull2bfloat16_rn.md) | 2497 | - [\_\_ull2bfloat16\_rn](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ull2bfloat16_rn.md) |
| 2456 | - [\_\_ull2bfloat16\_rz](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ull2bfloat16_rz.md) | 2498 | - [\_\_ull2bfloat16\_rz](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ull2bfloat16_rz.md) |
| 2457 | - [\_\_ull2bfloat16\_rd](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ull2bfloat16_rd.md) | 2499 | - [\_\_ull2bfloat16\_rd](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ull2bfloat16_rd.md) |
| @@ -2477,6 +2519,9 @@ | |||
| 2477 | - [\_\_lowhigh2highlow](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__lowhigh2highlow.md) | 2519 | - [\_\_lowhigh2highlow](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__lowhigh2highlow.md) |
| 2478 | - [\_\_lows2bfloat162](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__lows2bfloat162.md) | 2520 | - [\_\_lows2bfloat162](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__lows2bfloat162.md) |
| 2479 | - [\_\_bfloat1622float2](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat1622float2.md) | 2521 | - [\_\_bfloat1622float2](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat1622float2.md) |
| 2522 | + - [\_\_bfloat16\_as\_short](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat16_as_short.md) | ||
| 2523 | + - [\_\_bfloat16\_as\_ushort](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat16_as_ushort.md) | ||
| 2524 | + - [\_\_short\_as\_bfloat16](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__short_as_bfloat16.md) | ||
| 2480 | - [\_\_ushort\_as\_bfloat16](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort_as_bfloat16.md) | 2525 | - [\_\_ushort\_as\_bfloat16](SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort_as_bfloat16.md) |
| 2481 | 2526 | ||
| 2482 | - [bfloat16x2类型算术函数](SIMT-API/math_functions/bfloat16_type/bfloat16x2_arithmetic_functions/bfloat16x2_arithmetic_functions.md) | 2527 | - [bfloat16x2类型算术函数](SIMT-API/math_functions/bfloat16_type/bfloat16x2_arithmetic_functions/bfloat16x2_arithmetic_functions.md) |
| @@ -2613,9 +2658,13 @@ | |||
| 2613 | - [y1f](SIMT-API/math_functions/float_math_functions/y1f.md) | 2658 | - [y1f](SIMT-API/math_functions/float_math_functions/y1f.md) |
| 2614 | - [ynf](SIMT-API/math_functions/float_math_functions/ynf.md) | 2659 | - [ynf](SIMT-API/math_functions/float_math_functions/ynf.md) |
| 2615 | - [fabsf](SIMT-API/math_functions/float_math_functions/fabsf.md) | 2660 | - [fabsf](SIMT-API/math_functions/float_math_functions/fabsf.md) |
| 2661 | + - [abs](SIMT-API/math_functions/float_math_functions/abs.md) | ||
| 2616 | - [fmaf](SIMT-API/math_functions/float_math_functions/fmaf.md) | 2662 | - [fmaf](SIMT-API/math_functions/float_math_functions/fmaf.md) |
| 2617 | - [fmaxf](SIMT-API/math_functions/float_math_functions/fmaxf.md) | 2663 | - [fmaxf](SIMT-API/math_functions/float_math_functions/fmaxf.md) |
| 2664 | + - [max](SIMT-API/math_functions/float_math_functions/max.md) | ||
| 2618 | - [fminf](SIMT-API/math_functions/float_math_functions/fminf.md) | 2665 | - [fminf](SIMT-API/math_functions/float_math_functions/fminf.md) |
| 2666 | + - [min](SIMT-API/math_functions/float_math_functions/min.md) | ||
| 2667 | + - [nanf](SIMT-API/math_functions/float_math_functions/nanf.md) | ||
| 2619 | - [fdimf](SIMT-API/math_functions/float_math_functions/fdimf.md) | 2668 | - [fdimf](SIMT-API/math_functions/float_math_functions/fdimf.md) |
| 2620 | - [remquof](SIMT-API/math_functions/float_math_functions/remquof.md) | 2669 | - [remquof](SIMT-API/math_functions/float_math_functions/remquof.md) |
| 2621 | - [fmodf](SIMT-API/math_functions/float_math_functions/fmodf.md) | 2670 | - [fmodf](SIMT-API/math_functions/float_math_functions/fmodf.md) |
| @@ -83,6 +83,7 @@ | |||
| 83 | | [__float22hif82_rh](../math_functions/fp8_type/fp8_conversion_functions/__float22hif82_rh.md) | 获取输入的两个分量遵循CAST_HYBRID模式转换成的hifloat8x2_t类型数据。 | | 83 | | [__float22hif82_rh](../math_functions/fp8_type/fp8_conversion_functions/__float22hif82_rh.md) | 获取输入的两个分量遵循CAST_HYBRID模式转换成的hifloat8x2_t类型数据。 | |
| 84 | | [__float22hif82_rh_sat](../math_functions/fp8_type/fp8_conversion_functions/__float22hif82_rh_sat.md) | 饱和模式下获取输入的两个分量遵循CAST_HYBRID模式转换成的hifloat8x2_t类型数据。 | | 84 | | [__float22hif82_rh_sat](../math_functions/fp8_type/fp8_conversion_functions/__float22hif82_rh_sat.md) | 饱和模式下获取输入的两个分量遵循CAST_HYBRID模式转换成的hifloat8x2_t类型数据。 | |
| 85 | | [__asc_cvt_float2_to_fp8x2](../math_functions/fp8_type/fp8_conversion_functions/__asc_cvt_float2_to_fp8x2.md) | 输入的两个分量遵循CAST_RINT模式,根据指定的8位浮点数类型和指定的饱和模式,转换成__asc_fp8x2_storage_t类型数据。 | | 85 | | [__asc_cvt_float2_to_fp8x2](../math_functions/fp8_type/fp8_conversion_functions/__asc_cvt_float2_to_fp8x2.md) | 输入的两个分量遵循CAST_RINT模式,根据指定的8位浮点数类型和指定的饱和模式,转换成__asc_fp8x2_storage_t类型数据。 | |
| 86 | +| [__asc_cvt_float_to_fp8](../math_functions/fp8_type/fp8_conversion_functions/__asc_cvt_float_to_fp8.md) | 将float类型数据按照CAST_RINT模式转换为指定类型的8位浮点数。 | | ||
api/README.md未修改 ![]() ![]() | |||
| 86 | | [__half22hif82_rna](../math_functions/fp8_type/fp8_conversion_functions/__half22hif82_rna.md) | 获取输入的两个分量遵循CAST_ROUND模式转换成的hifloat8x2_t类型数据。 | | 87 | | [__half22hif82_rna](../math_functions/fp8_type/fp8_conversion_functions/__half22hif82_rna.md) | 获取输入的两个分量遵循CAST_ROUND模式转换成的hifloat8x2_t类型数据。 | |
| 87 | | [__half22hif82_rna_sat](../math_functions/fp8_type/fp8_conversion_functions/__half22hif82_rna_sat.md) | 饱和模式下获取输入的两个分量遵循CAST_ROUND模式转换成的hifloat8x2_t类型数据。 | | 88 | | [__half22hif82_rna_sat](../math_functions/fp8_type/fp8_conversion_functions/__half22hif82_rna_sat.md) | 饱和模式下获取输入的两个分量遵循CAST_ROUND模式转换成的hifloat8x2_t类型数据。 | |
| 88 | | [__half22hif82_rh](../math_functions/fp8_type/fp8_conversion_functions/__half22hif82_rh.md) | 获取输入的两个分量遵循CAST_HYBRID模式转换成的hifloat8x2_t类型数据。 | | 89 | | [__half22hif82_rh](../math_functions/fp8_type/fp8_conversion_functions/__half22hif82_rh.md) | 获取输入的两个分量遵循CAST_HYBRID模式转换成的hifloat8x2_t类型数据。 | |
| @@ -193,6 +194,16 @@ | |||
| 193 | | [__half2int_rd](../math_functions/half_type/half_precision_conversion_functions/__half2int_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的有符号整数。 | | 194 | | [__half2int_rd](../math_functions/half_type/half_precision_conversion_functions/__half2int_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的有符号整数。 | |
| 194 | | [__half2int_ru](../math_functions/half_type/half_precision_conversion_functions/__half2int_ru.md) | 获取输入遵循CAST_CEIL模式转换成的有符号整数。 | | 195 | | [__half2int_ru](../math_functions/half_type/half_precision_conversion_functions/__half2int_ru.md) | 获取输入遵循CAST_CEIL模式转换成的有符号整数。 | |
| 195 | | [__half2int_rna](../math_functions/half_type/half_precision_conversion_functions/__half2int_rna.md) | 获取输入遵循CAST_ROUND模式转换成的有符号整数。 | | 196 | | [__half2int_rna](../math_functions/half_type/half_precision_conversion_functions/__half2int_rna.md) | 获取输入遵循CAST_ROUND模式转换成的有符号整数。 | |
| 197 | +| [__half2char_rz](../math_functions/half_type/half_precision_conversion_functions/__half2char_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的signed char类型数据。 | | ||
| 198 | +| [__half2uchar_rz](../math_functions/half_type/half_precision_conversion_functions/__half2uchar_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的unsigned char类型数据。 | | ||
| 199 | +| [__half2short_rn](../math_functions/half_type/half_precision_conversion_functions/__half2short_rn.md) | 获取输入遵循CAST_RINT模式转换成的short int类型数据。 | | ||
| 200 | +| [__half2short_rz](../math_functions/half_type/half_precision_conversion_functions/__half2short_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的short int类型数据。 | | ||
| 201 | +| [__half2short_rd](../math_functions/half_type/half_precision_conversion_functions/__half2short_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的short int类型数据。 | | ||
| 202 | +| [__half2short_ru](../math_functions/half_type/half_precision_conversion_functions/__half2short_ru.md) | 获取输入遵循CAST_CEIL模式转换成的short int类型数据。 | | ||
| 203 | +| [__half2ushort_rn](../math_functions/half_type/half_precision_conversion_functions/__half2ushort_rn.md) | 获取输入遵循CAST_RINT模式转换成的unsigned short int类型数据。 | | ||
| 204 | +| [__half2ushort_rz](../math_functions/half_type/half_precision_conversion_functions/__half2ushort_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的unsigned short int类型数据。 | | ||
| 205 | +| [__half2ushort_rd](../math_functions/half_type/half_precision_conversion_functions/__half2ushort_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的unsigned short int类型数据。 | | ||
| 206 | +| [__half2ushort_ru](../math_functions/half_type/half_precision_conversion_functions/__half2ushort_ru.md) | 获取输入遵循CAST_CEIL模式转换成的unsigned short int类型数据。 | | ||
| 196 | | [__half2ull_rn](../math_functions/half_type/half_precision_conversion_functions/__half2ull_rn.md) | 获取输入遵循CAST_RINT模式转换成的64位无符号整数。 | | 207 | | [__half2ull_rn](../math_functions/half_type/half_precision_conversion_functions/__half2ull_rn.md) | 获取输入遵循CAST_RINT模式转换成的64位无符号整数。 | |
| 197 | | [__half2ull_rz](../math_functions/half_type/half_precision_conversion_functions/__half2ull_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的64位无符号整数。 | | 208 | | [__half2ull_rz](../math_functions/half_type/half_precision_conversion_functions/__half2ull_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的64位无符号整数。 | |
| 198 | | [__half2ull_rd](../math_functions/half_type/half_precision_conversion_functions/__half2ull_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的64位无符号整数。 | | 209 | | [__half2ull_rd](../math_functions/half_type/half_precision_conversion_functions/__half2ull_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的64位无符号整数。 | |
| @@ -233,6 +244,14 @@ | |||
| 233 | | [__int2half_ru_sat](../math_functions/half_type/half_precision_conversion_functions/__int2half_ru_sat.md) | 饱和模式下获取输入的int32数据转换成的half数据,并遵循CAST_CEIL模式。 | | 244 | | [__int2half_ru_sat](../math_functions/half_type/half_precision_conversion_functions/__int2half_ru_sat.md) | 饱和模式下获取输入的int32数据转换成的half数据,并遵循CAST_CEIL模式。 | |
| 234 | | [__int2half_rna](../math_functions/half_type/half_precision_conversion_functions/__int2half_rna.md) | 获取输入遵循CAST_ROUND模式转换成的half类型数据。 | | 245 | | [__int2half_rna](../math_functions/half_type/half_precision_conversion_functions/__int2half_rna.md) | 获取输入遵循CAST_ROUND模式转换成的half类型数据。 | |
| 235 | | [__int2half_rna_sat](../math_functions/half_type/half_precision_conversion_functions/__int2half_rna_sat.md) | 饱和模式下获取输入的int32数据转换成的half数据,并遵循CAST_ROUND模式。 | | 246 | | [__int2half_rna_sat](../math_functions/half_type/half_precision_conversion_functions/__int2half_rna_sat.md) | 饱和模式下获取输入的int32数据转换成的half数据,并遵循CAST_ROUND模式。 | |
| 247 | +| [__short2half_rn](../math_functions/half_type/half_precision_conversion_functions/__short2half_rn.md) | 获取输入遵循CAST_RINT模式转换成的half类型数据。 | | ||
| 248 | +| [__short2half_rz](../math_functions/half_type/half_precision_conversion_functions/__short2half_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的half类型数据。 | | ||
| 249 | +| [__short2half_rd](../math_functions/half_type/half_precision_conversion_functions/__short2half_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的half类型数据。 | | ||
| 250 | +| [__short2half_ru](../math_functions/half_type/half_precision_conversion_functions/__short2half_ru.md) | 获取输入遵循CAST_CEIL模式转换成的half类型数据。 | | ||
| 251 | +| [__ushort2half_rn](../math_functions/half_type/half_precision_conversion_functions/__ushort2half_rn.md) | 获取输入遵循CAST_RINT模式转换成的half类型数据。 | | ||
| 252 | +| [__ushort2half_rz](../math_functions/half_type/half_precision_conversion_functions/__ushort2half_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的half类型数据。 | | ||
| 253 | +| [__ushort2half_rd](../math_functions/half_type/half_precision_conversion_functions/__ushort2half_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的half类型数据。 | | ||
| 254 | +| [__ushort2half_ru](../math_functions/half_type/half_precision_conversion_functions/__ushort2half_ru.md) | 获取输入遵循CAST_CEIL模式转换成的half类型数据。 | | ||
| 236 | | [__ull2half_rn](../math_functions/half_type/half_precision_conversion_functions/__ull2half_rn.md) | 获取输入遵循CAST_RINT模式转换成的half类型数据。 | | 255 | | [__ull2half_rn](../math_functions/half_type/half_precision_conversion_functions/__ull2half_rn.md) | 获取输入遵循CAST_RINT模式转换成的half类型数据。 | |
| 237 | | [__ull2half_rz](../math_functions/half_type/half_precision_conversion_functions/__ull2half_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的half类型数据。 | | 256 | | [__ull2half_rz](../math_functions/half_type/half_precision_conversion_functions/__ull2half_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的half类型数据。 | |
| 238 | | [__ull2half_rd](../math_functions/half_type/half_precision_conversion_functions/__ull2half_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的half类型数据。 | | 257 | | [__ull2half_rd](../math_functions/half_type/half_precision_conversion_functions/__ull2half_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的half类型数据。 | |
| @@ -245,6 +264,7 @@ | |||
| 245 | | [__ll2half_rna](../math_functions/half_type/half_precision_conversion_functions/__ll2half_rna.md) | 获取输入遵循CAST_ROUND模式转换成的half类型数据。 | | 264 | | [__ll2half_rna](../math_functions/half_type/half_precision_conversion_functions/__ll2half_rna.md) | 获取输入遵循CAST_ROUND模式转换成的half类型数据。 | |
| 246 | | [__floats2half2_rn](../math_functions/half_type/half_precision_conversion_functions/__floats2half2_rn.md) | 将输入的数据x,y遵循CAST_RINT模式分别转换为half类型并填充到half2的前后两部分,返回转换后的half2类型数据。 | | 265 | | [__floats2half2_rn](../math_functions/half_type/half_precision_conversion_functions/__floats2half2_rn.md) | 将输入的数据x,y遵循CAST_RINT模式分别转换为half类型并填充到half2的前后两部分,返回转换后的half2类型数据。 | |
| 247 | | [__float22half2_rn](../math_functions/half_type/half_precision_conversion_functions/__float22half2_rn.md) | 将float2类型数据遵循CAST_RINT模式转换为half2类型,返回转换后的half2类型数据。 | | 266 | | [__float22half2_rn](../math_functions/half_type/half_precision_conversion_functions/__float22half2_rn.md) | 将float2类型数据遵循CAST_RINT模式转换为half2类型,返回转换后的half2类型数据。 | |
| 267 | +| [__float2half2_rn](../math_functions/half_type/half_precision_conversion_functions/__float2half2_rn.md) | 获取输入遵循CAST_RINT模式转换并复制到两个分量后的half2类型数据。 | | ||
| 248 | | [__low2half](../math_functions/half_type/half_precision_conversion_functions/__low2half.md) | 返回输入数据的低16位。 | | 268 | | [__low2half](../math_functions/half_type/half_precision_conversion_functions/__low2half.md) | 返回输入数据的低16位。 | |
| 249 | | [__low2half2](../math_functions/half_type/half_precision_conversion_functions/__low2half2.md) | 将输入数据的低16位填充到half2并返回。 | | 269 | | [__low2half2](../math_functions/half_type/half_precision_conversion_functions/__low2half2.md) | 将输入数据的低16位填充到half2并返回。 | |
| 250 | | [__low2float](../math_functions/half_type/half_precision_conversion_functions/__low2float.md) | 将输入数据的低16位转换为浮点数并返回结果。 | | 270 | | [__low2float](../math_functions/half_type/half_precision_conversion_functions/__low2float.md) | 将输入数据的低16位转换为浮点数并返回结果。 | |
| @@ -255,7 +275,11 @@ | |||
| 255 | | [__highs2half2](../math_functions/half_type/half_precision_conversion_functions/__highs2half2.md) | 分别提取两个half2输入的高16位,并填充到half2中。返回填充后的数据。 | | 275 | | [__highs2half2](../math_functions/half_type/half_precision_conversion_functions/__highs2half2.md) | 分别提取两个half2输入的高16位,并填充到half2中。返回填充后的数据。 | |
| 256 | | [__lows2half2](../math_functions/half_type/half_precision_conversion_functions/__lows2half2.md) | 分别提取两个half2输入的低16位,并填充到half2中。返回填充后的数据。 | | 276 | | [__lows2half2](../math_functions/half_type/half_precision_conversion_functions/__lows2half2.md) | 分别提取两个half2输入的低16位,并填充到half2中。返回填充后的数据。 | |
| 257 | | [__halves2half2](../math_functions/half_type/half_precision_conversion_functions/__halves2half2.md) | 将输入的数据分别填充为half2前后两个分量,返回填充后数据。 | | 277 | | [__halves2half2](../math_functions/half_type/half_precision_conversion_functions/__halves2half2.md) | 将输入的数据分别填充为half2前后两个分量,返回填充后数据。 | |
| 278 | +| [__half2half2](../math_functions/half_type/half_precision_conversion_functions/__half2half2.md) | 将half输入数据复制到half2的两个分量并返回。 | | ||
| 258 | | [__half22float2](../math_functions/half_type/half_precision_conversion_functions/__half22float2.md) | 将half2的两个分量分别转换为float,并填充到float2返回。 | | 279 | | [__half22float2](../math_functions/half_type/half_precision_conversion_functions/__half22float2.md) | 将half2的两个分量分别转换为float,并填充到float2返回。 | |
| 280 | +| [__half_as_short](../math_functions/half_type/half_precision_conversion_functions/__half_as_short.md) | 将half数据按位重新解释为short int类型数据。 | | ||
| 281 | +| [__half_as_ushort](../math_functions/half_type/half_precision_conversion_functions/__half_as_ushort.md) | 将half数据按位重新解释为unsigned short int类型数据。 | | ||
| 282 | +| [__short_as_half](../math_functions/half_type/half_precision_conversion_functions/__short_as_half.md) | 将short int的按位重新解释为half,即将short int的数据存储的位按照half的格式进行读取。 | | ||
| 259 | | [__ushort_as_half](../math_functions/half_type/half_precision_conversion_functions/__ushort_as_half.md) | 将unsigned short int的按位重新解释为half,即将unsigned short int的数据存储的位按照half的格式进行读取。 | | 283 | | [__ushort_as_half](../math_functions/half_type/half_precision_conversion_functions/__ushort_as_half.md) | 将unsigned short int的按位重新解释为half,即将unsigned short int的数据存储的位按照half的格式进行读取。 | |
| 260 | 284 | ||
| 261 | **表13** half2类型算术函数 | 285 | **表13** half2类型算术函数 |
| @@ -441,6 +465,16 @@ | |||
| 441 | | [__bfloat162int_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162int_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的有符号整数。 | | 465 | | [__bfloat162int_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162int_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的有符号整数。 | |
| 442 | | [__bfloat162int_ru](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162int_ru.md) | 获取输入遵循CAST_CEIL模式转换成的有符号整数。 | | 466 | | [__bfloat162int_ru](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162int_ru.md) | 获取输入遵循CAST_CEIL模式转换成的有符号整数。 | |
| 443 | | [__bfloat162int_rna](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162int_rna.md) | 获取输入遵循CAST_ROUND模式转换成的有符号整数。 | | 467 | | [__bfloat162int_rna](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162int_rna.md) | 获取输入遵循CAST_ROUND模式转换成的有符号整数。 | |
| 468 | +| [__bfloat162char_rz](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162char_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的signed char类型数据。 | | ||
| 469 | +| [__bfloat162uchar_rz](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162uchar_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的unsigned char类型数据。 | | ||
| 470 | +| [__bfloat162short_rn](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162short_rn.md) | 获取输入遵循CAST_RINT模式转换成的short int类型数据。 | | ||
| 471 | +| [__bfloat162short_rz](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162short_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的short int类型数据。 | | ||
| 472 | +| [__bfloat162short_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162short_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的short int类型数据。 | | ||
| 473 | +| [__bfloat162short_ru](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162short_ru.md) | 获取输入遵循CAST_CEIL模式转换成的short int类型数据。 | | ||
| 474 | +| [__bfloat162ushort_rn](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ushort_rn.md) | 获取输入遵循CAST_RINT模式转换成的unsigned short int类型数据。 | | ||
| 475 | +| [__bfloat162ushort_rz](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ushort_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的unsigned short int类型数据。 | | ||
| 476 | +| [__bfloat162ushort_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ushort_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的unsigned short int类型数据。 | | ||
| 477 | +| [__bfloat162ushort_ru](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ushort_ru.md) | 获取输入遵循CAST_CEIL模式转换成的unsigned short int类型数据。 | | ||
| 444 | | [__bfloat162ull_rn](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ull_rn.md) | 获取输入遵循CAST_RINT模式转换成的64位无符号整数。 | | 478 | | [__bfloat162ull_rn](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ull_rn.md) | 获取输入遵循CAST_RINT模式转换成的64位无符号整数。 | |
| 445 | | [__bfloat162ull_rz](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ull_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的64位无符号整数。 | | 479 | | [__bfloat162ull_rz](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ull_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的64位无符号整数。 | |
| 446 | | [__bfloat162ull_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ull_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的64位无符号整数。 | | 480 | | [__bfloat162ull_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ull_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的64位无符号整数。 | |
| @@ -461,6 +495,14 @@ | |||
| 461 | | [__int2bfloat16_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__int2bfloat16_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的bfloat16类型数据。 | | 495 | | [__int2bfloat16_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__int2bfloat16_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的bfloat16类型数据。 | |
| 462 | | [__int2bfloat16_ru](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__int2bfloat16_ru.md) | 获取输入遵循CAST_CEIL模式转换成的bfloat16类型数据。 | | 496 | | [__int2bfloat16_ru](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__int2bfloat16_ru.md) | 获取输入遵循CAST_CEIL模式转换成的bfloat16类型数据。 | |
| 463 | | [__int2bfloat16_rna](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__int2bfloat16_rna.md) | 获取输入遵循CAST_ROUND模式转换成的bfloat16类型数据。 | | 497 | | [__int2bfloat16_rna](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__int2bfloat16_rna.md) | 获取输入遵循CAST_ROUND模式转换成的bfloat16类型数据。 | |
| 498 | +| [__short2bfloat16_rn](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__short2bfloat16_rn.md) | 获取输入遵循CAST_RINT模式转换成的bfloat16类型数据。 | | ||
| 499 | +| [__short2bfloat16_rz](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__short2bfloat16_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的bfloat16类型数据。 | | ||
| 500 | +| [__short2bfloat16_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__short2bfloat16_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的bfloat16类型数据。 | | ||
| 501 | +| [__short2bfloat16_ru](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__short2bfloat16_ru.md) | 获取输入遵循CAST_CEIL模式转换成的bfloat16类型数据。 | | ||
| 502 | +| [__ushort2bfloat16_rn](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort2bfloat16_rn.md) | 获取输入遵循CAST_RINT模式转换成的bfloat16类型数据。 | | ||
| 503 | +| [__ushort2bfloat16_rz](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort2bfloat16_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的bfloat16类型数据。 | | ||
| 504 | +| [__ushort2bfloat16_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort2bfloat16_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的bfloat16类型数据。 | | ||
| 505 | +| [__ushort2bfloat16_ru](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort2bfloat16_ru.md) | 获取输入遵循CAST_CEIL模式转换成的bfloat16类型数据。 | | ||
| 464 | | [__ull2bfloat16_rn](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ull2bfloat16_rn.md) | 获取输入遵循CAST_RINT模式转换成的bfloat16类型数据。 | | 506 | | [__ull2bfloat16_rn](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ull2bfloat16_rn.md) | 获取输入遵循CAST_RINT模式转换成的bfloat16类型数据。 | |
| 465 | | [__ull2bfloat16_rz](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ull2bfloat16_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的bfloat16类型数据。 | | 507 | | [__ull2bfloat16_rz](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ull2bfloat16_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的bfloat16类型数据。 | |
| 466 | | [__ull2bfloat16_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ull2bfloat16_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的bfloat16类型数据。 | | 508 | | [__ull2bfloat16_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ull2bfloat16_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的bfloat16类型数据。 | |
| @@ -486,6 +528,9 @@ | |||
| 486 | | [__lowhigh2highlow](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__lowhigh2highlow.md) | 将输入数据的高低16位进行交换并返回。 | | 528 | | [__lowhigh2highlow](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__lowhigh2highlow.md) | 将输入数据的高低16位进行交换并返回。 | |
| 487 | | [__lows2bfloat162](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__lows2bfloat162.md) | 分别提取两个bfloat16x2输入的低16位,并填充到bfloat16x2中。返回填充后的数据。 | | 529 | | [__lows2bfloat162](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__lows2bfloat162.md) | 分别提取两个bfloat16x2输入的低16位,并填充到bfloat16x2中。返回填充后的数据。 | |
| 488 | | [__bfloat1622float2](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat1622float2.md) | 将bfloat16x2的两个分量分别转换为float,并填充到float2返回。 | | 530 | | [__bfloat1622float2](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat1622float2.md) | 将bfloat16x2的两个分量分别转换为float,并填充到float2返回。 | |
| 531 | +| [__bfloat16_as_short](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat16_as_short.md) | 将bfloat16数据按位重新解释为short int类型数据。 | | ||
| 532 | +| [__bfloat16_as_ushort](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat16_as_ushort.md) | 将bfloat16数据按位重新解释为unsigned short int类型数据。 | | ||
| 533 | +| [__short_as_bfloat16](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__short_as_bfloat16.md) | 将short int的按位重新解释为bfloat16,即将short int的数据存储的位按照bfloat16的格式进行读取。 | | ||
| 489 | | [__ushort_as_bfloat16](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort_as_bfloat16.md) | 将unsigned short int的按位重新解释为bfloat16,即将unsigned short int的数据存储的位按照bfloat16的格式进行读取。 | | 534 | | [__ushort_as_bfloat16](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort_as_bfloat16.md) | 将unsigned short int的按位重新解释为bfloat16,即将unsigned short int的数据存储的位按照bfloat16的格式进行读取。 | |
| 490 | 535 | ||
| 491 | **表20** bfloat16x2类型算术函数 | 536 | **表20** bfloat16x2类型算术函数 |
| @@ -634,9 +679,13 @@ | |||
| 634 | | [y1f](../math_functions/float_math_functions/y1f.md) | 获取输入数据x的1阶第二类贝塞尔函数y1的值。 | | 679 | | [y1f](../math_functions/float_math_functions/y1f.md) | 获取输入数据x的1阶第二类贝塞尔函数y1的值。 | |
| 635 | | [ynf](../math_functions/float_math_functions/ynf.md) | 获取输入数据x的n阶第二类贝塞尔函数yn的值。 | | 680 | | [ynf](../math_functions/float_math_functions/ynf.md) | 获取输入数据x的n阶第二类贝塞尔函数yn的值。 | |
| 636 | | [fabsf](../math_functions/float_math_functions/fabsf.md) | 获取输入数据的绝对值。 | | 681 | | [fabsf](../math_functions/float_math_functions/fabsf.md) | 获取输入数据的绝对值。 | |
| 682 | +| [abs](../math_functions/float_math_functions/abs.md) | 获取float类型输入数据的绝对值。 | | ||
| 637 | | [fmaf](../math_functions/float_math_functions/fmaf.md) | 对输入数据x、y、z,计算x与y相乘加上z的结果。 | | 683 | | [fmaf](../math_functions/float_math_functions/fmaf.md) | 对输入数据x、y、z,计算x与y相乘加上z的结果。 | |
| 638 | | [fmaxf](../math_functions/float_math_functions/fmaxf.md) | 获取两个输入数据中的最大值。 | | 684 | | [fmaxf](../math_functions/float_math_functions/fmaxf.md) | 获取两个输入数据中的最大值。 | |
| 685 | +| [max](../math_functions/float_math_functions/max.md) | 获取两个输入数据中的最大值。 | | ||
| 639 | | [fminf](../math_functions/float_math_functions/fminf.md) | 获取两个输入数据中的最小值。 | | 686 | | [fminf](../math_functions/float_math_functions/fminf.md) | 获取两个输入数据中的最小值。 | |
| 687 | +| [min](../math_functions/float_math_functions/min.md) | 获取两个输入数据中的最小值。 | | ||
| 688 | +| [nanf](../math_functions/float_math_functions/nanf.md) | 根据字符串生成float类型的安静NaN值(浮点尾数最高位为1)。 | | ||
| 640 | | [fdimf](../math_functions/float_math_functions/fdimf.md) | 获取输入数据的差值,差值小于0时,返回0。 | | 689 | | [fdimf](../math_functions/float_math_functions/fdimf.md) | 获取输入数据的差值,差值小于0时,返回0。 | |
| 641 | | [remquof](../math_functions/float_math_functions/remquof.md) | 获取输入数据x除以y的余数。求余数时,商取最接近x除以y浮点数结果的整数,当x除以y的浮点数结果与左右最接近的整数距离相等时,商取偶数,同时将商赋值给指针变量quo。 | | 690 | | [remquof](../math_functions/float_math_functions/remquof.md) | 获取输入数据x除以y的余数。求余数时,商取最接近x除以y浮点数结果的整数,当x除以y的浮点数结果与左右最接近的整数距离相等时,商取偶数,同时将商赋值给指针变量quo。 | |
| 642 | | [fmodf](../math_functions/float_math_functions/fmodf.md) | 获取输入数据x除以y的余数。求余数时,商取x除以y浮点数结果的整数部分。 | | 691 | | [fmodf](../math_functions/float_math_functions/fmodf.md) | 获取输入数据x除以y的余数。求余数时,商取x除以y浮点数结果的整数部分。 | |
| @@ -175,6 +175,16 @@ | |||
| 175 | | [__half2int_rd](../math_functions/half_type/half_precision_conversion_functions/__half2int_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的有符号整数。 | | 175 | | [__half2int_rd](../math_functions/half_type/half_precision_conversion_functions/__half2int_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的有符号整数。 | |
| 176 | | [__half2int_ru](../math_functions/half_type/half_precision_conversion_functions/__half2int_ru.md) | 获取输入遵循CAST_CEIL模式转换成的有符号整数。 | | 176 | | [__half2int_ru](../math_functions/half_type/half_precision_conversion_functions/__half2int_ru.md) | 获取输入遵循CAST_CEIL模式转换成的有符号整数。 | |
| 177 | | [__half2int_rna](../math_functions/half_type/half_precision_conversion_functions/__half2int_rna.md) | 获取输入遵循CAST_ROUND模式转换成的有符号整数。 | | 177 | | [__half2int_rna](../math_functions/half_type/half_precision_conversion_functions/__half2int_rna.md) | 获取输入遵循CAST_ROUND模式转换成的有符号整数。 | |
| 178 | +| [__half2char_rz](../math_functions/half_type/half_precision_conversion_functions/__half2char_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的signed char类型数据。 | | ||
| 179 | +| [__half2uchar_rz](../math_functions/half_type/half_precision_conversion_functions/__half2uchar_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的unsigned char类型数据。 | | ||
| 180 | +| [__half2short_rn](../math_functions/half_type/half_precision_conversion_functions/__half2short_rn.md) | 获取输入遵循CAST_RINT模式转换成的short int类型数据。 | | ||
| 181 | +| [__half2short_rz](../math_functions/half_type/half_precision_conversion_functions/__half2short_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的short int类型数据。 | | ||
| 182 | +| [__half2short_rd](../math_functions/half_type/half_precision_conversion_functions/__half2short_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的short int类型数据。 | | ||
| 183 | +| [__half2short_ru](../math_functions/half_type/half_precision_conversion_functions/__half2short_ru.md) | 获取输入遵循CAST_CEIL模式转换成的short int类型数据。 | | ||
| 184 | +| [__half2ushort_rn](../math_functions/half_type/half_precision_conversion_functions/__half2ushort_rn.md) | 获取输入遵循CAST_RINT模式转换成的unsigned short int类型数据。 | | ||
| 185 | +| [__half2ushort_rz](../math_functions/half_type/half_precision_conversion_functions/__half2ushort_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的unsigned short int类型数据。 | | ||
| 186 | +| [__half2ushort_rd](../math_functions/half_type/half_precision_conversion_functions/__half2ushort_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的unsigned short int类型数据。 | | ||
| 187 | +| [__half2ushort_ru](../math_functions/half_type/half_precision_conversion_functions/__half2ushort_ru.md) | 获取输入遵循CAST_CEIL模式转换成的unsigned short int类型数据。 | | ||
| 178 | | [__half2ull_rn](../math_functions/half_type/half_precision_conversion_functions/__half2ull_rn.md) | 获取输入遵循CAST_RINT模式转换成的64位无符号整数。 | | 188 | | [__half2ull_rn](../math_functions/half_type/half_precision_conversion_functions/__half2ull_rn.md) | 获取输入遵循CAST_RINT模式转换成的64位无符号整数。 | |
| 179 | | [__half2ull_rz](../math_functions/half_type/half_precision_conversion_functions/__half2ull_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的64位无符号整数。 | | 189 | | [__half2ull_rz](../math_functions/half_type/half_precision_conversion_functions/__half2ull_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的64位无符号整数。 | |
| 180 | | [__half2ull_rd](../math_functions/half_type/half_precision_conversion_functions/__half2ull_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的64位无符号整数。 | | 190 | | [__half2ull_rd](../math_functions/half_type/half_precision_conversion_functions/__half2ull_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的64位无符号整数。 | |
| @@ -215,6 +225,14 @@ | |||
| 215 | | [__int2half_ru_sat](../math_functions/half_type/half_precision_conversion_functions/__int2half_ru_sat.md) | 饱和模式下获取输入的int32数据转换成的half数据,并遵循CAST_CEIL模式。 | | 225 | | [__int2half_ru_sat](../math_functions/half_type/half_precision_conversion_functions/__int2half_ru_sat.md) | 饱和模式下获取输入的int32数据转换成的half数据,并遵循CAST_CEIL模式。 | |
| 216 | | [__int2half_rna](../math_functions/half_type/half_precision_conversion_functions/__int2half_rna.md) | 获取输入遵循CAST_ROUND模式转换成的half类型数据。 | | 226 | | [__int2half_rna](../math_functions/half_type/half_precision_conversion_functions/__int2half_rna.md) | 获取输入遵循CAST_ROUND模式转换成的half类型数据。 | |
| 217 | | [__int2half_rna_sat](../math_functions/half_type/half_precision_conversion_functions/__int2half_rna_sat.md) | 饱和模式下获取输入的int32数据转换成的half数据,并遵循CAST_ROUND模式。 | | 227 | | [__int2half_rna_sat](../math_functions/half_type/half_precision_conversion_functions/__int2half_rna_sat.md) | 饱和模式下获取输入的int32数据转换成的half数据,并遵循CAST_ROUND模式。 | |
| 228 | +| [__short2half_rn](../math_functions/half_type/half_precision_conversion_functions/__short2half_rn.md) | 获取输入遵循CAST_RINT模式转换成的half类型数据。 | | ||
| 229 | +| [__short2half_rz](../math_functions/half_type/half_precision_conversion_functions/__short2half_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的half类型数据。 | | ||
| 230 | +| [__short2half_rd](../math_functions/half_type/half_precision_conversion_functions/__short2half_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的half类型数据。 | | ||
| 231 | +| [__short2half_ru](../math_functions/half_type/half_precision_conversion_functions/__short2half_ru.md) | 获取输入遵循CAST_CEIL模式转换成的half类型数据。 | | ||
| 232 | +| [__ushort2half_rn](../math_functions/half_type/half_precision_conversion_functions/__ushort2half_rn.md) | 获取输入遵循CAST_RINT模式转换成的half类型数据。 | | ||
| 233 | +| [__ushort2half_rz](../math_functions/half_type/half_precision_conversion_functions/__ushort2half_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的half类型数据。 | | ||
| 234 | +| [__ushort2half_rd](../math_functions/half_type/half_precision_conversion_functions/__ushort2half_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的half类型数据。 | | ||
| 235 | +| [__ushort2half_ru](../math_functions/half_type/half_precision_conversion_functions/__ushort2half_ru.md) | 获取输入遵循CAST_CEIL模式转换成的half类型数据。 | | ||
| 218 | | [__ull2half_rn](../math_functions/half_type/half_precision_conversion_functions/__ull2half_rn.md) | 获取输入遵循CAST_RINT模式转换成的half类型数据。 | | 236 | | [__ull2half_rn](../math_functions/half_type/half_precision_conversion_functions/__ull2half_rn.md) | 获取输入遵循CAST_RINT模式转换成的half类型数据。 | |
| 219 | | [__ull2half_rz](../math_functions/half_type/half_precision_conversion_functions/__ull2half_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的half类型数据。 | | 237 | | [__ull2half_rz](../math_functions/half_type/half_precision_conversion_functions/__ull2half_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的half类型数据。 | |
| 220 | | [__ull2half_rd](../math_functions/half_type/half_precision_conversion_functions/__ull2half_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的half类型数据。 | | 238 | | [__ull2half_rd](../math_functions/half_type/half_precision_conversion_functions/__ull2half_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的half类型数据。 | |
| @@ -227,6 +245,7 @@ | |||
| 227 | | [__ll2half_rna](../math_functions/half_type/half_precision_conversion_functions/__ll2half_rna.md) | 获取输入遵循CAST_ROUND模式转换成的half类型数据。 | | 245 | | [__ll2half_rna](../math_functions/half_type/half_precision_conversion_functions/__ll2half_rna.md) | 获取输入遵循CAST_ROUND模式转换成的half类型数据。 | |
| 228 | | [__floats2half2_rn](../math_functions/half_type/half_precision_conversion_functions/__floats2half2_rn.md) | 将输入的数据x,y遵循CAST_RINT模式分别转换为half类型并填充到half2的前后两部分,返回转换后的half2类型数据。 | | 246 | | [__floats2half2_rn](../math_functions/half_type/half_precision_conversion_functions/__floats2half2_rn.md) | 将输入的数据x,y遵循CAST_RINT模式分别转换为half类型并填充到half2的前后两部分,返回转换后的half2类型数据。 | |
| 229 | | [__float22half2_rn](../math_functions/half_type/half_precision_conversion_functions/__float22half2_rn.md) | 将float2类型数据遵循CAST_RINT模式转换为half2类型,返回转换后的half2类型数据。 | | 247 | | [__float22half2_rn](../math_functions/half_type/half_precision_conversion_functions/__float22half2_rn.md) | 将float2类型数据遵循CAST_RINT模式转换为half2类型,返回转换后的half2类型数据。 | |
| 248 | +| [__float2half2_rn](../math_functions/half_type/half_precision_conversion_functions/__float2half2_rn.md) | 获取输入遵循CAST_RINT模式转换并复制到两个分量后的half2类型数据。 | | ||
| 230 | | [__low2half](../math_functions/half_type/half_precision_conversion_functions/__low2half.md) | 返回输入数据的低16位。 | | 249 | | [__low2half](../math_functions/half_type/half_precision_conversion_functions/__low2half.md) | 返回输入数据的低16位。 | |
| 231 | | [__low2half2](../math_functions/half_type/half_precision_conversion_functions/__low2half2.md) | 将输入数据的低16位填充到half2并返回。 | | 250 | | [__low2half2](../math_functions/half_type/half_precision_conversion_functions/__low2half2.md) | 将输入数据的低16位填充到half2并返回。 | |
| 232 | | [__low2float](../math_functions/half_type/half_precision_conversion_functions/__low2float.md) | 将输入数据的低16位转换为浮点数并返回结果。 | | 251 | | [__low2float](../math_functions/half_type/half_precision_conversion_functions/__low2float.md) | 将输入数据的低16位转换为浮点数并返回结果。 | |
| @@ -237,7 +256,11 @@ | |||
| 237 | | [__highs2half2](../math_functions/half_type/half_precision_conversion_functions/__highs2half2.md) | 分别提取两个half2输入的高16位,并填充到half2中。返回填充后的数据。 | | 256 | | [__highs2half2](../math_functions/half_type/half_precision_conversion_functions/__highs2half2.md) | 分别提取两个half2输入的高16位,并填充到half2中。返回填充后的数据。 | |
| 238 | | [__lows2half2](../math_functions/half_type/half_precision_conversion_functions/__lows2half2.md) | 分别提取两个half2输入的低16位,并填充到half2中。返回填充后的数据。 | | 257 | | [__lows2half2](../math_functions/half_type/half_precision_conversion_functions/__lows2half2.md) | 分别提取两个half2输入的低16位,并填充到half2中。返回填充后的数据。 | |
| 239 | | [__halves2half2](../math_functions/half_type/half_precision_conversion_functions/__halves2half2.md) | 将输入的数据分别填充为half2前后两个分量,返回填充后数据。 | | 258 | | [__halves2half2](../math_functions/half_type/half_precision_conversion_functions/__halves2half2.md) | 将输入的数据分别填充为half2前后两个分量,返回填充后数据。 | |
| 259 | +| [__half2half2](../math_functions/half_type/half_precision_conversion_functions/__half2half2.md) | 将half输入数据复制到half2的两个分量并返回。 | | ||
| 240 | | [__half22float2](../math_functions/half_type/half_precision_conversion_functions/__half22float2.md) | 将half2的两个分量分别转换为float,并填充到float2返回。 | | 260 | | [__half22float2](../math_functions/half_type/half_precision_conversion_functions/__half22float2.md) | 将half2的两个分量分别转换为float,并填充到float2返回。 | |
| 261 | +| [__half_as_short](../math_functions/half_type/half_precision_conversion_functions/__half_as_short.md) | 将half数据按位重新解释为short int类型数据。 | | ||
| 262 | +| [__half_as_ushort](../math_functions/half_type/half_precision_conversion_functions/__half_as_ushort.md) | 将half数据按位重新解释为unsigned short int类型数据。 | | ||
| 263 | +| [__short_as_half](../math_functions/half_type/half_precision_conversion_functions/__short_as_half.md) | 将short int的按位重新解释为half,即将short int的数据存储的位按照half的格式进行读取。 | | ||
| 241 | | [__ushort_as_half](../math_functions/half_type/half_precision_conversion_functions/__ushort_as_half.md) | 将unsigned short int的按位重新解释为half,即将unsigned short int的数据存储的位按照half的格式进行读取。 | | 264 | | [__ushort_as_half](../math_functions/half_type/half_precision_conversion_functions/__ushort_as_half.md) | 将unsigned short int的按位重新解释为half,即将unsigned short int的数据存储的位按照half的格式进行读取。 | |
| 242 | 265 | ||
| 243 | **表12** half2类型算术函数 | 266 | **表12** half2类型算术函数 |
| @@ -423,6 +446,16 @@ | |||
| 423 | | [__bfloat162int_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162int_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的有符号整数。 | | 446 | | [__bfloat162int_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162int_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的有符号整数。 | |
| 424 | | [__bfloat162int_ru](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162int_ru.md) | 获取输入遵循CAST_CEIL模式转换成的有符号整数。 | | 447 | | [__bfloat162int_ru](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162int_ru.md) | 获取输入遵循CAST_CEIL模式转换成的有符号整数。 | |
| 425 | | [__bfloat162int_rna](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162int_rna.md) | 获取输入遵循CAST_ROUND模式转换成的有符号整数。 | | 448 | | [__bfloat162int_rna](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162int_rna.md) | 获取输入遵循CAST_ROUND模式转换成的有符号整数。 | |
| 449 | +| [__bfloat162char_rz](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162char_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的signed char类型数据。 | | ||
| 450 | +| [__bfloat162uchar_rz](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162uchar_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的unsigned char类型数据。 | | ||
| 451 | +| [__bfloat162short_rn](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162short_rn.md) | 获取输入遵循CAST_RINT模式转换成的short int类型数据。 | | ||
| 452 | +| [__bfloat162short_rz](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162short_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的short int类型数据。 | | ||
| 453 | +| [__bfloat162short_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162short_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的short int类型数据。 | | ||
| 454 | +| [__bfloat162short_ru](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162short_ru.md) | 获取输入遵循CAST_CEIL模式转换成的short int类型数据。 | | ||
| 455 | +| [__bfloat162ushort_rn](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ushort_rn.md) | 获取输入遵循CAST_RINT模式转换成的unsigned short int类型数据。 | | ||
| 456 | +| [__bfloat162ushort_rz](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ushort_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的unsigned short int类型数据。 | | ||
| 457 | +| [__bfloat162ushort_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ushort_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的unsigned short int类型数据。 | | ||
| 458 | +| [__bfloat162ushort_ru](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ushort_ru.md) | 获取输入遵循CAST_CEIL模式转换成的unsigned short int类型数据。 | | ||
| 426 | | [__bfloat162ull_rn](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ull_rn.md) | 获取输入遵循CAST_RINT模式转换成的64位无符号整数。 | | 459 | | [__bfloat162ull_rn](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ull_rn.md) | 获取输入遵循CAST_RINT模式转换成的64位无符号整数。 | |
| 427 | | [__bfloat162ull_rz](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ull_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的64位无符号整数。 | | 460 | | [__bfloat162ull_rz](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ull_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的64位无符号整数。 | |
| 428 | | [__bfloat162ull_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ull_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的64位无符号整数。 | | 461 | | [__bfloat162ull_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ull_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的64位无符号整数。 | |
| @@ -443,6 +476,14 @@ | |||
| 443 | | [__int2bfloat16_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__int2bfloat16_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的bfloat16类型数据。 | | 476 | | [__int2bfloat16_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__int2bfloat16_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的bfloat16类型数据。 | |
| 444 | | [__int2bfloat16_ru](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__int2bfloat16_ru.md) | 获取输入遵循CAST_CEIL模式转换成的bfloat16类型数据。 | | 477 | | [__int2bfloat16_ru](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__int2bfloat16_ru.md) | 获取输入遵循CAST_CEIL模式转换成的bfloat16类型数据。 | |
| 445 | | [__int2bfloat16_rna](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__int2bfloat16_rna.md) | 获取输入遵循CAST_ROUND模式转换成的bfloat16类型数据。 | | 478 | | [__int2bfloat16_rna](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__int2bfloat16_rna.md) | 获取输入遵循CAST_ROUND模式转换成的bfloat16类型数据。 | |
| 479 | +| [__short2bfloat16_rn](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__short2bfloat16_rn.md) | 获取输入遵循CAST_RINT模式转换成的bfloat16类型数据。 | | ||
| 480 | +| [__short2bfloat16_rz](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__short2bfloat16_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的bfloat16类型数据。 | | ||
| 481 | +| [__short2bfloat16_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__short2bfloat16_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的bfloat16类型数据。 | | ||
| 482 | +| [__short2bfloat16_ru](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__short2bfloat16_ru.md) | 获取输入遵循CAST_CEIL模式转换成的bfloat16类型数据。 | | ||
| 483 | +| [__ushort2bfloat16_rn](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort2bfloat16_rn.md) | 获取输入遵循CAST_RINT模式转换成的bfloat16类型数据。 | | ||
| 484 | +| [__ushort2bfloat16_rz](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort2bfloat16_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的bfloat16类型数据。 | | ||
| 485 | +| [__ushort2bfloat16_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort2bfloat16_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的bfloat16类型数据。 | | ||
| 486 | +| [__ushort2bfloat16_ru](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort2bfloat16_ru.md) | 获取输入遵循CAST_CEIL模式转换成的bfloat16类型数据。 | | ||
| 446 | | [__ull2bfloat16_rn](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ull2bfloat16_rn.md) | 获取输入遵循CAST_RINT模式转换成的bfloat16类型数据。 | | 487 | | [__ull2bfloat16_rn](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ull2bfloat16_rn.md) | 获取输入遵循CAST_RINT模式转换成的bfloat16类型数据。 | |
| 447 | | [__ull2bfloat16_rz](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ull2bfloat16_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的bfloat16类型数据。 | | 488 | | [__ull2bfloat16_rz](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ull2bfloat16_rz.md) | 获取输入遵循CAST_TRUNC模式转换成的bfloat16类型数据。 | |
| 448 | | [__ull2bfloat16_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ull2bfloat16_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的bfloat16类型数据。 | | 489 | | [__ull2bfloat16_rd](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ull2bfloat16_rd.md) | 获取输入遵循CAST_FLOOR模式转换成的bfloat16类型数据。 | |
| @@ -468,6 +509,9 @@ | |||
| 468 | | [__lowhigh2highlow](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__lowhigh2highlow.md) | 将输入数据的高低16位进行交换并返回。 | | 509 | | [__lowhigh2highlow](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__lowhigh2highlow.md) | 将输入数据的高低16位进行交换并返回。 | |
| 469 | | [__lows2bfloat162](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__lows2bfloat162.md) | 分别提取两个bfloat162输入的低16位,并填充到bfloat162中。返回填充后的数据。 | | 510 | | [__lows2bfloat162](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__lows2bfloat162.md) | 分别提取两个bfloat162输入的低16位,并填充到bfloat162中。返回填充后的数据。 | |
| 470 | | [__bfloat1622float2](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat1622float2.md) | 将bfloat16x2的两个分量分别转换为float,并填充到float2返回。 | | 511 | | [__bfloat1622float2](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat1622float2.md) | 将bfloat16x2的两个分量分别转换为float,并填充到float2返回。 | |
| 512 | +| [__bfloat16_as_short](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat16_as_short.md) | 将bfloat16数据按位重新解释为short int类型数据。 | | ||
| 513 | +| [__bfloat16_as_ushort](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat16_as_ushort.md) | 将bfloat16数据按位重新解释为unsigned short int类型数据。 | | ||
| 514 | +| [__short_as_bfloat16](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__short_as_bfloat16.md) | 将short int的按位重新解释为bfloat16,即将short int的数据存储的位按照bfloat16的格式进行读取。 | | ||
| 471 | | [__ushort_as_bfloat16](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort_as_bfloat16.md) | 将unsigned short int的按位重新解释为bfloat16,即将unsigned short int的数据存储的位按照bfloat16的格式进行读取。 | | 515 | | [__ushort_as_bfloat16](../math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort_as_bfloat16.md) | 将unsigned short int的按位重新解释为bfloat16,即将unsigned short int的数据存储的位按照bfloat16的格式进行读取。 | |
| 472 | 516 | ||
| 473 | **表19** bfloat16x2类型算术函数 | 517 | **表19** bfloat16x2类型算术函数 |
| @@ -616,9 +660,13 @@ | |||
| 616 | | [y1f](../math_functions/float_math_functions/y1f.md) | 获取输入数据x的1阶第二类贝塞尔函数y1的值。 | | 660 | | [y1f](../math_functions/float_math_functions/y1f.md) | 获取输入数据x的1阶第二类贝塞尔函数y1的值。 | |
| 617 | | [ynf](../math_functions/float_math_functions/ynf.md) | 获取输入数据x的n阶第二类贝塞尔函数yn的值。 | | 661 | | [ynf](../math_functions/float_math_functions/ynf.md) | 获取输入数据x的n阶第二类贝塞尔函数yn的值。 | |
| 618 | | [fabsf](../math_functions/float_math_functions/fabsf.md) | 获取输入数据的绝对值。 | | 662 | | [fabsf](../math_functions/float_math_functions/fabsf.md) | 获取输入数据的绝对值。 | |
| 663 | +| [abs](../math_functions/float_math_functions/abs.md) | 获取float类型输入数据的绝对值。 | | ||
| 619 | | [fmaf](../math_functions/float_math_functions/fmaf.md) | 对输入数据x、y、z,计算x与y相乘加上z的结果。 | | 664 | | [fmaf](../math_functions/float_math_functions/fmaf.md) | 对输入数据x、y、z,计算x与y相乘加上z的结果。 | |
| 620 | | [fmaxf](../math_functions/float_math_functions/fmaxf.md) | 获取两个输入数据中的最大值。 | | 665 | | [fmaxf](../math_functions/float_math_functions/fmaxf.md) | 获取两个输入数据中的最大值。 | |
| 666 | +| [max](../math_functions/float_math_functions/max.md) | 获取两个输入数据中的最大值。 | | ||
| 621 | | [fminf](../math_functions/float_math_functions/fminf.md) | 获取两个输入数据中的最小值。 | | 667 | | [fminf](../math_functions/float_math_functions/fminf.md) | 获取两个输入数据中的最小值。 | |
| 668 | +| [min](../math_functions/float_math_functions/min.md) | 获取两个输入数据中的最小值。 | | ||
| 669 | +| [nanf](../math_functions/float_math_functions/nanf.md) | 根据字符串生成float类型的安静NaN值(浮点尾数最高位为1)。 | | ||
| 622 | | [fdimf](../math_functions/float_math_functions/fdimf.md) | 获取输入数据的差值,差值小于0时,返回0。 | | 670 | | [fdimf](../math_functions/float_math_functions/fdimf.md) | 获取输入数据的差值,差值小于0时,返回0。 | |
| 623 | | [remquof](../math_functions/float_math_functions/remquof.md) | 获取输入数据x除以y的余数。求余数时,商取最接近x除以y浮点数结果的整数,当x除以y的浮点数结果与左右最接近的整数距离相等时,商取偶数,同时将商赋值给指针变量quo。 | | 671 | | [remquof](../math_functions/float_math_functions/remquof.md) | 获取输入数据x除以y的余数。求余数时,商取最接近x除以y浮点数结果的整数,当x除以y的浮点数结果与左右最接近的整数距离相等时,商取偶数,同时将商赋值给指针变量quo。 | |
| 624 | | [fmodf](../math_functions/float_math_functions/fmodf.md) | 获取输入数据x除以y的余数。求余数时,商取x除以y浮点数结果的整数部分。 | | 672 | | [fmodf](../math_functions/float_math_functions/fmodf.md) | 获取输入数据x除以y的余数。求余数时,商取x除以y浮点数结果的整数部分。 | |
| @@ -0,0 +1,95 @@ | |||
| 1 | +# \_\_bfloat162char\_rz | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162char_rz_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +遵循CAST\_TRUNC模式,将bfloat16_t类型数据转换为signed char类型数据,返回转换后的值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline signed char __bfloat162char_rz(const bfloat16_t x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入遵循CAST\_TRUNC模式转换成的signed char类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +|----------|---| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| nan | 0 | | ||
| 52 | +| inf | 127(SCHAR_MAX) | | ||
| 53 | +| -inf | -128(SCHAR_MIN) | | ||
| 54 | +| 超出char上界 | 127(SCHAR_MAX) | | ||
| 55 | +| 超出char下界 | -128(SCHAR_MIN) | | ||
| 56 | + | ||
| 57 | +## 约束说明 | ||
| 58 | + | ||
| 59 | +无 | ||
| 60 | + | ||
| 61 | +## 需要包含的头文件 | ||
| 62 | + | ||
| 63 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 64 | + | ||
| 65 | +```cpp | ||
| 66 | +#include "simt_api/asc_bf16.h" | ||
| 67 | +``` | ||
| 68 | + | ||
| 69 | +## 调用示例 | ||
| 70 | + | ||
| 71 | +- SIMT编程场景: | ||
| 72 | + | ||
| 73 | + ```cpp | ||
| 74 | + __global__ __launch_bounds__(1024) void kernel___bfloat162char_rz(signed char* dst, bfloat16_t* x, uint32_t input_total_length) | ||
| 75 | + { | ||
| 76 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 77 | + if (idx >= input_total_length) { | ||
| 78 | + return; | ||
| 79 | + } | ||
| 80 | + dst[idx] = __bfloat162char_rz(x[idx]); | ||
| 81 | + } | ||
| 82 | + ``` | ||
| 83 | + | ||
| 84 | +- SIMD与SIMT混合编程场景: | ||
| 85 | + | ||
| 86 | + ```cpp | ||
| 87 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___bfloat162char_rz(__gm__ signed char* dst, __gm__ bfloat16_t* x, uint32_t input_total_length) | ||
| 88 | + { | ||
| 89 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 90 | + if (idx >= input_total_length) { | ||
| 91 | + return; | ||
| 92 | + } | ||
| 93 | + dst[idx] = __bfloat162char_rz(x[idx]); | ||
| 94 | + } | ||
| 95 | + ``` | ||
| @@ -0,0 +1,95 @@ | |||
| 1 | +# \_\_bfloat162short\_rd | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162short_rd_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +遵循CAST\_FLOOR模式,将bfloat16_t类型数据转换为short int类型数据,返回转换后的值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline short int __bfloat162short_rd(const bfloat16_t x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入遵循CAST\_FLOOR模式转换成的short int类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +|---|---| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| nan | 0 | | ||
| 52 | +| inf | 32767(SHRT_MAX) | | ||
| 53 | +| -inf | -32768(SHRT_MIN) | | ||
| 54 | +| 超出short上界 | 32767(SHRT_MAX) | | ||
| 55 | +| 超出short下界 | -32768(SHRT_MIN) | | ||
| 56 | + | ||
| 57 | +## 约束说明 | ||
| 58 | + | ||
| 59 | +无 | ||
| 60 | + | ||
| 61 | +## 需要包含的头文件 | ||
| 62 | + | ||
| 63 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 64 | + | ||
| 65 | +```cpp | ||
| 66 | +#include "simt_api/asc_bf16.h" | ||
| 67 | +``` | ||
| 68 | + | ||
| 69 | +## 调用示例 | ||
| 70 | + | ||
| 71 | +- SIMT编程场景: | ||
| 72 | + | ||
| 73 | + ```cpp | ||
| 74 | + __global__ __launch_bounds__(1024) void kernel___bfloat162short_rd(short int* dst, bfloat16_t* x, uint32_t input_total_length) | ||
| 75 | + { | ||
| 76 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 77 | + if (idx >= input_total_length) { | ||
| 78 | + return; | ||
| 79 | + } | ||
| 80 | + dst[idx] = __bfloat162short_rd(x[idx]); | ||
| 81 | + } | ||
| 82 | + ``` | ||
| 83 | + | ||
| 84 | +- SIMD与SIMT混合编程场景: | ||
| 85 | + | ||
| 86 | + ```cpp | ||
| 87 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___bfloat162short_rd(__gm__ short int* dst, __gm__ bfloat16_t* x, uint32_t input_total_length) | ||
| 88 | + { | ||
| 89 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 90 | + if (idx >= input_total_length) { | ||
| 91 | + return; | ||
| 92 | + } | ||
| 93 | + dst[idx] = __bfloat162short_rd(x[idx]); | ||
| 94 | + } | ||
| 95 | + ``` | ||
| @@ -0,0 +1,95 @@ | |||
| 1 | +# \_\_bfloat162short\_rn | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162short_rn_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +遵循CAST\_RINT模式,将bfloat16_t类型数据转换为short int类型数据,返回转换后的值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline short int __bfloat162short_rn(const bfloat16_t x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入遵循CAST\_RINT模式转换成的short int类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +|---|---| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| nan | 0 | | ||
| 52 | +| inf | 32767(SHRT_MAX) | | ||
| 53 | +| -inf | -32768(SHRT_MIN) | | ||
| 54 | +| 超出short上界 | 32767(SHRT_MAX) | | ||
| 55 | +| 超出short下界 | -32768(SHRT_MIN) | | ||
| 56 | + | ||
| 57 | +## 约束说明 | ||
| 58 | + | ||
| 59 | +无 | ||
| 60 | + | ||
| 61 | +## 需要包含的头文件 | ||
| 62 | + | ||
| 63 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 64 | + | ||
| 65 | +```cpp | ||
| 66 | +#include "simt_api/asc_bf16.h" | ||
| 67 | +``` | ||
| 68 | + | ||
| 69 | +## 调用示例 | ||
| 70 | + | ||
| 71 | +- SIMT编程场景: | ||
| 72 | + | ||
| 73 | + ```cpp | ||
| 74 | + __global__ __launch_bounds__(1024) void kernel___bfloat162short_rn(short int* dst, bfloat16_t* x, uint32_t input_total_length) | ||
| 75 | + { | ||
| 76 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 77 | + if (idx >= input_total_length) { | ||
| 78 | + return; | ||
| 79 | + } | ||
| 80 | + dst[idx] = __bfloat162short_rn(x[idx]); | ||
| 81 | + } | ||
| 82 | + ``` | ||
| 83 | + | ||
| 84 | +- SIMD与SIMT混合编程场景: | ||
| 85 | + | ||
| 86 | + ```cpp | ||
| 87 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___bfloat162short_rn(__gm__ short int* dst, __gm__ bfloat16_t* x, uint32_t input_total_length) | ||
| 88 | + { | ||
| 89 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 90 | + if (idx >= input_total_length) { | ||
| 91 | + return; | ||
| 92 | + } | ||
| 93 | + dst[idx] = __bfloat162short_rn(x[idx]); | ||
| 94 | + } | ||
| 95 | + ``` | ||
| @@ -0,0 +1,95 @@ | |||
| 1 | +# \_\_bfloat162short\_ru | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162short_ru_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +遵循CAST\_CEIL模式,将bfloat16_t类型数据转换为short int类型数据,返回转换后的值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline short int __bfloat162short_ru(const bfloat16_t x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入遵循CAST\_CEIL模式转换成的short int类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +|---|---| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| nan | 0 | | ||
| 52 | +| inf | 32767(SHRT_MAX) | | ||
| 53 | +| -inf | -32768(SHRT_MIN) | | ||
| 54 | +| 超出short上界 | 32767(SHRT_MAX) | | ||
| 55 | +| 超出short下界 | -32768(SHRT_MIN) | | ||
| 56 | + | ||
| 57 | +## 约束说明 | ||
| 58 | + | ||
| 59 | +无 | ||
| 60 | + | ||
| 61 | +## 需要包含的头文件 | ||
| 62 | + | ||
| 63 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 64 | + | ||
| 65 | +```cpp | ||
| 66 | +#include "simt_api/asc_bf16.h" | ||
| 67 | +``` | ||
| 68 | + | ||
| 69 | +## 调用示例 | ||
| 70 | + | ||
| 71 | +- SIMT编程场景: | ||
| 72 | + | ||
| 73 | + ```cpp | ||
| 74 | + __global__ __launch_bounds__(1024) void kernel___bfloat162short_ru(short int* dst, bfloat16_t* x, uint32_t input_total_length) | ||
| 75 | + { | ||
| 76 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 77 | + if (idx >= input_total_length) { | ||
| 78 | + return; | ||
| 79 | + } | ||
| 80 | + dst[idx] = __bfloat162short_ru(x[idx]); | ||
| 81 | + } | ||
| 82 | + ``` | ||
| 83 | + | ||
| 84 | +- SIMD与SIMT混合编程场景: | ||
| 85 | + | ||
| 86 | + ```cpp | ||
| 87 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___bfloat162short_ru(__gm__ short int* dst, __gm__ bfloat16_t* x, uint32_t input_total_length) | ||
| 88 | + { | ||
| 89 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 90 | + if (idx >= input_total_length) { | ||
| 91 | + return; | ||
| 92 | + } | ||
| 93 | + dst[idx] = __bfloat162short_ru(x[idx]); | ||
| 94 | + } | ||
| 95 | + ``` | ||
| @@ -0,0 +1,95 @@ | |||
| 1 | +# \_\_bfloat162short\_rz | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162short_rz_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +遵循CAST\_TRUNC模式,将bfloat16_t类型数据转换为short int类型数据,返回转换后的值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline short int __bfloat162short_rz(const bfloat16_t x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入遵循CAST\_TRUNC模式转换成的short int类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +|---|---| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| nan | 0 | | ||
| 52 | +| inf | 32767(SHRT_MAX) | | ||
| 53 | +| -inf | -32768(SHRT_MIN) | | ||
| 54 | +| 超出short上界 | 32767(SHRT_MAX) | | ||
| 55 | +| 超出short下界 | -32768(SHRT_MIN) | | ||
| 56 | + | ||
| 57 | +## 约束说明 | ||
| 58 | + | ||
| 59 | +无 | ||
| 60 | + | ||
| 61 | +## 需要包含的头文件 | ||
| 62 | + | ||
| 63 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 64 | + | ||
| 65 | +```cpp | ||
| 66 | +#include "simt_api/asc_bf16.h" | ||
| 67 | +``` | ||
| 68 | + | ||
| 69 | +## 调用示例 | ||
| 70 | + | ||
| 71 | +- SIMT编程场景: | ||
| 72 | + | ||
| 73 | + ```cpp | ||
| 74 | + __global__ __launch_bounds__(1024) void kernel___bfloat162short_rz(short int* dst, bfloat16_t* x, uint32_t input_total_length) | ||
| 75 | + { | ||
| 76 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 77 | + if (idx >= input_total_length) { | ||
| 78 | + return; | ||
| 79 | + } | ||
| 80 | + dst[idx] = __bfloat162short_rz(x[idx]); | ||
| 81 | + } | ||
| 82 | + ``` | ||
| 83 | + | ||
| 84 | +- SIMD与SIMT混合编程场景: | ||
| 85 | + | ||
| 86 | + ```cpp | ||
| 87 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___bfloat162short_rz(__gm__ short int* dst, __gm__ bfloat16_t* x, uint32_t input_total_length) | ||
| 88 | + { | ||
| 89 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 90 | + if (idx >= input_total_length) { | ||
| 91 | + return; | ||
| 92 | + } | ||
| 93 | + dst[idx] = __bfloat162short_rz(x[idx]); | ||
| 94 | + } | ||
| 95 | + ``` | ||
| @@ -0,0 +1,95 @@ | |||
| 1 | +# \_\_bfloat162uchar\_rz | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162uchar_rz_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +遵循CAST\_TRUNC模式,将bfloat16_t类型数据转换为unsigned char类型数据,返回转换后的值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline unsigned char __bfloat162uchar_rz(const bfloat16_t x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入遵循CAST\_TRUNC模式转换成的unsigned char类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +|---|---| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| nan | 0 | | ||
| 52 | +| inf | 255(UCHAR_MAX) | | ||
| 53 | +| -inf | 0 | | ||
Outdated 级别:一般 问题:无符号整型转换文档(__bfloat162uchar_rz、__bfloat162ushort_rn/rz/rd/ru、__half2uchar_rz、__half2ushort_rn/rz/rd/ru)特殊值表缺少'超出上界/下界'的饱和取值行,而有符号版本均有说明。 影响:有限值越界时返回UCHAR_MAX/USHRT_MAX还是0未定义,用户无法正确处理溢出场景。 修复建议:按实现补充越界行,如超出上界→255/65535、负值或超出下界→0,与有符号系列保持对称。 ![]() ![]() | |||
| 54 | +| 超出unsigned char上界 | 255(UCHAR_MAX)| | ||
| 55 | +| 负数 | 0 | | ||
| 56 | + | ||
| 57 | +## 约束说明 | ||
| 58 | + | ||
| 59 | +无 | ||
| 60 | + | ||
| 61 | +## 需要包含的头文件 | ||
| 62 | + | ||
| 63 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 64 | + | ||
| 65 | +```cpp | ||
| 66 | +#include "simt_api/asc_bf16.h" | ||
| 67 | +``` | ||
| 68 | + | ||
| 69 | +## 调用示例 | ||
| 70 | + | ||
| 71 | +- SIMT编程场景: | ||
| 72 | + | ||
| 73 | + ```cpp | ||
| 74 | + __global__ __launch_bounds__(1024) void kernel___bfloat162uchar_rz(unsigned char* dst, bfloat16_t* x, uint32_t input_total_length) | ||
| 75 | + { | ||
| 76 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 77 | + if (idx >= input_total_length) { | ||
| 78 | + return; | ||
| 79 | + } | ||
| 80 | + dst[idx] = __bfloat162uchar_rz(x[idx]); | ||
| 81 | + } | ||
| 82 | + ``` | ||
| 83 | + | ||
| 84 | +- SIMD与SIMT混合编程场景: | ||
| 85 | + | ||
| 86 | + ```cpp | ||
| 87 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___bfloat162uchar_rz(__gm__ unsigned char* dst, __gm__ bfloat16_t* x, uint32_t input_total_length) | ||
| 88 | + { | ||
| 89 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 90 | + if (idx >= input_total_length) { | ||
| 91 | + return; | ||
| 92 | + } | ||
| 93 | + dst[idx] = __bfloat162uchar_rz(x[idx]); | ||
| 94 | + } | ||
| 95 | + ``` | ||
| @@ -0,0 +1,95 @@ | |||
| 1 | +# \_\_bfloat162ushort\_rd | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ushort_rd_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +遵循CAST\_FLOOR模式,将bfloat16_t类型数据转换为unsigned short int类型数据,返回转换后的值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline unsigned short int __bfloat162ushort_rd(const bfloat16_t x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入遵循CAST\_FLOOR模式转换成的unsigned short int类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +|---|---| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| nan | 0 | | ||
| 52 | +| inf | 65535(USHRT_MAX) | | ||
| 53 | +| -inf | 0 | | ||
| 54 | +| 超出short上界 | 65535(USHRT_MAX) | | ||
| 55 | +| 负数 | 0 | | ||
| 56 | + | ||
| 57 | +## 约束说明 | ||
| 58 | + | ||
| 59 | +无 | ||
| 60 | + | ||
| 61 | +## 需要包含的头文件 | ||
| 62 | + | ||
| 63 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 64 | + | ||
| 65 | +```cpp | ||
| 66 | +#include "simt_api/asc_bf16.h" | ||
| 67 | +``` | ||
| 68 | + | ||
| 69 | +## 调用示例 | ||
| 70 | + | ||
| 71 | +- SIMT编程场景: | ||
| 72 | + | ||
| 73 | + ```cpp | ||
| 74 | + __global__ __launch_bounds__(1024) void kernel___bfloat162ushort_rd(unsigned short int* dst, bfloat16_t* x, uint32_t input_total_length) | ||
| 75 | + { | ||
| 76 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 77 | + if (idx >= input_total_length) { | ||
| 78 | + return; | ||
| 79 | + } | ||
| 80 | + dst[idx] = __bfloat162ushort_rd(x[idx]); | ||
| 81 | + } | ||
| 82 | + ``` | ||
| 83 | + | ||
| 84 | +- SIMD与SIMT混合编程场景: | ||
| 85 | + | ||
| 86 | + ```cpp | ||
| 87 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___bfloat162ushort_rd(__gm__ unsigned short int* dst, __gm__ bfloat16_t* x, uint32_t input_total_length) | ||
| 88 | + { | ||
| 89 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 90 | + if (idx >= input_total_length) { | ||
| 91 | + return; | ||
| 92 | + } | ||
| 93 | + dst[idx] = __bfloat162ushort_rd(x[idx]); | ||
| 94 | + } | ||
| 95 | + ``` | ||
| @@ -0,0 +1,95 @@ | |||
| 1 | +# \_\_bfloat162ushort\_rn | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ushort_rn_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +遵循CAST\_RINT模式,将bfloat16_t类型数据转换为unsigned short int类型数据,返回转换后的值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline unsigned short int __bfloat162ushort_rn(const bfloat16_t x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入遵循CAST\_RINT模式转换成的unsigned short int类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +|---|---| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| nan | 0 | | ||
| 52 | +| inf | 65535(USHRT_MAX) | | ||
| 53 | +| -inf | 0 | | ||
| 54 | +| 超出short上界 | 65535(USHRT_MAX) | | ||
| 55 | +| 负数 | 0 | | ||
| 56 | + | ||
| 57 | +## 约束说明 | ||
| 58 | + | ||
| 59 | +无 | ||
| 60 | + | ||
| 61 | +## 需要包含的头文件 | ||
| 62 | + | ||
| 63 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 64 | + | ||
| 65 | +```cpp | ||
| 66 | +#include "simt_api/asc_bf16.h" | ||
| 67 | +``` | ||
| 68 | + | ||
| 69 | +## 调用示例 | ||
| 70 | + | ||
| 71 | +- SIMT编程场景: | ||
| 72 | + | ||
| 73 | + ```cpp | ||
| 74 | + __global__ __launch_bounds__(1024) void kernel___bfloat162ushort_rn(unsigned short int* dst, bfloat16_t* x, uint32_t input_total_length) | ||
| 75 | + { | ||
| 76 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 77 | + if (idx >= input_total_length) { | ||
| 78 | + return; | ||
| 79 | + } | ||
| 80 | + dst[idx] = __bfloat162ushort_rn(x[idx]); | ||
| 81 | + } | ||
| 82 | + ``` | ||
| 83 | + | ||
| 84 | +- SIMD与SIMT混合编程场景: | ||
| 85 | + | ||
| 86 | + ```cpp | ||
| 87 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___bfloat162ushort_rn(__gm__ unsigned short int* dst, __gm__ bfloat16_t* x, uint32_t input_total_length) | ||
| 88 | + { | ||
| 89 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 90 | + if (idx >= input_total_length) { | ||
| 91 | + return; | ||
| 92 | + } | ||
| 93 | + dst[idx] = __bfloat162ushort_rn(x[idx]); | ||
| 94 | + } | ||
| 95 | + ``` | ||
| @@ -0,0 +1,95 @@ | |||
| 1 | +# \_\_bfloat162ushort\_ru | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ushort_ru_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +遵循CAST\_CEIL模式,将bfloat16_t类型数据转换为unsigned short int类型数据,返回转换后的值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline unsigned short int __bfloat162ushort_ru(const bfloat16_t x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入遵循CAST\_CEIL模式转换成的unsigned short int类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +|---|---| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| nan | 0 | | ||
| 52 | +| inf | 65535(USHRT_MAX) | | ||
| 53 | +| -inf | 0 | | ||
| 54 | +| 超出short上界 | 65535(USHRT_MAX) | | ||
| 55 | +| 负数 | 0 | | ||
| 56 | + | ||
| 57 | +## 约束说明 | ||
| 58 | + | ||
| 59 | +无 | ||
| 60 | + | ||
| 61 | +## 需要包含的头文件 | ||
| 62 | + | ||
| 63 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 64 | + | ||
| 65 | +```cpp | ||
| 66 | +#include "simt_api/asc_bf16.h" | ||
| 67 | +``` | ||
| 68 | + | ||
| 69 | +## 调用示例 | ||
| 70 | + | ||
| 71 | +- SIMT编程场景: | ||
| 72 | + | ||
| 73 | + ```cpp | ||
| 74 | + __global__ __launch_bounds__(1024) void kernel___bfloat162ushort_ru(unsigned short int* dst, bfloat16_t* x, uint32_t input_total_length) | ||
| 75 | + { | ||
| 76 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 77 | + if (idx >= input_total_length) { | ||
| 78 | + return; | ||
| 79 | + } | ||
| 80 | + dst[idx] = __bfloat162ushort_ru(x[idx]); | ||
| 81 | + } | ||
| 82 | + ``` | ||
| 83 | + | ||
| 84 | +- SIMD与SIMT混合编程场景: | ||
| 85 | + | ||
| 86 | + ```cpp | ||
| 87 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___bfloat162ushort_ru(__gm__ unsigned short int* dst, __gm__ bfloat16_t* x, uint32_t input_total_length) | ||
| 88 | + { | ||
| 89 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 90 | + if (idx >= input_total_length) { | ||
| 91 | + return; | ||
| 92 | + } | ||
| 93 | + dst[idx] = __bfloat162ushort_ru(x[idx]); | ||
| 94 | + } | ||
| 95 | + ``` | ||
| @@ -0,0 +1,95 @@ | |||
| 1 | +# \_\_bfloat162ushort\_rz | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat162ushort_rz_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +遵循CAST\_TRUNC模式,将bfloat16_t类型数据转换为unsigned short int类型数据,返回转换后的值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline unsigned short int __bfloat162ushort_rz(const bfloat16_t x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入遵循CAST\_TRUNC模式转换成的unsigned short int类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +|---|---| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| nan | 0 | | ||
| 52 | +| inf | 65535(USHRT_MAX) | | ||
| 53 | +| -inf | 0 | | ||
| 54 | +| 超出short上界 | 65535(USHRT_MAX) | | ||
| 55 | +| 负数 | 0 | | ||
| 56 | + | ||
| 57 | +## 约束说明 | ||
| 58 | + | ||
| 59 | +无 | ||
| 60 | + | ||
| 61 | +## 需要包含的头文件 | ||
| 62 | + | ||
| 63 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 64 | + | ||
| 65 | +```cpp | ||
| 66 | +#include "simt_api/asc_bf16.h" | ||
| 67 | +``` | ||
| 68 | + | ||
| 69 | +## 调用示例 | ||
| 70 | + | ||
| 71 | +- SIMT编程场景: | ||
| 72 | + | ||
| 73 | + ```cpp | ||
| 74 | + __global__ __launch_bounds__(1024) void kernel___bfloat162ushort_rz(unsigned short int* dst, bfloat16_t* x, uint32_t input_total_length) | ||
| 75 | + { | ||
| 76 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 77 | + if (idx >= input_total_length) { | ||
| 78 | + return; | ||
| 79 | + } | ||
| 80 | + dst[idx] = __bfloat162ushort_rz(x[idx]); | ||
| 81 | + } | ||
| 82 | + ``` | ||
| 83 | + | ||
| 84 | +- SIMD与SIMT混合编程场景: | ||
| 85 | + | ||
| 86 | + ```cpp | ||
| 87 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___bfloat162ushort_rz(__gm__ unsigned short int* dst, __gm__ bfloat16_t* x, uint32_t input_total_length) | ||
| 88 | + { | ||
| 89 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 90 | + if (idx >= input_total_length) { | ||
| 91 | + return; | ||
| 92 | + } | ||
| 93 | + dst[idx] = __bfloat162ushort_rz(x[idx]); | ||
| 94 | + } | ||
| 95 | + ``` | ||
| @@ -0,0 +1,93 @@ | |||
| 1 | +# \_\_bfloat16\_as\_short | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat16_as_short_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +将bfloat16_t类型数据按位重新解释为short int类型数据。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline short int __bfloat16_as_short(const bfloat16_t x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入的bfloat16_t类型数据中的位重新解释成的short int类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +|---|---| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| inf | 32640 | | ||
| 52 | +| -inf | -128 | | ||
| 53 | +| nan | 32704 | | ||
| 54 | + | ||
| 55 | +## 约束说明 | ||
| 56 | + | ||
| 57 | +无 | ||
| 58 | + | ||
| 59 | +## 需要包含的头文件 | ||
| 60 | + | ||
| 61 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 62 | + | ||
| 63 | +```cpp | ||
| 64 | +#include "simt_api/asc_bf16.h" | ||
| 65 | +``` | ||
| 66 | + | ||
| 67 | +## 调用示例 | ||
| 68 | + | ||
| 69 | +- SIMT编程场景: | ||
| 70 | + | ||
| 71 | + ```cpp | ||
| 72 | + __global__ __launch_bounds__(1024) void kernel___bfloat16_as_short(short int* dst, bfloat16_t* x, uint32_t input_total_length) | ||
| 73 | + { | ||
| 74 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 75 | + if (idx >= input_total_length) { | ||
| 76 | + return; | ||
| 77 | + } | ||
| 78 | + dst[idx] = __bfloat16_as_short(x[idx]); | ||
| 79 | + } | ||
| 80 | + ``` | ||
| 81 | + | ||
| 82 | +- SIMD与SIMT混合编程场景: | ||
| 83 | + | ||
| 84 | + ```cpp | ||
| 85 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___bfloat16_as_short(__gm__ short int* dst, __gm__ bfloat16_t* x, uint32_t input_total_length) | ||
| 86 | + { | ||
| 87 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 88 | + if (idx >= input_total_length) { | ||
| 89 | + return; | ||
| 90 | + } | ||
| 91 | + dst[idx] = __bfloat16_as_short(x[idx]); | ||
| 92 | + } | ||
| 93 | + ``` | ||
| @@ -0,0 +1,93 @@ | |||
| 1 | +# \_\_bfloat16\_as\_ushort | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__bfloat16_as_ushort_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +将bfloat16_t类型数据按位重新解释为unsigned short int类型数据。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline unsigned short int __bfloat16_as_ushort(const bfloat16_t x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入的bfloat16_t类型数据中的位重新解释成的unsigned short int类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +|---|---| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| inf | 32640 | | ||
| 52 | +| -inf | 65408 | | ||
| 53 | +| nan | 32704 | | ||
| 54 | + | ||
| 55 | +## 约束说明 | ||
| 56 | + | ||
| 57 | +无 | ||
| 58 | + | ||
| 59 | +## 需要包含的头文件 | ||
| 60 | + | ||
| 61 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 62 | + | ||
| 63 | +```cpp | ||
| 64 | +#include "simt_api/asc_bf16.h" | ||
| 65 | +``` | ||
| 66 | + | ||
| 67 | +## 调用示例 | ||
| 68 | + | ||
| 69 | +- SIMT编程场景: | ||
| 70 | + | ||
| 71 | + ```cpp | ||
| 72 | + __global__ __launch_bounds__(1024) void kernel___bfloat16_as_ushort(unsigned short int* dst, bfloat16_t* x, uint32_t input_total_length) | ||
| 73 | + { | ||
| 74 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 75 | + if (idx >= input_total_length) { | ||
| 76 | + return; | ||
| 77 | + } | ||
| 78 | + dst[idx] = __bfloat16_as_ushort(x[idx]); | ||
| 79 | + } | ||
| 80 | + ``` | ||
| 81 | + | ||
| 82 | +- SIMD与SIMT混合编程场景: | ||
| 83 | + | ||
| 84 | + ```cpp | ||
| 85 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___bfloat16_as_ushort(__gm__ unsigned short int* dst, __gm__ bfloat16_t* x, uint32_t input_total_length) | ||
| 86 | + { | ||
| 87 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 88 | + if (idx >= input_total_length) { | ||
| 89 | + return; | ||
| 90 | + } | ||
| 91 | + dst[idx] = __bfloat16_as_ushort(x[idx]); | ||
| 92 | + } | ||
| 93 | + ``` | ||
| @@ -0,0 +1,94 @@ | |||
| 1 | +# \_\_short2bfloat16\_rd | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__short2bfloat16_rd_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +遵循CAST\_FLOOR模式,将short int类型数据转换为bfloat16_t类型数据,返回转换后的值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline bfloat16_t __short2bfloat16_rd(const short int x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入遵循CAST\_FLOOR模式转换成的bfloat16_t类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +|---|---| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| 2049 | 2048 | | ||
| 52 | +| -2049 | -2064 | | ||
| 53 | +| 32767(short int最大值) | 32640 | | ||
| 54 | +| -32768(short int最小值) | -32768 | | ||
| 55 | + | ||
| 56 | +## 约束说明 | ||
| 57 | + | ||
| 58 | +无 | ||
| 59 | + | ||
| 60 | +## 需要包含的头文件 | ||
| 61 | + | ||
| 62 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 63 | + | ||
| 64 | +```cpp | ||
| 65 | +#include "simt_api/asc_bf16.h" | ||
| 66 | +``` | ||
| 67 | + | ||
| 68 | +## 调用示例 | ||
| 69 | + | ||
| 70 | +- SIMT编程场景: | ||
| 71 | + | ||
| 72 | + ```cpp | ||
| 73 | + __global__ __launch_bounds__(1024) void kernel___short2bfloat16_rd(bfloat16_t* dst, short int* x, uint32_t input_total_length) | ||
| 74 | + { | ||
| 75 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 76 | + if (idx >= input_total_length) { | ||
| 77 | + return; | ||
| 78 | + } | ||
| 79 | + dst[idx] = __short2bfloat16_rd(x[idx]); | ||
| 80 | + } | ||
| 81 | + ``` | ||
| 82 | + | ||
| 83 | +- SIMD与SIMT混合编程场景: | ||
| 84 | + | ||
| 85 | + ```cpp | ||
| 86 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___short2bfloat16_rd(__gm__ bfloat16_t* dst, __gm__ short int* x, uint32_t input_total_length) | ||
| 87 | + { | ||
| 88 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 89 | + if (idx >= input_total_length) { | ||
| 90 | + return; | ||
| 91 | + } | ||
| 92 | + dst[idx] = __short2bfloat16_rd(x[idx]); | ||
| 93 | + } | ||
| 94 | + ``` | ||
| @@ -0,0 +1,94 @@ | |||
| 1 | +# \_\_short2bfloat16\_rn | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__short2bfloat16_rn_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +遵循CAST\_RINT模式,将short int类型数据转换为bfloat16_t类型数据,返回转换后的值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline bfloat16_t __short2bfloat16_rn(const short int x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入遵循CAST\_RINT模式转换成的bfloat16_t类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| 输入 | 返回值 | | ||
| 49 | +|---|---| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| 2049 | 2048 | | ||
| 52 | +| -2049 | -2048 | | ||
| 53 | +| 32767(short int最大值) | 32768 | | ||
| 54 | +| -32768(short int最小值) | -32768 | | ||
| 55 | + | ||
| 56 | +## 约束说明 | ||
| 57 | + | ||
| 58 | +无 | ||
| 59 | + | ||
| 60 | +## 需要包含的头文件 | ||
| 61 | + | ||
| 62 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 63 | + | ||
| 64 | +```cpp | ||
| 65 | +#include "simt_api/asc_bf16.h" | ||
| 66 | +``` | ||
| 67 | + | ||
| 68 | +## 调用示例 | ||
| 69 | + | ||
| 70 | +- SIMT编程场景: | ||
| 71 | + | ||
| 72 | + ```cpp | ||
| 73 | + __global__ __launch_bounds__(1024) void kernel___short2bfloat16_rn(bfloat16_t* dst, short int* x, uint32_t input_total_length) | ||
| 74 | + { | ||
| 75 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 76 | + if (idx >= input_total_length) { | ||
| 77 | + return; | ||
| 78 | + } | ||
| 79 | + dst[idx] = __short2bfloat16_rn(x[idx]); | ||
| 80 | + } | ||
| 81 | + ``` | ||
| 82 | + | ||
| 83 | +- SIMD与SIMT混合编程场景: | ||
| 84 | + | ||
| 85 | + ```cpp | ||
| 86 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___short2bfloat16_rn(__gm__ bfloat16_t* dst, __gm__ short int* x, uint32_t input_total_length) | ||
| 87 | + { | ||
| 88 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 89 | + if (idx >= input_total_length) { | ||
| 90 | + return; | ||
| 91 | + } | ||
| 92 | + dst[idx] = __short2bfloat16_rn(x[idx]); | ||
| 93 | + } | ||
| 94 | + ``` | ||
| @@ -0,0 +1,94 @@ | |||
| 1 | +# \_\_short2bfloat16\_ru | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__short2bfloat16_ru_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +遵循CAST\_CEIL模式,将short int类型数据转换为bfloat16_t类型数据,返回转换后的值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline bfloat16_t __short2bfloat16_ru(const short int x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入遵循CAST\_CEIL模式转换成的bfloat16_t类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +|---|---| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| 2049 | 2064 | | ||
| 52 | +| -2049 | -2048 | | ||
| 53 | +| 32767(short int最大值) | 32768 | | ||
| 54 | +| -32768(short int最小值) | -32768 | | ||
| 55 | + | ||
| 56 | +## 约束说明 | ||
| 57 | + | ||
| 58 | +无 | ||
| 59 | + | ||
| 60 | +## 需要包含的头文件 | ||
| 61 | + | ||
| 62 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 63 | + | ||
| 64 | +```cpp | ||
| 65 | +#include "simt_api/asc_bf16.h" | ||
| 66 | +``` | ||
| 67 | + | ||
| 68 | +## 调用示例 | ||
| 69 | + | ||
| 70 | +- SIMT编程场景: | ||
| 71 | + | ||
| 72 | + ```cpp | ||
| 73 | + __global__ __launch_bounds__(1024) void kernel___short2bfloat16_ru(bfloat16_t* dst, short int* x, uint32_t input_total_length) | ||
| 74 | + { | ||
| 75 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 76 | + if (idx >= input_total_length) { | ||
| 77 | + return; | ||
| 78 | + } | ||
| 79 | + dst[idx] = __short2bfloat16_ru(x[idx]); | ||
| 80 | + } | ||
| 81 | + ``` | ||
| 82 | + | ||
| 83 | +- SIMD与SIMT混合编程场景: | ||
| 84 | + | ||
| 85 | + ```cpp | ||
| 86 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___short2bfloat16_ru(__gm__ bfloat16_t* dst, __gm__ short int* x, uint32_t input_total_length) | ||
| 87 | + { | ||
| 88 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 89 | + if (idx >= input_total_length) { | ||
| 90 | + return; | ||
| 91 | + } | ||
| 92 | + dst[idx] = __short2bfloat16_ru(x[idx]); | ||
| 93 | + } | ||
| 94 | + ``` | ||
| @@ -0,0 +1,94 @@ | |||
| 1 | +# \_\_short2bfloat16\_rz | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__short2bfloat16_rz_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +遵循CAST\_TRUNC模式,将short int类型数据转换为bfloat16_t类型数据,返回转换后的值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline bfloat16_t __short2bfloat16_rz(const short int x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入遵循CAST\_TRUNC模式转换成的bfloat16_t类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +|---|---| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| 2049 | 2048 | | ||
| 52 | +| -2049 | -2048 | | ||
| 53 | +| 32767(short int最大值) | 32640 | | ||
| 54 | +| -32768(short int最小值) | -32768 | | ||
| 55 | + | ||
| 56 | +## 约束说明 | ||
| 57 | + | ||
| 58 | +无 | ||
| 59 | + | ||
| 60 | +## 需要包含的头文件 | ||
| 61 | + | ||
| 62 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 63 | + | ||
| 64 | +```cpp | ||
| 65 | +#include "simt_api/asc_bf16.h" | ||
| 66 | +``` | ||
| 67 | + | ||
| 68 | +## 调用示例 | ||
| 69 | + | ||
| 70 | +- SIMT编程场景: | ||
| 71 | + | ||
| 72 | + ```cpp | ||
| 73 | + __global__ __launch_bounds__(1024) void kernel___short2bfloat16_rz(bfloat16_t* dst, short int* x, uint32_t input_total_length) | ||
| 74 | + { | ||
| 75 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 76 | + if (idx >= input_total_length) { | ||
| 77 | + return; | ||
| 78 | + } | ||
| 79 | + dst[idx] = __short2bfloat16_rz(x[idx]); | ||
| 80 | + } | ||
| 81 | + ``` | ||
| 82 | + | ||
| 83 | +- SIMD与SIMT混合编程场景: | ||
| 84 | + | ||
| 85 | + ```cpp | ||
| 86 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___short2bfloat16_rz(__gm__ bfloat16_t* dst, __gm__ short int* x, uint32_t input_total_length) | ||
| 87 | + { | ||
| 88 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 89 | + if (idx >= input_total_length) { | ||
| 90 | + return; | ||
| 91 | + } | ||
| 92 | + dst[idx] = __short2bfloat16_rz(x[idx]); | ||
| 93 | + } | ||
| 94 | + ``` | ||
| @@ -0,0 +1,94 @@ | |||
| 1 | +# \_\_short\_as\_bfloat16 | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__short_as_bfloat16_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +将short int类型数据按位重新解释为bfloat16_t类型数据。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline bfloat16_t __short_as_bfloat16(const short int x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +short int的数据按位重新解释为bfloat16的值。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +|-------------------------------|------| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| 32640(0x7F81) | inf | | ||
| 52 | +| -128(0xFF80) | -inf | | ||
| 53 | +| 32641(0x7F81) ~ 32767(0x7FFF) | nan | | ||
| 54 | +| -127(0xFF81) ~ -1(0xFFFF) | nan | | ||
| 55 | + | ||
| 56 | +## 约束说明 | ||
| 57 | + | ||
| 58 | +无 | ||
| 59 | + | ||
| 60 | +## 需要包含的头文件 | ||
| 61 | + | ||
| 62 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 63 | + | ||
| 64 | +```cpp | ||
| 65 | +#include "simt_api/asc_bf16.h" | ||
| 66 | +``` | ||
| 67 | + | ||
| 68 | +## 调用示例 | ||
| 69 | + | ||
| 70 | +- SIMT编程场景: | ||
| 71 | + | ||
| 72 | + ```cpp | ||
| 73 | + __global__ __launch_bounds__(1024) void kernel___short_as_bfloat16(bfloat16_t* dst, short int* x, uint32_t input_total_length) | ||
| 74 | + { | ||
| 75 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 76 | + if (idx >= input_total_length) { | ||
| 77 | + return; | ||
| 78 | + } | ||
| 79 | + dst[idx] = __short_as_bfloat16(x[idx]); | ||
| 80 | + } | ||
| 81 | + ``` | ||
| 82 | + | ||
| 83 | +- SIMD与SIMT混合编程场景: | ||
| 84 | + | ||
| 85 | + ```cpp | ||
| 86 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___short_as_bfloat16(__gm__ bfloat16_t* dst, __gm__ short int* x, uint32_t input_total_length) | ||
| 87 | + { | ||
| 88 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 89 | + if (idx >= input_total_length) { | ||
| 90 | + return; | ||
| 91 | + } | ||
| 92 | + dst[idx] = __short_as_bfloat16(x[idx]); | ||
| 93 | + } | ||
| 94 | + ``` | ||
| @@ -0,0 +1,94 @@ | |||
| 1 | +# \_\_ushort2bfloat16\_rd | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort2bfloat16_rd_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +遵循CAST\_FLOOR模式,将unsigned short int类型数据转换为bfloat16_t类型数据,返回转换后的值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline bfloat16_t __ushort2bfloat16_rd(const unsigned short int x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入遵循CAST\_FLOOR模式转换成的bfloat16_t类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +|---|---| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| 2049 | 2048 | | ||
| 52 | +| 4097 | 4096 | | ||
| 53 | +| 65505 | 65280 | | ||
| 54 | +| 65535 | 65280 | | ||
| 55 | + | ||
| 56 | +## 约束说明 | ||
| 57 | + | ||
| 58 | +无 | ||
| 59 | + | ||
| 60 | +## 需要包含的头文件 | ||
| 61 | + | ||
| 62 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 63 | + | ||
| 64 | +```cpp | ||
| 65 | +#include "simt_api/asc_bf16.h" | ||
| 66 | +``` | ||
| 67 | + | ||
| 68 | +## 调用示例 | ||
| 69 | + | ||
| 70 | +- SIMT编程场景: | ||
| 71 | + | ||
| 72 | + ```cpp | ||
| 73 | + __global__ __launch_bounds__(1024) void kernel___ushort2bfloat16_rd(bfloat16_t* dst, unsigned short int* x, uint32_t input_total_length) | ||
| 74 | + { | ||
| 75 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 76 | + if (idx >= input_total_length) { | ||
| 77 | + return; | ||
| 78 | + } | ||
| 79 | + dst[idx] = __ushort2bfloat16_rd(x[idx]); | ||
| 80 | + } | ||
| 81 | + ``` | ||
| 82 | + | ||
| 83 | +- SIMD与SIMT混合编程场景: | ||
| 84 | + | ||
| 85 | + ```cpp | ||
| 86 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___ushort2bfloat16_rd(__gm__ bfloat16_t* dst, __gm__ unsigned short int* x, uint32_t input_total_length) | ||
| 87 | + { | ||
| 88 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 89 | + if (idx >= input_total_length) { | ||
| 90 | + return; | ||
| 91 | + } | ||
| 92 | + dst[idx] = __ushort2bfloat16_rd(x[idx]); | ||
| 93 | + } | ||
| 94 | + ``` | ||
| @@ -0,0 +1,94 @@ | |||
| 1 | +# \_\_ushort2bfloat16\_rn | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort2bfloat16_rn_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +遵循CAST\_RINT模式,将unsigned short int类型数据转换为bfloat16_t类型数据,返回转换后的值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline bfloat16_t __ushort2bfloat16_rn(const unsigned short int x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入遵循CAST\_RINT模式转换成的bfloat16_t类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +|---|---| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| 2049 | 2048 | | ||
| 52 | +| 4097 | 4096 | | ||
| 53 | +| 65505 | 65536 | | ||
| 54 | +| 65535 | 65536 | | ||
| 55 | + | ||
| 56 | +## 约束说明 | ||
| 57 | + | ||
| 58 | +无 | ||
| 59 | + | ||
| 60 | +## 需要包含的头文件 | ||
| 61 | + | ||
| 62 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 63 | + | ||
| 64 | +```cpp | ||
| 65 | +#include "simt_api/asc_bf16.h" | ||
| 66 | +``` | ||
| 67 | + | ||
| 68 | +## 调用示例 | ||
| 69 | + | ||
| 70 | +- SIMT编程场景: | ||
| 71 | + | ||
| 72 | + ```cpp | ||
| 73 | + __global__ __launch_bounds__(1024) void kernel___ushort2bfloat16_rn(bfloat16_t* dst, unsigned short int* x, uint32_t input_total_length) | ||
| 74 | + { | ||
| 75 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 76 | + if (idx >= input_total_length) { | ||
| 77 | + return; | ||
| 78 | + } | ||
| 79 | + dst[idx] = __ushort2bfloat16_rn(x[idx]); | ||
| 80 | + } | ||
| 81 | + ``` | ||
| 82 | + | ||
| 83 | +- SIMD与SIMT混合编程场景: | ||
| 84 | + | ||
| 85 | + ```cpp | ||
| 86 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___ushort2bfloat16_rn(__gm__ bfloat16_t* dst, __gm__ unsigned short int* x, uint32_t input_total_length) | ||
| 87 | + { | ||
| 88 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 89 | + if (idx >= input_total_length) { | ||
| 90 | + return; | ||
| 91 | + } | ||
| 92 | + dst[idx] = __ushort2bfloat16_rn(x[idx]); | ||
| 93 | + } | ||
| 94 | + ``` | ||
| @@ -0,0 +1,94 @@ | |||
| 1 | +# \_\_ushort2bfloat16\_ru | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort2bfloat16_ru_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +遵循CAST\_CEIL模式,将unsigned short int类型数据转换为bfloat16_t类型数据,返回转换后的值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline bfloat16_t __ushort2bfloat16_ru(const unsigned short int x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入遵循CAST\_CEIL模式转换成的bfloat16_t类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +|---|---| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| 2049 | 2064 | | ||
| 52 | +| 4097 | 4128 | | ||
| 53 | +| 65505 | 65536 | | ||
| 54 | +| 65535 | 65536 | | ||
| 55 | + | ||
| 56 | +## 约束说明 | ||
| 57 | + | ||
| 58 | +无 | ||
| 59 | + | ||
| 60 | +## 需要包含的头文件 | ||
| 61 | + | ||
| 62 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 63 | + | ||
| 64 | +```cpp | ||
| 65 | +#include "simt_api/asc_bf16.h" | ||
| 66 | +``` | ||
| 67 | + | ||
| 68 | +## 调用示例 | ||
| 69 | + | ||
| 70 | +- SIMT编程场景: | ||
| 71 | + | ||
| 72 | + ```cpp | ||
| 73 | + __global__ __launch_bounds__(1024) void kernel___ushort2bfloat16_ru(bfloat16_t* dst, unsigned short int* x, uint32_t input_total_length) | ||
| 74 | + { | ||
| 75 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 76 | + if (idx >= input_total_length) { | ||
| 77 | + return; | ||
| 78 | + } | ||
| 79 | + dst[idx] = __ushort2bfloat16_ru(x[idx]); | ||
| 80 | + } | ||
| 81 | + ``` | ||
| 82 | + | ||
| 83 | +- SIMD与SIMT混合编程场景: | ||
| 84 | + | ||
| 85 | + ```cpp | ||
| 86 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___ushort2bfloat16_ru(__gm__ bfloat16_t* dst, __gm__ unsigned short int* x, uint32_t input_total_length) | ||
| 87 | + { | ||
| 88 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 89 | + if (idx >= input_total_length) { | ||
| 90 | + return; | ||
| 91 | + } | ||
| 92 | + dst[idx] = __ushort2bfloat16_ru(x[idx]); | ||
| 93 | + } | ||
| 94 | + ``` | ||
| @@ -0,0 +1,94 @@ | |||
| 1 | +# \_\_ushort2bfloat16\_rz | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/bfloat16_type/bfloat16_precision_conversion_functions/__ushort2bfloat16_rz_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +遵循CAST\_TRUNC模式,将unsigned short int类型数据转换为bfloat16_t类型数据,返回转换后的值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline bfloat16_t __ushort2bfloat16_rz(const unsigned short int x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入遵循CAST\_TRUNC模式转换成的bfloat16_t类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| 输入 | 返回值 | | ||
| 49 | +|---|---| | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| 2049 | 2048 | | ||
Outdated 级别:提示 问题:特殊值表缺少'0→0'行(同系列_rd/_rn/_ru均含该行),且表头用'输入'而非统一的'x值'。 影响:与系列文档格式不一致,0输入行为未明示。 修复建议:补充| 0 | 0 |行并将表头统一为'x值'。 ![]() ![]() | |||
| 52 | +| 4097 | 4096 | | ||
| 53 | +| 65505 | 65280 | | ||
| 54 | +| 65535(unsigned short int最大值) | 65280 | | ||
| 55 | + | ||
| 56 | +## 约束说明 | ||
| 57 | + | ||
| 58 | +无 | ||
| 59 | + | ||
| 60 | +## 需要包含的头文件 | ||
| 61 | + | ||
| 62 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 | ||
| 63 | + | ||
| 64 | +```cpp | ||
| 65 | +#include "simt_api/asc_bf16.h" | ||
| 66 | +``` | ||
| 67 | + | ||
| 68 | +## 调用示例 | ||
| 69 | + | ||
| 70 | +- SIMT编程场景: | ||
| 71 | + | ||
| 72 | + ```cpp | ||
| 73 | + __global__ __launch_bounds__(1024) void kernel___ushort2bfloat16_rz(bfloat16_t* dst, unsigned short int* x, uint32_t input_total_length) | ||
| 74 | + { | ||
| 75 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 76 | + if (idx >= input_total_length) { | ||
| 77 | + return; | ||
| 78 | + } | ||
| 79 | + dst[idx] = __ushort2bfloat16_rz(x[idx]); | ||
| 80 | + } | ||
| 81 | + ``` | ||
| 82 | + | ||
| 83 | +- SIMD与SIMT混合编程场景: | ||
| 84 | + | ||
| 85 | + ```cpp | ||
| 86 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___ushort2bfloat16_rz(__gm__ bfloat16_t* dst, __gm__ unsigned short int* x, uint32_t input_total_length) | ||
| 87 | + { | ||
| 88 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 89 | + if (idx >= input_total_length) { | ||
| 90 | + return; | ||
| 91 | + } | ||
| 92 | + dst[idx] = __ushort2bfloat16_rz(x[idx]); | ||
| 93 | + } | ||
| 94 | + ``` | ||
| @@ -45,17 +45,13 @@ inline bfloat16_t __ushort_as_bfloat16(const unsigned short int x) | |||
| 45 | 45 | ||
| 46 | unsigned short int的数据按位重新解释为bfloat16的值。特殊值如下: | 46 | unsigned short int的数据按位重新解释为bfloat16的值。特殊值如下: |
| 47 | 47 | ||
| 48 | -| 输入(uint16 位模式) | 返回值 | | 48 | +| x值 | 返回值 | |
| 49 | -|---|---| | 49 | +|-------------------------------|------| |
| 50 | -| 0 | 0 | | 50 | +| 0 | 0 | |
| 51 | -| -0 | -0 | | 51 | +| 32640(0x7F80) | inf | |
| 52 | -| inf | inf | | 52 | +| 65408(0xFF80) | -inf | |
| 53 | -| -inf | -inf | | 53 | +| 32641(0x7F81) ~ 32767(0x7FFF) | nan | |
| 54 | -| nan | nan | | 54 | +| 65409(0xFF81) ~ 65535(0xFFFF) | nan | |
| 55 | -| ASCRT_MAX_NORMAL_BF16 | ASCRT_MAX_NORMAL_BF16 | | ||
| 56 | -| -ASCRT_MAX_NORMAL_BF16 | -ASCRT_MAX_NORMAL_BF16 | | ||
| 57 | -| ASCRT_MIN_DENORM_BF16 | ASCRT_MIN_DENORM_BF16 | | ||
| 58 | -| 1.0 | 1.0 | | ||
| 59 | 55 | ||
| 60 | ## 约束说明 | 56 | ## 约束说明 |
| 61 | 57 | ||
| @@ -63,7 +59,7 @@ unsigned short int的数据按位重新解释为bfloat16的值。特殊值如下 | |||
| 63 | 59 | ||
| 64 | ## 需要包含的头文件 | 60 | ## 需要包含的头文件 |
| 65 | 61 | ||
| 66 | -使用该接口需要包含"simt\_api/asc\_bf16.h"头文件。 | 62 | +使用该接口需要包含`simt_api/asc_bf16.h`头文件。 |
| 67 | 63 | ||
| 68 | ```cpp | 64 | ```cpp |
| 69 | #include "simt_api/asc_bf16.h" | 65 | #include "simt_api/asc_bf16.h" |
| @@ -74,9 +70,12 @@ unsigned short int的数据按位重新解释为bfloat16的值。特殊值如下 | |||
| 74 | - SIMT编程场景: | 70 | - SIMT编程场景: |
| 75 | 71 | ||
| 76 | ```cpp | 72 | ```cpp |
| 77 | - __global__ __launch_bounds__(1024) void kernel__ushort_as_bfloat16(bfloat16_t* dst, unsigned short int* x) | 73 | + __global__ __launch_bounds__(1024) void kernel__ushort_as_bfloat16(bfloat16_t* dst, unsigned short int* x, uint32_t input_total_length) |
| 78 | { | 74 | { |
| 79 | - int idx = threadIdx.x + blockIdx.x * blockDim.x; | 75 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; |
| 76 | + if (idx >= input_total_length) { | ||
| 77 | + return; | ||
| 78 | + } | ||
| 80 | dst[idx] = __ushort_as_bfloat16(x[idx]); | 79 | dst[idx] = __ushort_as_bfloat16(x[idx]); |
| 81 | } | 80 | } |
| 82 | ``` | 81 | ``` |
| @@ -84,9 +83,12 @@ unsigned short int的数据按位重新解释为bfloat16的值。特殊值如下 | |||
| 84 | - SIMD与SIMT混合编程场景: | 83 | - SIMD与SIMT混合编程场景: |
| 85 | 84 | ||
| 86 | ```cpp | 85 | ```cpp |
| 87 | - __simt_vf__ __launch_bounds__(1024) inline void kernel__ushort_as_bfloat16(__gm__ bfloat16_t* dst, __gm__ unsigned short int* x) | 86 | + __simt_vf__ __launch_bounds__(1024) inline void kernel__ushort_as_bfloat16(__gm__ bfloat16_t* dst, __gm__ unsigned short int* x, uint32_t input_total_length) |
| 88 | { | 87 | { |
| 89 | - int idx = threadIdx.x + blockIdx.x * blockDim.x; | 88 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; |
| 89 | + if (idx >= input_total_length) { | ||
| 90 | + return; | ||
| 91 | + } | ||
| 90 | dst[idx] = __ushort_as_bfloat16(x[idx]); | 92 | dst[idx] = __ushort_as_bfloat16(x[idx]); |
| 91 | } | 93 | } |
| 92 | ``` | 94 | ``` |
| @@ -0,0 +1,100 @@ | |||
| 1 | +# abs | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/float_math_functions/abs_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +获取float类型输入数据的绝对值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +float abs(float x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入数据的绝对值。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +| --- | --- | | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| nan | nan | | ||
| 52 | +| inf | inf | | ||
| 53 | +| -inf | inf | | ||
| 54 | + | ||
| 55 | +## 约束说明 | ||
| 56 | + | ||
| 57 | +无 | ||
| 58 | + | ||
| 59 | +## 需要包含的头文件 | ||
| 60 | + | ||
| 61 | +使用该接口需要包含`simt_api/math_functions.h`头文件。 | ||
| 62 | + | ||
| 63 | +```cpp | ||
| 64 | +#include "simt_api/math_functions.h" | ||
| 65 | +``` | ||
| 66 | + | ||
| 67 | +## 调用示例 | ||
| 68 | + | ||
| 69 | +- SIMT编程场景: | ||
| 70 | + | ||
| 71 | + ```cpp | ||
| 72 | + __global__ __launch_bounds__(1024) void kernel_abs(float* dst, float* x, uint32_t input_total_length) | ||
| 73 | + { | ||
| 74 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 75 | + if (idx >= input_total_length) { | ||
| 76 | + return; | ||
| 77 | + } | ||
| 78 | + dst[idx] = abs(x[idx]); | ||
| 79 | + } | ||
| 80 | + ``` | ||
| 81 | + | ||
| 82 | +- SIMD与SIMT混合编程场景: | ||
| 83 | + | ||
| 84 | + ```cpp | ||
| 85 | + __simt_vf__ __launch_bounds__(1024) inline void kernel_abs(__gm__ float* dst, __gm__ float* x, uint32_t input_total_length) | ||
| 86 | + { | ||
| 87 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 88 | + if (idx >= input_total_length) { | ||
| 89 | + return; | ||
| 90 | + } | ||
| 91 | + dst[idx] = abs(x[idx]); | ||
| 92 | + } | ||
| 93 | + ``` | ||
| 94 | + | ||
| 95 | +输入输出示例如下: | ||
| 96 | + | ||
| 97 | +```text | ||
| 98 | +x:-1.25, 0.0, 2.5, -3.75 | ||
| 99 | +result: 1.25 0.0 2.5 3.75 | ||
| 100 | +``` | ||
| @@ -0,0 +1,109 @@ | |||
| 1 | +# max | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/float_math_functions/max_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +获取两个输入数据中的最大值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +float max(float x, float y) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | +| y | 输入 | 源操作数。 | | ||
| 44 | + | ||
| 45 | +## 返回值说明 | ||
| 46 | + | ||
| 47 | +两个输入数据中的最大值。 | ||
| 48 | + | ||
| 49 | +- x为+0,y为-0时,返回x。 | ||
| 50 | +- x为-0,y为+0时,返回y。 | ||
| 51 | +- x为nan时,返回值为y。 | ||
| 52 | +- y为nan时,返回值为x。 | ||
| 53 | +- x,y同时为nan时,返回值为nan。 | ||
Outdated 级别:一般 问题:返回值说明未定义仅一个操作数为nan时的行为(只写了x、y同时为nan),也未说明nan与inf同时出现时的优先级。 影响:含nan输入的边界行为不明确,用户无法预期结果,易与CUDA fmaxf语义(单nan返回另一操作数)产生分歧。 修复建议:按实际实现补充单操作数为nan时的返回值(如返回另一个非nan操作数),以及nan与±inf混合输入的取值规则。 ![]() ![]() | |||
| 54 | +- x,y任意一个为inf时,返回值为inf。 | ||
| 55 | +- x为-inf时,返回值为y。 | ||
| 56 | +- y为-inf时,返回值为x。 | ||
| 57 | + | ||
| 58 | +## 约束说明 | ||
| 59 | + | ||
| 60 | +无 | ||
| 61 | + | ||
| 62 | +## 需要包含的头文件 | ||
| 63 | + | ||
| 64 | +使用该接口需要包含`simt_api/math_functions.h`头文件。 | ||
| 65 | + | ||
| 66 | +```cpp | ||
| 67 | +#include "simt_api/math_functions.h" | ||
| 68 | +``` | ||
| 69 | + | ||
| 70 | +## 调用示例 | ||
| 71 | + | ||
| 72 | +- SIMT编程场景: | ||
| 73 | + | ||
| 74 | + ```cpp | ||
| 75 | + __global__ __launch_bounds__(256) void compute_max(float *result, const float *x, const float *y, uint32_t input_total_length) | ||
| 76 | + { | ||
| 77 | + const uint32_t idx = blockIdx.x * blockDim.x + threadIdx.x; | ||
| 78 | + if (idx >= input_total_length) { | ||
| 79 | + return; | ||
| 80 | + } | ||
| 81 | + result[idx] = max(x[idx], y[idx]); | ||
| 82 | + } | ||
| 83 | + ``` | ||
| 84 | + | ||
| 85 | +- SIMD与SIMT混合编程场景: | ||
| 86 | + | ||
| 87 | + ```cpp | ||
| 88 | + __simt_vf__ __launch_bounds__(256) inline void compute_max_vf(__gm__ float *result, __gm__ const float *x, __gm__ const float *y, uint32_t input_total_length) | ||
| 89 | + { | ||
| 90 | + const uint32_t idx = blockIdx.x * blockDim.x + threadIdx.x; | ||
| 91 | + if (idx >= input_total_length) { | ||
| 92 | + return; | ||
| 93 | + } | ||
| 94 | + result[idx] = max(x[idx], y[idx]); | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + __global__ __vector__ void run_max(__gm__ float *result, __gm__ const float *x, __gm__ const float *y, uint32_t input_total_length) | ||
| 98 | + { | ||
| 99 | + asc_vf_call<compute_max_vf>(dim3(256), result, x, y, input_total_length); | ||
| 100 | + } | ||
| 101 | + ``` | ||
| 102 | + | ||
| 103 | +输入输出示例如下: | ||
| 104 | + | ||
| 105 | +```text | ||
| 106 | +x:0.25, 0.75, 1.25, 1.75 | ||
| 107 | +y:1.5, 2.5, 3.5, 4.5 | ||
| 108 | +result: 1.5 2.5 3.5 4.5 | ||
| 109 | +``` | ||
| @@ -0,0 +1,109 @@ | |||
| 1 | +# min | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/float_math_functions/min_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +获取两个输入数据中的最小值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +float min(float x, float y) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | +| y | 输入 | 源操作数。 | | ||
| 44 | + | ||
| 45 | +## 返回值说明 | ||
| 46 | + | ||
| 47 | +两个输入数据中的最小值。 | ||
| 48 | + | ||
| 49 | +- x为-0,y为+0时,返回x。 | ||
| 50 | +- x为+0,y为-0时,返回y。 | ||
| 51 | +- x为nan时,返回值为y。 | ||
| 52 | +- y为nan时,返回值为x。 | ||
| 53 | +- x,y同时为nan时,返回值为nan。 | ||
Outdated 级别:一般 问题:返回值说明未定义仅一个操作数为nan时的行为,也未说明nan与-inf同时出现时的优先级。 影响:含nan输入的边界行为不明确,用户无法预期结果。 修复建议:按实际实现补充单操作数为nan时的返回值,以及nan与±inf混合输入的取值规则。 ![]() ![]() | |||
| 54 | +- x,y任意一个为-inf时,返回值为-inf。 | ||
| 55 | +- x为inf时,返回值为y。 | ||
| 56 | +- y为inf时,返回值为x。 | ||
| 57 | + | ||
| 58 | +## 约束说明 | ||
| 59 | + | ||
| 60 | +无 | ||
| 61 | + | ||
| 62 | +## 需要包含的头文件 | ||
| 63 | + | ||
| 64 | +使用该接口需要包含`simt_api/math_functions.h`头文件。 | ||
| 65 | + | ||
| 66 | +```cpp | ||
| 67 | +#include "simt_api/math_functions.h" | ||
| 68 | +``` | ||
| 69 | + | ||
| 70 | +## 调用示例 | ||
| 71 | + | ||
| 72 | +- SIMT编程场景: | ||
| 73 | + | ||
| 74 | + ```cpp | ||
| 75 | + __global__ __launch_bounds__(256) void compute_min(float *result, const float *x, const float *y, uint32_t input_total_length) | ||
| 76 | + { | ||
| 77 | + const uint32_t idx = blockIdx.x * blockDim.x + threadIdx.x; | ||
| 78 | + if (idx >= input_total_length) { | ||
| 79 | + return; | ||
| 80 | + } | ||
| 81 | + result[idx] = min(x[idx], y[idx]); | ||
| 82 | + } | ||
| 83 | + ``` | ||
| 84 | + | ||
| 85 | +- SIMD与SIMT混合编程场景: | ||
| 86 | + | ||
| 87 | + ```cpp | ||
| 88 | + __simt_vf__ __launch_bounds__(256) inline void compute_min_vf(__gm__ float *result, __gm__ const float *x, __gm__ const float *y, uint32_t input_total_length) | ||
| 89 | + { | ||
| 90 | + const uint32_t idx = blockIdx.x * blockDim.x + threadIdx.x; | ||
| 91 | + if (idx >= input_total_length) { | ||
| 92 | + return; | ||
| 93 | + } | ||
| 94 | + result[idx] = min(x[idx], y[idx]); | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + __global__ __vector__ void run_min(__gm__ float *result, __gm__ const float *x, __gm__ const float *y, uint32_t input_total_length) | ||
| 98 | + { | ||
| 99 | + asc_vf_call<compute_min_vf>(dim3(256), result, x, y, input_total_length); | ||
| 100 | + } | ||
| 101 | + ``` | ||
| 102 | + | ||
| 103 | +输入输出示例如下: | ||
| 104 | + | ||
| 105 | +```text | ||
| 106 | +x:0.25, 0.75, 1.25, 1.75 | ||
| 107 | +y:1.5, 2.5, 3.5, 4.5 | ||
| 108 | +result: 0.25 0.75 1.25 1.75 | ||
| 109 | +``` | ||
| @@ -0,0 +1,93 @@ | |||
| 1 | +# nanf | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/float_math_functions/nanf_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +根据输入的字符串生成一个float类型的安静NaN值(浮点尾数最高位为1),并将`tagp`解析值的低22位写入该NaN值的低22位。 | ||
| 29 | + | ||
| 30 | + | ||
| 31 | + | ||
| 32 | +## 函数原型 | ||
| 33 | + | ||
| 34 | +```cpp | ||
| 35 | +inline float nanf(const char* tagp) | ||
| 36 | +``` | ||
| 37 | + | ||
| 38 | +## 参数说明 | ||
| 39 | + | ||
| 40 | +**表1** 参数说明 | ||
| 41 | + | ||
| 42 | +| 参数名 | 输入/输出 | 描述 | | ||
| 43 | +| --- | --- | --- | | ||
| 44 | +| tagp | 输入 | 源操作字符串首地址。支持十进制、八进制和十六进制格式;字符串无法按支持的进制解析时按0处理。 | | ||
| 45 | + | ||
| 46 | +## 返回值说明 | ||
| 47 | + | ||
| 48 | +返回float类型的安静NaN值。返回值的低22位为`tagp`解析值的低22位;`tagp`字符串无法按支持的进制解析时,低22位为0;`tagp`解析溢出时,低22位为全1。 | ||
| 49 | + | ||
| 50 | +## 约束说明 | ||
| 51 | + | ||
| 52 | +无 | ||
| 53 | + | ||
| 54 | +## 需要包含的头文件 | ||
| 55 | + | ||
| 56 | +使用该接口需要包含`simt_api/math_functions.h`头文件。 | ||
| 57 | + | ||
| 58 | +```cpp | ||
| 59 | +#include "simt_api/math_functions.h" | ||
| 60 | +``` | ||
| 61 | + | ||
| 62 | +## 调用示例 | ||
| 63 | + | ||
| 64 | +- SIMT编程场景: | ||
| 65 | + | ||
| 66 | + ```cpp | ||
| 67 | + __global__ __launch_bounds__(1024) void kernel_nanf(float* dst) | ||
| 68 | + { | ||
| 69 | + dst[0] = nanf("0x1A"); | ||
| 70 | + dst[1] = nanf("123"); | ||
| 71 | + dst[2] = nanf("abc"); | ||
| 72 | + dst[3] = nanf("0"); | ||
| 73 | + } | ||
| 74 | + ``` | ||
| 75 | + | ||
| 76 | +- SIMD与SIMT混合编程场景: | ||
| 77 | + | ||
| 78 | + ```cpp | ||
| 79 | + __simt_vf__ __launch_bounds__(1024) inline void kernel_nanf(__gm__ float* dst) | ||
| 80 | + { | ||
| 81 | + dst[0] = nanf("0x1A"); | ||
| 82 | + dst[1] = nanf("123"); | ||
| 83 | + dst[2] = nanf("abc"); | ||
| 84 | + dst[3] = nanf("0"); | ||
| 85 | + } | ||
| 86 | + ``` | ||
| 87 | + | ||
| 88 | +输入输出示例如下: | ||
| 89 | + | ||
| 90 | +```text | ||
| 91 | +tagp:"0x1A", "123", "abc", "0" | ||
| 92 | +result: nan(0x7fc0001a) nan(0x7fc0007b) nan(0x7fc00000) nan(0x7fc00000) | ||
| 93 | +``` | ||
| @@ -0,0 +1,101 @@ | |||
| 1 | +# \_\_asc\_cvt\_float\_to\_fp8 | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/fp8_type/fp8_conversion_functions/__asc_cvt_float_to_fp8_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +将float类型数据按照CAST\_RINT模式转换为指定类型(`float8_e4m3_t`和`float8_e5m2_t`)的8位浮点数,并根据指定的饱和模式(饱和或非饱和)进行溢出处理。转换结果以位级形式存储为`__asc_fp8_storage_t`类型,该类型为unsigned char,用于存储`float8_e4m3_t`或`float8_e5m2_t`类型的数据。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline __asc_fp8_storage_t __asc_cvt_float_to_fp8(const float x, const __asc_saturation_t saturation, const __asc_fp8_interpretation_t fp8_interpretation) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- |--------------------------------------------------------------------------------------------------------------------| | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | +| saturation | 输入 | 控制饱和行为,支持的取值为:__ASC_NOSAT、__ASC_SATFINITE。<br><br>__ASC_NOSAT表示使用非饱和模式,__ASC_SATFINITE表示使用饱和模式。 | | ||
| 44 | +| fp8_interpretation | 输入 | 指定转换类型,支持的取值为:__ASC_E4M3、__ASC_E5M2。<br><br>__ASC_E4M3表示转换为`float8_e4m3_t`格式的浮点数,__ASC_E5M2表示转换为`float8_e5m2_t`格式的浮点数。 | | ||
| 45 | + | ||
| 46 | +## 返回值说明 | ||
| 47 | + | ||
| 48 | +输入遵循CAST\_RINT模式,根据指定的8位浮点数类型和指定的饱和模式,转换成的`__asc_fp8_storage_t`类型数据。本接口受全局饱和模式影响,特殊值如下: | ||
| 49 | + | ||
| 50 | +- fp8_interpretation参数为__ASC_E4M3时: | ||
| 51 | + | ||
| 52 | + | 输入 | 非饱和模式返回值 | 饱和模式返回值 | | ||
| 53 | + |---|---|---| | ||
| 54 | + | 0 | 0 | 0 | | ||
| 55 | + | nan | nan | +0 | | ||
| 56 | + | ±inf | nan | ±448 | | ||
| 57 | + | 超出float8_e4m3_t范围的正值 | nan | 448 | | ||
| 58 | + | 超出float8_e4m3_t范围的负值 | nan | -448 | | ||
| 59 | + | ||
| 60 | +- fp8_interpretation的参数为__ASC_E5M2时: | ||
| 61 | + | ||
| 62 | + | 输入 | 非饱和模式返回值 | 饱和模式返回值 | | ||
| 63 | + |---|---|---| | ||
| 64 | + | ±0 | ±0 | ±0 | | ||
| 65 | + | nan | nan | +0 | | ||
| 66 | + | ±inf | ±inf | ±57344 | | ||
| 67 | + | 超出float8_e5m2_t范围的正值 | inf | 57344 | | ||
| 68 | + | 超出float8_e5m2_t范围的负值 | -inf | -57344 | | ||
| 69 | + | ||
| 70 | +## 约束说明 | ||
| 71 | + | ||
| 72 | +使用此接口前需将CTRL\[60\]寄存器设置为0,否则饱和模式不生效。设置方式请参见[控制饱和行为的方式](../../data_type_conversion/overview.md#section1194916101549)。 | ||
| 73 | + | ||
| 74 | +SIMT编程场景当前不支持使用该接口。 | ||
| 75 | + | ||
| 76 | +## 需要包含的头文件 | ||
| 77 | + | ||
| 78 | +使用该接口需要包含`simt_api/asc_fp8.h`头文件。 | ||
| 79 | + | ||
| 80 | +```cpp | ||
| 81 | +#include "simt_api/asc_fp8.h" | ||
| 82 | +``` | ||
| 83 | + | ||
| 84 | +## 调用示例 | ||
| 85 | + | ||
| 86 | +- SIMD与SIMT混合编程场景: | ||
| 87 | + | ||
| 88 | + ```cpp | ||
| 89 | + __simt_vf__ __launch_bounds__(1024) inline void simt_asc_cvt_float_to_fp8(__gm__ float* input, __gm__ uint8_t* output, uint32_t input_total_length) | ||
| 90 | + { | ||
| 91 | + uint32_t idx = blockIdx.x * blockDim.x + threadIdx.x; | ||
| 92 | + if (idx >= input_total_length) { | ||
| 93 | + return; | ||
| 94 | + } | ||
| 95 | + output[idx] = __asc_cvt_float_to_fp8(input[idx], __ASC_NOSAT, __ASC_E4M3); | ||
| 96 | + } | ||
| 97 | + __global__ __vector__ void cast_kernel(__gm__ float* input, __gm__ uint8_t* output, uint32_t input_total_length) | ||
| 98 | + { | ||
| 99 | + asc_vf_call<simt_asc_cvt_float_to_fp8>(dim3(1024), input, output, input_total_length); | ||
| 100 | + } | ||
| 101 | + ``` | ||
| @@ -0,0 +1,93 @@ | |||
| 1 | +# \_\_float2half2\_rn | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/half_type/half_precision_conversion_functions/__float2half2_rn_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +遵循CAST\_RINT模式,将float类型数据转换为half类型后复制到half2的两个分量,返回转换后的half2类型数据。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline half2 __float2half2_rn(const float x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入遵循CAST\_RINT模式转换并复制到两个分量后的half2类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +| --- | --- | | ||
| 50 | +| ±0 | 两个分量均为±0 | | ||
| 51 | +| nan | 两个分量均为nan | | ||
| 52 | +| inf | 两个分量均为inf | | ||
| 53 | +| -inf | 两个分量均为-inf| | ||
| 54 | + | ||
| 55 | +## 约束说明 | ||
| 56 | + | ||
| 57 | +无 | ||
| 58 | + | ||
| 59 | +## 需要包含的头文件 | ||
| 60 | + | ||
| 61 | +使用该接口需要包含`simt_api/asc_fp16.h`头文件。 | ||
| 62 | + | ||
| 63 | +```cpp | ||
| 64 | +#include "simt_api/asc_fp16.h" | ||
| 65 | +``` | ||
| 66 | + | ||
| 67 | +## 调用示例 | ||
| 68 | + | ||
| 69 | +- SIMT编程场景: | ||
| 70 | + | ||
| 71 | + ```cpp | ||
| 72 | + __global__ __launch_bounds__(1024) void kernel___float2half2_rn(half2* dst, float* x, uint32_t input_total_length) | ||
| 73 | + { | ||
| 74 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 75 | + if (idx >= input_total_length) { | ||
| 76 | + return; | ||
| 77 | + } | ||
| 78 | + dst[idx] = __float2half2_rn(x[idx]); | ||
| 79 | + } | ||
| 80 | + ``` | ||
| 81 | + | ||
| 82 | +- SIMD与SIMT混合编程场景: | ||
| 83 | + | ||
| 84 | + ```cpp | ||
| 85 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___float2half2_rn(__gm__ half2* dst, __gm__ float* x, uint32_t input_total_length) | ||
| 86 | + { | ||
| 87 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 88 | + if (idx >= input_total_length) { | ||
| 89 | + return; | ||
| 90 | + } | ||
| 91 | + dst[idx] = __float2half2_rn(x[idx]); | ||
| 92 | + } | ||
| 93 | + ``` | ||
| @@ -30,7 +30,7 @@ | |||
| 30 | ## 函数原型 | 30 | ## 函数原型 |
| 31 | 31 | ||
| 32 | ```cpp | 32 | ```cpp |
| 33 | -inline float2 __half22float2(const half2 x) | 33 | +float2 __half22float2(const half2 x) |
Outdated 级别:提示 问题:函数原型删除了inline修饰,与同类转换接口文档(均标注inline)不一致。 影响:若实际头文件仍声明为inline,则文档与代码不符,误导用户。 修复建议:核对asc_fp16.h中的实际声明,保持文档与头文件及系列文档一致。 ![]() ![]() | |||
| 34 | ``` | 34 | ``` |
| 35 | 35 | ||
| 36 | ## 参数说明 | 36 | ## 参数说明 |
| @@ -57,6 +57,14 @@ inline float2 __half22float2(const half2 x) | |||
| 57 | 57 | ||
| 58 | 无 | 58 | 无 |
| 59 | 59 | ||
| 60 | +## 需要包含的头文件 | ||
| 61 | + | ||
| 62 | +使用该接口需要包含`simt_api/asc_fp16.h`头文件。 | ||
| 63 | + | ||
| 64 | +```cpp | ||
| 65 | +#include "simt_api/asc_fp16.h" | ||
| 66 | +``` | ||
| 67 | + | ||
| 60 | ## 调用示例 | 68 | ## 调用示例 |
| 61 | 69 | ||
| 62 | - SIMT编程场景: | 70 | - SIMT编程场景: |
| @@ -0,0 +1,95 @@ | |||
| 1 | +# \_\_half2char\_rz | ||
| 2 | + | ||
| 3 | +## 产品支持情况 | ||
| 4 | + | ||
| 5 | +<!-- npu="950" id1 --> | ||
| 6 | +- Ascend 950PR/Ascend 950DT:支持 | ||
| 7 | +<!-- end id1 --> | ||
| 8 | +<!-- npu="A3" id2 --> | ||
| 9 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 10 | +<!-- end id2 --> | ||
| 11 | +<!-- npu="910b" id3 --> | ||
| 12 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 13 | +<!-- end id3 --> | ||
| 14 | +<!-- npu="310b" id4 --> | ||
| 15 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 20 | +<!-- end id5 --> | ||
| 21 | +<!-- npu="910" id6 --> | ||
| 22 | +- Atlas 训练系列产品:不支持 | ||
| 23 | +<!-- end id6 --> | ||
| 24 | +<!-- @ref: asc-devkit/res/docs/zh/api/SIMT-API/math_functions/half_type/half_precision_conversion_functions/__half2char_rz_res.md#id1 --> | ||
| 25 | + | ||
| 26 | +## 功能说明 | ||
| 27 | + | ||
| 28 | +遵循CAST\_TRUNC模式,将half类型数据转换为signed char类型数据,返回转换后的值。 | ||
| 29 | + | ||
| 30 | +## 函数原型 | ||
| 31 | + | ||
| 32 | +```cpp | ||
| 33 | +inline signed char __half2char_rz(const half x) | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +## 参数说明 | ||
| 37 | + | ||
| 38 | +**表1** 参数说明 | ||
| 39 | + | ||
| 40 | +| 参数名 | 输入/输出 | 描述 | | ||
| 41 | +| --- | --- | --- | | ||
| 42 | +| x | 输入 | 源操作数。 | | ||
| 43 | + | ||
| 44 | +## 返回值说明 | ||
| 45 | + | ||
| 46 | +输入遵循CAST\_TRUNC模式转换成的signed char类型数据。特殊值如下: | ||
| 47 | + | ||
| 48 | +| x值 | 返回值 | | ||
| 49 | +| --- | --- | | ||
| 50 | +| 0 | 0 | | ||
| 51 | +| nan | 0 | | ||
| 52 | +| inf | 127(SCHAR_MAX) | | ||
| 53 | +| -inf | -128(SCHAR_MIN) | | ||
| 54 | +| 超出signed char上界 | 127(SCHAR_MAX) | | ||
| 55 | +| 超出signed char下界 | -128(SCHAR_MIN) | | ||
| 56 | + | ||
| 57 | +## 约束说明 | ||
| 58 | + | ||
| 59 | +无 | ||
| 60 | + | ||
| 61 | +## 需要包含的头文件 | ||
| 62 | + | ||
| 63 | +使用该接口需要包含`simt_api/asc_fp16.h`头文件。 | ||
| 64 | + | ||
| 65 | +```cpp | ||
| 66 | +#include "simt_api/asc_fp16.h" | ||
| 67 | +``` | ||
| 68 | + | ||
| 69 | +## 调用示例 | ||
| 70 | + | ||
| 71 | +- SIMT编程场景: | ||
| 72 | + | ||
| 73 | + ```cpp | ||
| 74 | + __global__ __launch_bounds__(1024) void kernel___half2char_rz(signed char* dst, half* x, uint32_t input_total_length) | ||
| 75 | + { | ||
| 76 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 77 | + if (idx >= input_total_length) { | ||
| 78 | + return; | ||
| 79 | + } | ||
| 80 | + dst[idx] = __half2char_rz(x[idx]); | ||
| 81 | + } | ||
| 82 | + ``` | ||
| 83 | + | ||
| 84 | +- SIMD与SIMT混合编程场景: | ||
| 85 | + | ||
| 86 | + ```cpp | ||
| 87 | + __simt_vf__ __launch_bounds__(1024) inline void kernel___half2char_rz(__gm__ signed char* dst, __gm__ half* x, uint32_t input_total_length) | ||
| 88 | + { | ||
| 89 | + uint32_t idx = threadIdx.x + blockIdx.x * blockDim.x; | ||
| 90 | + if (idx >= input_total_length) { | ||
| 91 | + return; | ||
| 92 | + } | ||
| 93 | + dst[idx] = __half2char_rz(x[idx]); | ||
| 94 | + } | ||
| 95 | + ``` | ||


pr关联一下新增issue