Merged
sync类接口废弃 #5789
JC1126Add on Sep 8
sync类接口废弃 #5789
Merged
Merged fromJC1126/asc-devkitjc_090801intocann/asc-devkitmaster
Total: 271 files changed+15807-1504
| @@ -1391,6 +1391,138 @@ | |||
| 1391 | - [asc_mmad_mx(废弃)](SIMD-API/c_api/deprecated_interface/asc_mmad_mx_deprecated.md) | 1391 | - [asc_mmad_mx(废弃)](SIMD-API/c_api/deprecated_interface/asc_mmad_mx_deprecated.md) |
| 1392 | - [asc_mmad_sparse(废弃)](SIMD-API/c_api/deprecated_interface/asc_mmad_sparse_deprecated.md) | 1392 | - [asc_mmad_sparse(废弃)](SIMD-API/c_api/deprecated_interface/asc_mmad_sparse_deprecated.md) |
| 1393 | - [asc_transto5hd_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_transto5hd_sync_deprecated.md) | 1393 | - [asc_transto5hd_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_transto5hd_sync_deprecated.md) |
| 1394 | + - [asc_add_relu_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_add_relu_sync_deprecated.md) | ||
| 1395 | + - [asc_add_scalar_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_add_scalar_sync_deprecated.md) | ||
| 1396 | + - [asc_add_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_add_sync_deprecated.md) | ||
| 1397 | + - [asc_and_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_and_sync_deprecated.md) | ||
| 1398 | + - [asc_axpy_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_axpy_sync_deprecated.md) | ||
| 1399 | + - [asc_bfloat162float_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_bfloat162float_sync_deprecated.md) | ||
| 1400 | + - [asc_bfloat162int32_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_bfloat162int32_sync_deprecated.md) | ||
| 1401 | + - [asc_bitsort_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_bitsort_sync_deprecated.md) | ||
| 1402 | + - [asc_brcb_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_brcb_sync_deprecated.md) | ||
| 1403 | + - [asc_copy_gm2l0a_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_gm2l0a_sync_deprecated.md) | ||
| 1404 | + - [asc_copy_gm2l0b_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_gm2l0b_sync_deprecated.md) | ||
| 1405 | + - [asc_copy_gm2l1_align_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_gm2l1_align_sync_deprecated.md) | ||
| 1406 | + - [asc_copy_gm2l1_dn2nz_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_gm2l1_dn2nz_sync_deprecated.md) | ||
| 1407 | + - [asc_copy_gm2l1_nd2nz_sync_arch_2201(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_gm2l1_nd2nz_sync_arch_2201_deprecated.md) | ||
| 1408 | + - [asc_copy_gm2l1_nd2nz_sync_arch_3510(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_gm2l1_nd2nz_sync_arch_3510_deprecated.md) | ||
| 1409 | + - [asc_copy_gm2l1_sync_2d_arch_3510(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_gm2l1_sync_2d_arch_3510_deprecated.md) | ||
| 1410 | + - [asc_copy_gm2l1_sync_arch_2201(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_gm2l1_sync_arch_2201_deprecated.md) | ||
| 1411 | + - [asc_copy_gm2l1_sync_highdim_split_arch_3510(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_gm2l1_sync_highdim_split_arch_3510_deprecated.md) | ||
| 1412 | + - [asc_copy_gm2ub_align_sync_arch_2201(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_gm2ub_align_sync_arch_2201_deprecated.md) | ||
| 1413 | + - [asc_copy_gm2ub_sync_arch_2201(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_gm2ub_sync_arch_2201_deprecated.md) | ||
| 1414 | + - [asc_copy_gm2ub_sync_arch_3510(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_gm2ub_sync_arch_3510_deprecated.md) | ||
| 1415 | + - [asc_copy_l0c2gm_sync_arch_2201(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l0c2gm_sync_arch_2201_deprecated.md) | ||
| 1416 | + - [asc_copy_l0c2gm_sync_arch_3510(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l0c2gm_sync_arch_3510_deprecated.md) | ||
| 1417 | + - [asc_copy_l0c2l1_sync_arch_2201(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l0c2l1_sync_arch_2201_deprecated.md) | ||
| 1418 | + - [asc_copy_l0c2l1_sync_arch_3510(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l0c2l1_sync_arch_3510_deprecated.md) | ||
| 1419 | + - [asc_copy_l0c2ub_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l0c2ub_sync_deprecated.md) | ||
| 1420 | + - [asc_copy_l12bt_sync_arch_2201(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l12bt_sync_arch_2201_deprecated.md) | ||
| 1421 | + - [asc_copy_l12bt_sync_arch_3510(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l12bt_sync_arch_3510_deprecated.md) | ||
| 1422 | + - [asc_copy_l12fb_sync_arch_2201(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l12fb_sync_arch_2201_deprecated.md) | ||
| 1423 | + - [asc_copy_l12fb_sync_arch_3510(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l12fb_sync_arch_3510_deprecated.md) | ||
| 1424 | + - [asc_copy_l12gm_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l12gm_sync_deprecated.md) | ||
| 1425 | + - [asc_copy_l12l0a_mx_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l12l0a_mx_sync_deprecated.md) | ||
| 1426 | + - [asc_copy_l12l0a_sync_2d_arch_3510(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l12l0a_sync_2d_arch_3510_deprecated.md) | ||
| 1427 | + - [asc_copy_l12l0a_sync_3d_arch_3510(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l12l0a_sync_3d_arch_3510_deprecated.md) | ||
| 1428 | + - [asc_copy_l12l0a_sync_arch_2201(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l12l0a_sync_arch_2201_deprecated.md) | ||
| 1429 | + - [asc_copy_l12l0a_trans_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l12l0a_trans_sync_deprecated.md) | ||
| 1430 | + - [asc_copy_l12l0b_mx_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l12l0b_mx_sync_deprecated.md) | ||
| 1431 | + - [asc_copy_l12l0b_sparse_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l12l0b_sparse_sync_deprecated.md) | ||
| 1432 | + - [asc_copy_l12l0b_sync_2d_arch_3510(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l12l0b_sync_2d_arch_3510_deprecated.md) | ||
| 1433 | + - [asc_copy_l12l0b_sync_3d_arch_3510(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l12l0b_sync_3d_arch_3510_deprecated.md) | ||
| 1434 | + - [asc_copy_l12l0b_sync_arch_2201(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l12l0b_sync_arch_2201_deprecated.md) | ||
| 1435 | + - [asc_copy_l12l0b_trans_sync_arch_2201(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l12l0b_trans_sync_arch_2201_deprecated.md) | ||
| 1436 | + - [asc_copy_l12l0b_trans_sync_arch_3510(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l12l0b_trans_sync_arch_3510_deprecated.md) | ||
| 1437 | + - [asc_copy_l12l0c_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l12l0c_sync_deprecated.md) | ||
| 1438 | + - [asc_copy_l12ub_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_l12ub_sync_deprecated.md) | ||
| 1439 | + - [asc_copy_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_sync_deprecated.md) | ||
| 1440 | + - [asc_copy_ub2gm_align_sync_arch_2201(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_ub2gm_align_sync_arch_2201_deprecated.md) | ||
| 1441 | + - [asc_copy_ub2gm_sync_arch_2201(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_ub2gm_sync_arch_2201_deprecated.md) | ||
| 1442 | + - [asc_copy_ub2gm_sync_arch_3510(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_ub2gm_sync_arch_3510_deprecated.md) | ||
| 1443 | + - [asc_copy_ub2l1_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_ub2l1_sync_deprecated.md) | ||
| 1444 | + - [asc_copy_ub2ub_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_copy_ub2ub_sync_deprecated.md) | ||
| 1445 | + - [asc_datablock_reduce_max_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_datablock_reduce_max_sync_deprecated.md) | ||
| 1446 | + - [asc_datablock_reduce_min_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_datablock_reduce_min_sync_deprecated.md) | ||
| 1447 | + - [asc_datablock_reduce_sum_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_datablock_reduce_sum_sync_deprecated.md) | ||
| 1448 | + - [asc_deq_int162b8_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_deq_int162b8_sync_deprecated.md) | ||
| 1449 | + - [asc_deq_int322half_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_deq_int322half_sync_deprecated.md) | ||
| 1450 | + - [asc_div_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_div_sync_deprecated.md) | ||
| 1451 | + - [asc_duplicate_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_duplicate_sync_deprecated.md) | ||
| 1452 | + - [asc_eq_scalar_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_eq_scalar_sync_deprecated.md) | ||
| 1453 | + - [asc_eq_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_eq_sync_deprecated.md) | ||
| 1454 | + - [asc_exp_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_exp_sync_deprecated.md) | ||
| 1455 | + - [asc_fill_l0a_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_fill_l0a_sync_deprecated.md) | ||
| 1456 | + - [asc_fill_l0b_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_fill_l0b_sync_deprecated.md) | ||
| 1457 | + - [asc_fill_l1_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_fill_l1_sync_deprecated.md) | ||
| 1458 | + - [asc_float2bfloat16_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_float2bfloat16_sync_deprecated.md) | ||
| 1459 | + - [asc_float2float_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_float2float_sync_deprecated.md) | ||
| 1460 | + - [asc_float2half_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_float2half_sync_deprecated.md) | ||
| 1461 | + - [asc_float2int16_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_float2int16_sync_deprecated.md) | ||
| 1462 | + - [asc_float2int32_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_float2int32_sync_deprecated.md) | ||
| 1463 | + - [asc_float2int64_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_float2int64_sync_deprecated.md) | ||
| 1464 | + - [asc_fma_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_fma_sync_deprecated.md) | ||
| 1465 | + - [asc_gather_datablock_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_gather_datablock_sync_deprecated.md) | ||
| 1466 | + - [asc_gather_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_gather_sync_deprecated.md) | ||
| 1467 | + - [asc_ge_scalar_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_ge_scalar_sync_deprecated.md) | ||
| 1468 | + - [asc_ge_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_ge_sync_deprecated.md) | ||
| 1469 | + - [asc_gt_scalar_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_gt_scalar_sync_deprecated.md) | ||
| 1470 | + - [asc_gt_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_gt_sync_deprecated.md) | ||
| 1471 | + - [asc_half2float_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_half2float_sync_deprecated.md) | ||
| 1472 | + - [asc_half2int16_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_half2int16_sync_deprecated.md) | ||
| 1473 | + - [asc_half2int32_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_half2int32_sync_deprecated.md) | ||
| 1474 | + - [asc_half2int4_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_half2int4_sync_deprecated.md) | ||
| 1475 | + - [asc_half2int8_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_half2int8_sync_deprecated.md) | ||
| 1476 | + - [asc_half2uint8_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_half2uint8_sync_deprecated.md) | ||
| 1477 | + - [asc_int162float_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_int162float_sync_deprecated.md) | ||
| 1478 | + - [asc_int162half_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_int162half_sync_deprecated.md) | ||
| 1479 | + - [asc_int322float_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_int322float_sync_deprecated.md) | ||
| 1480 | + - [asc_int322int16_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_int322int16_sync_deprecated.md) | ||
| 1481 | + - [asc_int322int64_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_int322int64_sync_deprecated.md) | ||
| 1482 | + - [asc_int42half_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_int42half_sync_deprecated.md) | ||
| 1483 | + - [asc_int642float_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_int642float_sync_deprecated.md) | ||
| 1484 | + - [asc_int642int32_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_int642int32_sync_deprecated.md) | ||
| 1485 | + - [asc_int82half_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_int82half_sync_deprecated.md) | ||
| 1486 | + - [asc_le_scalar_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_le_scalar_sync_deprecated.md) | ||
| 1487 | + - [asc_le_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_le_sync_deprecated.md) | ||
| 1488 | + - [asc_leakyrelu_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_leakyrelu_sync_deprecated.md) | ||
| 1489 | + - [asc_load_image_to_cbuf_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_load_image_to_cbuf_sync_deprecated.md) | ||
| 1490 | + - [asc_log_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_log_sync_deprecated.md) | ||
| 1491 | + - [asc_lt_scalar_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_lt_scalar_sync_deprecated.md) | ||
| 1492 | + - [asc_lt_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_lt_sync_deprecated.md) | ||
| 1493 | + - [asc_max_scalar_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_max_scalar_sync_deprecated.md) | ||
| 1494 | + - [asc_max_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_max_sync_deprecated.md) | ||
| 1495 | + - [asc_min_scalar_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_min_scalar_sync_deprecated.md) | ||
| 1496 | + - [asc_min_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_min_sync_deprecated.md) | ||
| 1497 | + - [asc_mrgsort4_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_mrgsort4_sync_deprecated.md) | ||
| 1498 | + - [asc_mul_add_relu_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_mul_add_relu_sync_deprecated.md) | ||
| 1499 | + - [asc_mul_add_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_mul_add_sync_deprecated.md) | ||
| 1500 | + - [asc_mul_cast_half2int8_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_mul_cast_half2int8_sync_deprecated.md) | ||
| 1501 | + - [asc_mul_cast_half2uint8_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_mul_cast_half2uint8_sync_deprecated.md) | ||
| 1502 | + - [asc_mul_scalar_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_mul_scalar_sync_deprecated.md) | ||
| 1503 | + - [asc_mul_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_mul_sync_deprecated.md) | ||
| 1504 | + - [asc_ne_scalar_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_ne_scalar_sync_deprecated.md) | ||
| 1505 | + - [asc_ne_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_ne_sync_deprecated.md) | ||
| 1506 | + - [asc_not_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_not_sync_deprecated.md) | ||
| 1507 | + - [asc_or_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_or_sync_deprecated.md) | ||
| 1508 | + - [asc_pair_reduce_sum_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_pair_reduce_sum_sync_deprecated.md) | ||
| 1509 | + - [asc_rcp_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_rcp_sync_deprecated.md) | ||
| 1510 | + - [asc_reduce_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_reduce_sync_deprecated.md) | ||
| 1511 | + - [asc_relu_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_relu_sync_deprecated.md) | ||
| 1512 | + - [asc_repeat_reduce_max_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_repeat_reduce_max_sync_deprecated.md) | ||
| 1513 | + - [asc_repeat_reduce_min_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_repeat_reduce_min_sync_deprecated.md) | ||
| 1514 | + - [asc_repeat_reduce_sum_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_repeat_reduce_sum_sync_deprecated.md) | ||
| 1515 | + - [asc_rsqrt_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_rsqrt_sync_deprecated.md) | ||
| 1516 | + - [asc_select_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_select_sync_deprecated.md) | ||
| 1517 | + - [asc_shiftleft_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_shiftleft_sync_deprecated.md) | ||
| 1518 | + - [asc_shiftright_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_shiftright_sync_deprecated.md) | ||
| 1519 | + - [asc_sqrt_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_sqrt_sync_deprecated.md) | ||
| 1520 | + - [asc_sub_relu_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_sub_relu_sync_deprecated.md) | ||
| 1521 | + - [asc_sub_scalar_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_sub_scalar_sync_deprecated.md) | ||
| 1522 | + - [asc_sub_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_sub_sync_deprecated.md) | ||
| 1523 | + - [asc_transpose_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_transpose_sync_deprecated.md) | ||
| 1524 | + - [asc_uint82half_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_uint82half_sync_deprecated.md) | ||
| 1525 | + - [asc_vdeq_int162b8_sync(废弃)](SIMD-API/c_api/deprecated_interface/asc_vdeq_int162b8_sync_deprecated.md) | ||
| 1394 | 1526 | ||
| 1395 | - [Tensor API](SIMD-API/tensor_api/tensor_api.md) | 1527 | - [Tensor API](SIMD-API/tensor_api/tensor_api.md) |
| 1396 | - [Tensor API列表](SIMD-API/tensor_api/tensor_api_list.md) | 1528 | - [Tensor API列表](SIMD-API/tensor_api/tensor_api_list.md) |
| @@ -715,3 +715,142 @@ C API文档按最细粒度公共头文件归类。除试验接口外,整体使 | |||
| 715 | |[asc_set_ctrl](spr/asc_set_ctrl.md)|设置CTRL寄存器(控制寄存器)的值。|`c_api/spr/spr.h`| | 715 | |[asc_set_ctrl](spr/asc_set_ctrl.md)|设置CTRL寄存器(控制寄存器)的值。|`c_api/spr/spr.h`| |
| 716 | |[asc_set_saturation_flag](spr/asc_set_saturation_flag.md)|设置指定饱和模式的开关状态。|`c_api/spr/spr.h`| | 716 | |[asc_set_saturation_flag](spr/asc_set_saturation_flag.md)|设置指定饱和模式的开关状态。|`c_api/spr/spr.h`| |
| 717 | |[asc_set_saturation_strategy](spr/asc_set_saturation_strategy.md)|设置饱和控制策略。|`c_api/spr/spr.h`| | 717 | |[asc_set_saturation_strategy](spr/asc_set_saturation_strategy.md)|设置饱和控制策略。|`c_api/spr/spr.h`| |
| 718 | + | ||
| 719 | +## 废弃同步接口 | ||
| 720 | + | ||
| 721 | +| 废弃接口 | 说明 | | ||
| 722 | +| --- | --- | | ||
| 723 | +| [asc_abs_sync(废弃)](deprecated_interface/asc_abs_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 724 | +| [asc_add_relu_sync(废弃)](deprecated_interface/asc_add_relu_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 725 | +| [asc_add_scalar_sync(废弃)](deprecated_interface/asc_add_scalar_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 726 | +| [asc_add_sync(废弃)](deprecated_interface/asc_add_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 727 | +| [asc_and_sync(废弃)](deprecated_interface/asc_and_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 728 | +| [asc_axpy_sync(废弃)](deprecated_interface/asc_axpy_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 729 | +| [asc_bfloat162float_sync(废弃)](deprecated_interface/asc_bfloat162float_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 730 | +| [asc_bfloat162int32_sync(废弃)](deprecated_interface/asc_bfloat162int32_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 731 | +| [asc_bitsort_sync(废弃)](deprecated_interface/asc_bitsort_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 732 | +| [asc_brcb_sync(废弃)](deprecated_interface/asc_brcb_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 733 | +| [asc_copy_gm2l0a_sync(废弃)](deprecated_interface/asc_copy_gm2l0a_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 734 | +| [asc_copy_gm2l0b_sync(废弃)](deprecated_interface/asc_copy_gm2l0b_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 735 | +| [asc_copy_gm2l1_align_sync(废弃)](deprecated_interface/asc_copy_gm2l1_align_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 736 | +| [asc_copy_gm2l1_dn2nz_sync(废弃)](deprecated_interface/asc_copy_gm2l1_dn2nz_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 737 | +| [asc_copy_gm2l1_nd2nz_sync_arch_2201(废弃)](deprecated_interface/asc_copy_gm2l1_nd2nz_sync_arch_2201_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 738 | +| [asc_copy_gm2l1_nd2nz_sync_arch_3510(废弃)](deprecated_interface/asc_copy_gm2l1_nd2nz_sync_arch_3510_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 739 | +| [asc_copy_gm2l1_sync_2d_arch_3510(废弃)](deprecated_interface/asc_copy_gm2l1_sync_2d_arch_3510_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 740 | +| [asc_copy_gm2l1_sync_arch_2201(废弃)](deprecated_interface/asc_copy_gm2l1_sync_arch_2201_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 741 | +| [asc_copy_gm2l1_sync_highdim_split_arch_3510(废弃)](deprecated_interface/asc_copy_gm2l1_sync_highdim_split_arch_3510_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 742 | +| [asc_copy_gm2ub_align_sync_arch_2201(废弃)](deprecated_interface/asc_copy_gm2ub_align_sync_arch_2201_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 743 | +| [asc_copy_gm2ub_sync_arch_2201(废弃)](deprecated_interface/asc_copy_gm2ub_sync_arch_2201_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 744 | +| [asc_copy_gm2ub_sync_arch_3510(废弃)](deprecated_interface/asc_copy_gm2ub_sync_arch_3510_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 745 | +| [asc_copy_l0c2gm_sync_arch_2201(废弃)](deprecated_interface/asc_copy_l0c2gm_sync_arch_2201_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 746 | +| [asc_copy_l0c2gm_sync_arch_3510(废弃)](deprecated_interface/asc_copy_l0c2gm_sync_arch_3510_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 747 | +| [asc_copy_l0c2l1_sync_arch_2201(废弃)](deprecated_interface/asc_copy_l0c2l1_sync_arch_2201_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 748 | +| [asc_copy_l0c2l1_sync_arch_3510(废弃)](deprecated_interface/asc_copy_l0c2l1_sync_arch_3510_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 749 | +| [asc_copy_l0c2ub_sync(废弃)](deprecated_interface/asc_copy_l0c2ub_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 750 | +| [asc_copy_l12bt_sync_arch_2201(废弃)](deprecated_interface/asc_copy_l12bt_sync_arch_2201_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 751 | +| [asc_copy_l12bt_sync_arch_3510(废弃)](deprecated_interface/asc_copy_l12bt_sync_arch_3510_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 752 | +| [asc_copy_l12fb_sync_arch_2201(废弃)](deprecated_interface/asc_copy_l12fb_sync_arch_2201_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 753 | +| [asc_copy_l12fb_sync_arch_3510(废弃)](deprecated_interface/asc_copy_l12fb_sync_arch_3510_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 754 | +| [asc_copy_l12gm_sync(废弃)](deprecated_interface/asc_copy_l12gm_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 755 | +| [asc_copy_l12l0a_mx_sync(废弃)](deprecated_interface/asc_copy_l12l0a_mx_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 756 | +| [asc_copy_l12l0a_sync_2d_arch_3510(废弃)](deprecated_interface/asc_copy_l12l0a_sync_2d_arch_3510_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 757 | +| [asc_copy_l12l0a_sync_3d_arch_3510(废弃)](deprecated_interface/asc_copy_l12l0a_sync_3d_arch_3510_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 758 | +| [asc_copy_l12l0a_sync_arch_2201(废弃)](deprecated_interface/asc_copy_l12l0a_sync_arch_2201_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 759 | +| [asc_copy_l12l0a_trans_sync(废弃)](deprecated_interface/asc_copy_l12l0a_trans_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 760 | +| [asc_copy_l12l0b_mx_sync(废弃)](deprecated_interface/asc_copy_l12l0b_mx_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 761 | +| [asc_copy_l12l0b_sparse_sync(废弃)](deprecated_interface/asc_copy_l12l0b_sparse_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 762 | +| [asc_copy_l12l0b_sync_2d_arch_3510(废弃)](deprecated_interface/asc_copy_l12l0b_sync_2d_arch_3510_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 763 | +| [asc_copy_l12l0b_sync_3d_arch_3510(废弃)](deprecated_interface/asc_copy_l12l0b_sync_3d_arch_3510_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 764 | +| [asc_copy_l12l0b_sync_arch_2201(废弃)](deprecated_interface/asc_copy_l12l0b_sync_arch_2201_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 765 | +| [asc_copy_l12l0b_trans_sync_arch_2201(废弃)](deprecated_interface/asc_copy_l12l0b_trans_sync_arch_2201_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 766 | +| [asc_copy_l12l0b_trans_sync_arch_3510(废弃)](deprecated_interface/asc_copy_l12l0b_trans_sync_arch_3510_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 767 | +| [asc_copy_l12l0c_sync(废弃)](deprecated_interface/asc_copy_l12l0c_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 768 | +| [asc_copy_l12ub_sync(废弃)](deprecated_interface/asc_copy_l12ub_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 769 | +| [asc_copy_sync(废弃)](deprecated_interface/asc_copy_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 770 | +| [asc_copy_ub2gm_align_sync_arch_2201(废弃)](deprecated_interface/asc_copy_ub2gm_align_sync_arch_2201_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 771 | +| [asc_copy_ub2gm_sync_arch_2201(废弃)](deprecated_interface/asc_copy_ub2gm_sync_arch_2201_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 772 | +| [asc_copy_ub2gm_sync_arch_3510(废弃)](deprecated_interface/asc_copy_ub2gm_sync_arch_3510_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 773 | +| [asc_copy_ub2l1_sync(废弃)](deprecated_interface/asc_copy_ub2l1_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 774 | +| [asc_copy_ub2ub_sync(废弃)](deprecated_interface/asc_copy_ub2ub_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 775 | +| [asc_datablock_reduce_max_sync(废弃)](deprecated_interface/asc_datablock_reduce_max_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 776 | +| [asc_datablock_reduce_min_sync(废弃)](deprecated_interface/asc_datablock_reduce_min_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 777 | +| [asc_datablock_reduce_sum_sync(废弃)](deprecated_interface/asc_datablock_reduce_sum_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 778 | +| [asc_deq_int162b8_sync(废弃)](deprecated_interface/asc_deq_int162b8_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 779 | +| [asc_deq_int322half_sync(废弃)](deprecated_interface/asc_deq_int322half_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 780 | +| [asc_div_sync(废弃)](deprecated_interface/asc_div_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 781 | +| [asc_duplicate_sync(废弃)](deprecated_interface/asc_duplicate_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 782 | +| [asc_eq_scalar_sync(废弃)](deprecated_interface/asc_eq_scalar_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 783 | +| [asc_eq_sync(废弃)](deprecated_interface/asc_eq_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 784 | +| [asc_exp_sync(废弃)](deprecated_interface/asc_exp_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 785 | +| [asc_fill_l0a_sync(废弃)](deprecated_interface/asc_fill_l0a_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 786 | +| [asc_fill_l0b_sync(废弃)](deprecated_interface/asc_fill_l0b_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 787 | +| [asc_fill_l1_sync(废弃)](deprecated_interface/asc_fill_l1_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 788 | +| [asc_float2bfloat16_sync(废弃)](deprecated_interface/asc_float2bfloat16_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 789 | +| [asc_float2float_sync(废弃)](deprecated_interface/asc_float2float_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 790 | +| [asc_float2half_sync(废弃)](deprecated_interface/asc_float2half_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 791 | +| [asc_float2int16_sync(废弃)](deprecated_interface/asc_float2int16_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 792 | +| [asc_float2int32_sync(废弃)](deprecated_interface/asc_float2int32_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 793 | +| [asc_float2int64_sync(废弃)](deprecated_interface/asc_float2int64_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 794 | +| [asc_fma_sync(废弃)](deprecated_interface/asc_fma_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 795 | +| [asc_gather_datablock_sync(废弃)](deprecated_interface/asc_gather_datablock_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 796 | +| [asc_gather_sync(废弃)](deprecated_interface/asc_gather_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 797 | +| [asc_ge_scalar_sync(废弃)](deprecated_interface/asc_ge_scalar_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 798 | +| [asc_ge_sync(废弃)](deprecated_interface/asc_ge_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 799 | +| [asc_gt_scalar_sync(废弃)](deprecated_interface/asc_gt_scalar_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 800 | +| [asc_gt_sync(废弃)](deprecated_interface/asc_gt_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 801 | +| [asc_half2float_sync(废弃)](deprecated_interface/asc_half2float_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 802 | +| [asc_half2int16_sync(废弃)](deprecated_interface/asc_half2int16_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 803 | +| [asc_half2int32_sync(废弃)](deprecated_interface/asc_half2int32_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 804 | +| [asc_half2int4_sync(废弃)](deprecated_interface/asc_half2int4_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 805 | +| [asc_half2int8_sync(废弃)](deprecated_interface/asc_half2int8_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 806 | +| [asc_half2uint8_sync(废弃)](deprecated_interface/asc_half2uint8_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 807 | +| [asc_int162float_sync(废弃)](deprecated_interface/asc_int162float_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 808 | +| [asc_int162half_sync(废弃)](deprecated_interface/asc_int162half_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 809 | +| [asc_int322float_sync(废弃)](deprecated_interface/asc_int322float_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 810 | +| [asc_int322int16_sync(废弃)](deprecated_interface/asc_int322int16_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 811 | +| [asc_int322int64_sync(废弃)](deprecated_interface/asc_int322int64_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 812 | +| [asc_int42half_sync(废弃)](deprecated_interface/asc_int42half_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 813 | +| [asc_int642float_sync(废弃)](deprecated_interface/asc_int642float_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 814 | +| [asc_int642int32_sync(废弃)](deprecated_interface/asc_int642int32_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 815 | +| [asc_int82half_sync(废弃)](deprecated_interface/asc_int82half_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 816 | +| [asc_le_scalar_sync(废弃)](deprecated_interface/asc_le_scalar_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 817 | +| [asc_le_sync(废弃)](deprecated_interface/asc_le_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 818 | +| [asc_leakyrelu_sync(废弃)](deprecated_interface/asc_leakyrelu_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 819 | +| [asc_load_image_to_cbuf_sync(废弃)](deprecated_interface/asc_load_image_to_cbuf_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 820 | +| [asc_log_sync(废弃)](deprecated_interface/asc_log_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 821 | +| [asc_lt_scalar_sync(废弃)](deprecated_interface/asc_lt_scalar_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 822 | +| [asc_lt_sync(废弃)](deprecated_interface/asc_lt_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 823 | +| [asc_max_scalar_sync(废弃)](deprecated_interface/asc_max_scalar_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 824 | +| [asc_max_sync(废弃)](deprecated_interface/asc_max_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 825 | +| [asc_min_scalar_sync(废弃)](deprecated_interface/asc_min_scalar_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 826 | +| [asc_min_sync(废弃)](deprecated_interface/asc_min_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 827 | +| [asc_mrgsort4_sync(废弃)](deprecated_interface/asc_mrgsort4_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 828 | +| [asc_mul_add_relu_sync(废弃)](deprecated_interface/asc_mul_add_relu_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 829 | +| [asc_mul_add_sync(废弃)](deprecated_interface/asc_mul_add_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 830 | +| [asc_mul_cast_half2int8_sync(废弃)](deprecated_interface/asc_mul_cast_half2int8_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 831 | +| [asc_mul_cast_half2uint8_sync(废弃)](deprecated_interface/asc_mul_cast_half2uint8_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 832 | +| [asc_mul_scalar_sync(废弃)](deprecated_interface/asc_mul_scalar_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 833 | +| [asc_mul_sync(废弃)](deprecated_interface/asc_mul_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 834 | +| [asc_ne_scalar_sync(废弃)](deprecated_interface/asc_ne_scalar_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 835 | +| [asc_ne_sync(废弃)](deprecated_interface/asc_ne_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 836 | +| [asc_not_sync(废弃)](deprecated_interface/asc_not_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 837 | +| [asc_or_sync(废弃)](deprecated_interface/asc_or_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 838 | +| [asc_pair_reduce_sum_sync(废弃)](deprecated_interface/asc_pair_reduce_sum_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 839 | +| [asc_rcp_sync(废弃)](deprecated_interface/asc_rcp_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 840 | +| [asc_reduce_sync(废弃)](deprecated_interface/asc_reduce_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 841 | +| [asc_relu_sync(废弃)](deprecated_interface/asc_relu_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 842 | +| [asc_repeat_reduce_max_sync(废弃)](deprecated_interface/asc_repeat_reduce_max_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 843 | +| [asc_repeat_reduce_min_sync(废弃)](deprecated_interface/asc_repeat_reduce_min_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 844 | +| [asc_repeat_reduce_sum_sync(废弃)](deprecated_interface/asc_repeat_reduce_sum_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 845 | +| [asc_rsqrt_sync(废弃)](deprecated_interface/asc_rsqrt_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 846 | +| [asc_select_sync(废弃)](deprecated_interface/asc_select_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 847 | +| [asc_shiftleft_sync(废弃)](deprecated_interface/asc_shiftleft_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 848 | +| [asc_shiftright_sync(废弃)](deprecated_interface/asc_shiftright_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 849 | +| [asc_sqrt_sync(废弃)](deprecated_interface/asc_sqrt_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 850 | +| [asc_sub_relu_sync(废弃)](deprecated_interface/asc_sub_relu_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 851 | +| [asc_sub_scalar_sync(废弃)](deprecated_interface/asc_sub_scalar_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 852 | +| [asc_sub_sync(废弃)](deprecated_interface/asc_sub_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 853 | +| [asc_transpose_sync(废弃)](deprecated_interface/asc_transpose_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 854 | +| [asc_transto5hd_sync(废弃)](deprecated_interface/asc_transto5hd_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 855 | +| [asc_uint82half_sync(废弃)](deprecated_interface/asc_uint82half_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| 856 | +| [asc_vdeq_int162b8_sync(废弃)](deprecated_interface/asc_vdeq_int162b8_sync_deprecated.md) | 该接口已废弃,替代关系及迁移方式请参见接口文档。 | | ||
| @@ -64,10 +64,11 @@ uint16_t right_width = 16; // N | |||
| 64 | // 在 asc_mmad 前调用:以 FP8 格式参与矩阵运算(非 HiF8 转换路径) | 64 | // 在 asc_mmad 前调用:以 FP8 格式参与矩阵运算(非 HiF8 转换路径) |
| 65 | asc_enable_fp8(); | 65 | asc_enable_fp8(); |
| 66 | 66 | ||
| 67 | -uint8_t unit_flag = 0; | 67 | +asc_unit_flag_mode unit_flag_mode = asc_unit_flag_mode::DISABLE; |
| 68 | bool disable_gemv = false; | 68 | bool disable_gemv = false; |
| 69 | bool c_matrix_source = false; | 69 | bool c_matrix_source = false; |
| 70 | bool c_matrix_init_val = true; | 70 | bool c_matrix_init_val = true; |
| 71 | -asc_mmad_sync(c_matrix, a_matrix, b_matrix, left_height, n_dim, right_width, | 71 | +asc_mmad(c_matrix, a_matrix, b_matrix, left_height, n_dim, right_width, |
| 72 | - unit_flag, disable_gemv, c_matrix_source, c_matrix_init_val); | 72 | + unit_flag_mode, disable_gemv, c_matrix_source, c_matrix_init_val); |
| 73 | +asc_sync(); | ||
| 73 | ``` | 74 | ``` |
| @@ -45,19 +45,6 @@ | |||
| 45 | __aicore__ inline void asc_copy_gm2l0a(__ca__ int4b_t* dst, __gm__ int4b_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | 45 | __aicore__ inline void asc_copy_gm2l0a(__ca__ int4b_t* dst, __gm__ int4b_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) |
| 46 | ``` | 46 | ``` |
| 47 | 47 | ||
| 48 | -- 同步搬运 | ||
| 49 | - | ||
| 50 | - ```cpp | ||
| 51 | - __aicore__ inline void asc_copy_gm2l0a_sync(__ca__ bfloat16_t* dst, __gm__ bfloat16_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 52 | - __aicore__ inline void asc_copy_gm2l0a_sync(__ca__ half* dst, __gm__ half* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 53 | - __aicore__ inline void asc_copy_gm2l0a_sync(__ca__ float* dst, __gm__ float* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 54 | - __aicore__ inline void asc_copy_gm2l0a_sync(__ca__ int32_t* dst, __gm__ int32_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 55 | - __aicore__ inline void asc_copy_gm2l0a_sync(__ca__ uint8_t* dst, __gm__ uint8_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 56 | - __aicore__ inline void asc_copy_gm2l0a_sync(__ca__ int8_t* dst, __gm__ int8_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 57 | - __aicore__ inline void asc_copy_gm2l0a_sync(__ca__ uint32_t* dst, __gm__ uint32_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 58 | - __aicore__ inline void asc_copy_gm2l0a_sync(__ca__ int4b_t* dst, __gm__ int4b_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 59 | - ``` | ||
| 60 | - | ||
| 61 | ## 参数说明 | 48 | ## 参数说明 |
| 62 | 49 | ||
| 63 | **表1** 参数说明 | 50 | **表1** 参数说明 |
| @@ -65,7 +52,7 @@ | |||
| 65 | | 参数名 |输入/输出| 描述 | | 52 | | 参数名 |输入/输出| 描述 | |
| 66 | |-----| ------------ |-----------------------------------------------------------| | 53 | |-----| ------------ |-----------------------------------------------------------| |
| 67 | | dst | 输出 | 目的操作数起始地址。 | | 54 | | dst | 输出 | 目的操作数起始地址。 | |
| 68 | -| src | 输入 | 源操作数起始地址。 | | 55 | +| src | 输入 | 源操作数起始地址。 | |
| 69 | | base_idx | 输入 | 分形矩阵ID,搬运起始位置为源操作数的第几个分形(0为源操作数中第1个分形矩阵)。取值范围:[0, 65535]。 | | 56 | | base_idx | 输入 | 分形矩阵ID,搬运起始位置为源操作数的第几个分形(0为源操作数中第1个分形矩阵)。取值范围:[0, 65535]。 | |
| 70 | | repeat | 输入 | 迭代次数,每个迭代可以处理512B数据。取值范围:[1, 255]。 | | 57 | | repeat | 输入 | 迭代次数,每个迭代可以处理512B数据。取值范围:[1, 255]。 | |
| 71 | | src_stride | 输入 | 相邻迭代间,源操作数前一个分形与后一个分形起始地址的间隔,单位:512B。取值范围:[0, 65535]。 | | 58 | | src_stride | 输入 | 相邻迭代间,源操作数前一个分形与后一个分形起始地址的间隔,单位:512B。取值范围:[0, 65535]。 | |
| @@ -45,19 +45,6 @@ | |||
| 45 | __aicore__ inline void asc_copy_gm2l0b(__cb__ float* dst, __gm__ float* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | 45 | __aicore__ inline void asc_copy_gm2l0b(__cb__ float* dst, __gm__ float* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) |
| 46 | ``` | 46 | ``` |
| 47 | 47 | ||
| 48 | -- 同步搬运 | ||
| 49 | - | ||
| 50 | - ```cpp | ||
| 51 | - __aicore__ inline void asc_copy_gm2l0b_sync(__cb__ int4b_t* dst, __gm__ int4b_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 52 | - __aicore__ inline void asc_copy_gm2l0b_sync(__cb__ int8_t* dst, __gm__ int8_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 53 | - __aicore__ inline void asc_copy_gm2l0b_sync(__cb__ uint8_t* dst, __gm__ uint8_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 54 | - __aicore__ inline void asc_copy_gm2l0b_sync(__cb__ half* dst, __gm__ half* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 55 | - __aicore__ inline void asc_copy_gm2l0b_sync(__cb__ bfloat16_t* dst, __gm__ bfloat16_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 56 | - __aicore__ inline void asc_copy_gm2l0b_sync(__cb__ int32_t* dst, __gm__ int32_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 57 | - __aicore__ inline void asc_copy_gm2l0b_sync(__cb__ uint32_t* dst, __gm__ uint32_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 58 | - __aicore__ inline void asc_copy_gm2l0b_sync(__cb__ float* dst, __gm__ float* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 59 | - ``` | ||
| 60 | - | ||
| 61 | ## 参数说明 | 48 | ## 参数说明 |
| 62 | 49 | ||
| 63 | **表1** 参数说明 | 50 | **表1** 参数说明 |
| @@ -89,7 +76,7 @@ PIPE_MTE2 | |||
| 89 | //搬运的起始分块为1 | 76 | //搬运的起始分块为1 |
| 90 | constexpr uint16_t base_idx = 1; | 77 | constexpr uint16_t base_idx = 1; |
| 91 | //搬运的迭代次数为2 | 78 | //搬运的迭代次数为2 |
| 92 | -constexpr uint8_t repeat = 2; | 79 | +constexpr uint8_t repeat = 2; |
| 93 | //输入的搬运步长为0字节,输出的搬运步长为1024字节 | 80 | //输入的搬运步长为0字节,输出的搬运步长为1024字节 |
| 94 | constexpr uint16_t src_stride = 0; | 81 | constexpr uint16_t src_stride = 0; |
| 95 | constexpr uint16_t dst_gap = 1; | 82 | constexpr uint16_t dst_gap = 1; |
| @@ -46,15 +46,6 @@ __aicore__ inline void asc_copy_gm2l1(__cbuf__ <dtype>* dst, | |||
| 46 | uint16_t k_step, | 46 | uint16_t k_step, |
| 47 | uint8_t decomp_mode, | 47 | uint8_t decomp_mode, |
| 48 | uint8_t l2_cache_ctl) | 48 | uint8_t l2_cache_ctl) |
| 49 | -__aicore__ inline void asc_copy_gm2l1_sync(__cbuf__ <dtype>* dst, | ||
| 50 | - __gm__ <dtype>* src, | ||
| 51 | - uint32_t m_start_position, | ||
| 52 | - uint32_t k_start_position, | ||
| 53 | - uint16_t dst_stride, | ||
| 54 | - uint16_t m_step, | ||
| 55 | - uint16_t k_step, | ||
| 56 | - uint8_t decomp_mode, | ||
| 57 | - uint8_t l2_cache_ctl) | ||
| 58 | ``` | 49 | ``` |
| 59 | 50 | ||
| 60 | ### dtype支持的数据类型 | 51 | ### dtype支持的数据类型 |
| @@ -87,29 +87,6 @@ | |||
| 87 | uint16_t len_burst, uint16_t src_gap, uint16_t dst_gap) | 87 | uint16_t len_burst, uint16_t src_gap, uint16_t dst_gap) |
| 88 | ``` | 88 | ``` |
| 89 | 89 | ||
| 90 | -- 普通搬运模式(同步) | ||
| 91 | - | ||
| 92 | - ```cpp | ||
| 93 | - // 不进行pad操作 | ||
| 94 | - __aicore__ inline void asc_copy_gm2l1_sync(__cbuf__ void* dst, __gm__ void* src, uint32_t size) | ||
| 95 | - // 以32B为单位,每1B插入31B的pad | ||
| 96 | - __aicore__ inline void asc_copy_gm2l1_pad1_sync(__cbuf__ void* dst, __gm__ void* src, uint32_t size) | ||
| 97 | - // 以32B为单位,每1B插入15B的pad | ||
| 98 | - __aicore__ inline void asc_copy_gm2l1_pad2_sync(__cbuf__ void* dst, __gm__ void* src, uint32_t size) | ||
| 99 | - // 以32B为单位,每2B插入14B的pad | ||
| 100 | - __aicore__ inline void asc_copy_gm2l1_pad3_sync(__cbuf__ void* dst, __gm__ void* src, uint32_t size) | ||
| 101 | - // 以32B为单位,每4B插入12B的pad | ||
| 102 | - __aicore__ inline void asc_copy_gm2l1_pad4_sync(__cbuf__ void* dst, __gm__ void* src, uint32_t size) | ||
| 103 | - // 以32B为单位,每8B插入8B的pad | ||
| 104 | - __aicore__ inline void asc_copy_gm2l1_pad5_sync(__cbuf__ void* dst, __gm__ void* src, uint32_t size) | ||
| 105 | - // 每32B删除最高位的28B,最低位的4B连续存储 | ||
| 106 | - __aicore__ inline void asc_copy_gm2l1_pad6_sync(__cbuf__ void* dst, __gm__ void* src, uint32_t size) | ||
| 107 | - // 每32B删除最高位的24B,最低位的8B连续存储 | ||
| 108 | - __aicore__ inline void asc_copy_gm2l1_pad7_sync(__cbuf__ void* dst, __gm__ void* src, uint32_t size) | ||
| 109 | - // 每32B删除最高位的16B,最低位的16B连续存储 | ||
| 110 | - __aicore__ inline void asc_copy_gm2l1_pad8_sync(__cbuf__ void* dst, __gm__ void* src, uint32_t size) | ||
| 111 | - ``` | ||
| 112 | - | ||
| 113 | - 2D搬运模式 | 90 | - 2D搬运模式 |
| 114 | 91 | ||
| 115 | ```cpp | 92 | ```cpp |
| @@ -129,25 +106,6 @@ | |||
| 129 | __aicore__ inline void asc_copy_gm2l1(__cbuf__ uint8_t* dst, __gm__ uint8_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | 106 | __aicore__ inline void asc_copy_gm2l1(__cbuf__ uint8_t* dst, __gm__ uint8_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) |
| 130 | ``` | 107 | ``` |
| 131 | 108 | ||
| 132 | -- 2D搬运模式(同步) | ||
| 133 | - | ||
| 134 | - ```cpp | ||
| 135 | - // 2D搬运bfloat16_t类型矩阵数据(同步) | ||
| 136 | - __aicore__ inline void asc_copy_gm2l1_sync(__cbuf__ bfloat16_t* dst, __gm__ bfloat16_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 137 | - // 2D搬运half类型矩阵数据(同步) | ||
| 138 | - __aicore__ inline void asc_copy_gm2l1_sync(__cbuf__ half* dst, __gm__ half* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 139 | - // 2D搬运float类型矩阵数据(同步) | ||
| 140 | - __aicore__ inline void asc_copy_gm2l1_sync(__cbuf__ float* dst, __gm__ float* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 141 | - // 2D搬运int32_t类型矩阵数据(同步) | ||
| 142 | - __aicore__ inline void asc_copy_gm2l1_sync(__cbuf__ int32_t* dst, __gm__ int32_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 143 | - // 2D搬运int8_t类型矩阵数据(同步) | ||
| 144 | - __aicore__ inline void asc_copy_gm2l1_sync(__cbuf__ int8_t* dst, __gm__ int8_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 145 | - // 2D搬运uint32_t类型矩阵数据(同步) | ||
| 146 | - __aicore__ inline void asc_copy_gm2l1_sync(__cbuf__ uint32_t* dst, __gm__ uint32_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 147 | - // 2D搬运uint8_t类型矩阵数据(同步) | ||
| 148 | - __aicore__ inline void asc_copy_gm2l1_sync(__cbuf__ uint8_t* dst, __gm__ uint8_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 149 | - ``` | ||
| 150 | - | ||
| 151 | ## 参数说明 | 109 | ## 参数说明 |
| 152 | 110 | ||
| 153 | ### 普通搬运模式参数 | 111 | ### 普通搬运模式参数 |
Mdocs/zh/api/SIMD-API/c_api/cube_datamove/asc_copy_gm2l1/asc_copy_gm2l1_highdim_split_arch_3510.md+0-3
| @@ -40,9 +40,6 @@ | |||
| 40 | __aicore__ inline void asc_copy_gm2l1(__cbuf__ void* dst, __gm__ void* src, uint32_t n_burst, | 40 | __aicore__ inline void asc_copy_gm2l1(__cbuf__ void* dst, __gm__ void* src, uint32_t n_burst, |
| 41 | uint32_t len_burst, uint8_t pad_func_mode, uint64_t src_stride, | 41 | uint32_t len_burst, uint8_t pad_func_mode, uint64_t src_stride, |
| 42 | uint32_t dst_stride) | 42 | uint32_t dst_stride) |
| 43 | -__aicore__ inline void asc_copy_gm2l1_sync(__cbuf__ void* dst, __gm__ void* src, uint32_t n_burst, | ||
| 44 | - uint32_t len_burst, uint8_t pad_func_mode, uint64_t src_stride, | ||
| 45 | - uint32_t dst_stride) | ||
| 46 | ``` | 43 | ``` |
| 47 | 44 | ||
| 48 | ## 参数说明 | 45 | ## 参数说明 |
| @@ -76,17 +76,6 @@ __aicore__ inline void asc_copy_gm2l1_align(__cbuf__ <dtype>* dst, | |||
| 76 | uint8_t l2_cache_ctl, | 76 | uint8_t l2_cache_ctl, |
| 77 | uint64_t burst_src_stride, | 77 | uint64_t burst_src_stride, |
| 78 | uint32_t burst_dst_stride) | 78 | uint32_t burst_dst_stride) |
| 79 | -// 占位符形式 | ||
| 80 | -__aicore__ inline void asc_copy_gm2l1_align_sync(__cbuf__ <dtype>* dst, | ||
| 81 | - __gm__ <dtype>* src, | ||
| 82 | - uint32_t n_burst, | ||
| 83 | - uint32_t len_burst, | ||
| 84 | - uint8_t left_padding_count, | ||
| 85 | - uint8_t right_padding_count, | ||
| 86 | - bool data_select_bit, | ||
| 87 | - uint8_t l2_cache_ctl, | ||
| 88 | - uint64_t burst_src_stride, | ||
| 89 | - uint32_t burst_dst_stride) | ||
| 90 | ``` | 79 | ``` |
| 91 | 80 | ||
| 92 | ### dtype支持的数据类型 | 81 | ### dtype支持的数据类型 |
| @@ -53,14 +53,6 @@ __aicore__ inline void asc_copy_gm2l1_dn2nz(__cbuf__ <dtype>* dst, | |||
| 53 | uint32_t d_value, | 53 | uint32_t d_value, |
| 54 | uint64_t loop4_src_stride, | 54 | uint64_t loop4_src_stride, |
| 55 | bool smallc0_en) | 55 | bool smallc0_en) |
| 56 | -__aicore__ inline void asc_copy_gm2l1_dn2nz_sync(__cbuf__ <dtype>* dst, | ||
| 57 | - __gm__ <dtype>* src, | ||
| 58 | - uint64_t loop1_src_stride, | ||
| 59 | - uint8_t l2_cache_ctl, | ||
| 60 | - uint16_t n_value, | ||
| 61 | - uint32_t d_value, | ||
| 62 | - uint64_t loop4_src_stride, | ||
| 63 | - bool smallc0_en) | ||
| 64 | ``` | 56 | ``` |
| 65 | 57 | ||
| 66 | ### dtype支持的数据类型 | 58 | ### dtype支持的数据类型 |
Mdocs/zh/api/SIMD-API/c_api/cube_datamove/asc_copy_gm2l1_nd2nz/asc_copy_gm2l1_nd2nz_arch_2201.md+0-29
| @@ -61,35 +61,6 @@ | |||
| 61 | uint16_t dst_nz_n_stride, uint16_t dst_nz_matrix_stride) | 61 | uint16_t dst_nz_n_stride, uint16_t dst_nz_matrix_stride) |
| 62 | ``` | 62 | ``` |
| 63 | 63 | ||
| 64 | -- 同步搬运 | ||
| 65 | - | ||
| 66 | - ```cpp | ||
| 67 | - __aicore__ inline void asc_copy_gm2l1_nd2nz_sync(__cbuf__ int8_t* dst, __gm__ int8_t* src, uint16_t nd_num, | ||
| 68 | - uint16_t n_value, uint16_t d_value, uint16_t src_nd_matrix_stride, uint16_t src_d_value, uint16_t dst_nz_c0_stride, | ||
| 69 | - uint16_t dst_nz_n_stride, uint16_t dst_nz_matrix_stride) | ||
| 70 | - __aicore__ inline void asc_copy_gm2l1_nd2nz_sync(__cbuf__ uint8_t* dst, __gm__ uint8_t* src, uint16_t nd_num, | ||
| 71 | - uint16_t n_value, uint16_t d_value, uint16_t src_nd_matrix_stride, uint16_t src_d_value, uint16_t dst_nz_c0_stride, | ||
| 72 | - uint16_t dst_nz_n_stride, uint16_t dst_nz_matrix_stride) | ||
| 73 | - __aicore__ inline void asc_copy_gm2l1_nd2nz_sync(__cbuf__ bfloat16_t* dst, __gm__ bfloat16_t* src, uint16_t nd_num, | ||
| 74 | - uint16_t n_value, uint16_t d_value, uint16_t src_nd_matrix_stride, uint16_t src_d_value, uint16_t dst_nz_c0_stride, | ||
| 75 | - uint16_t dst_nz_n_stride, uint16_t dst_nz_matrix_stride) | ||
| 76 | - __aicore__ inline void asc_copy_gm2l1_nd2nz_sync(__cbuf__ half* dst, __gm__ half* src, uint16_t nd_num, | ||
| 77 | - uint16_t n_value, uint16_t d_value, uint16_t src_nd_matrix_stride, uint16_t src_d_value, uint16_t dst_nz_c0_stride, | ||
| 78 | - uint16_t dst_nz_n_stride, uint16_t dst_nz_matrix_stride) | ||
| 79 | - __aicore__ inline void asc_copy_gm2l1_nd2nz_sync(__cbuf__ int16_t* dst, __gm__ int16_t* src, uint16_t nd_num, | ||
| 80 | - uint16_t n_value, uint16_t d_value, uint16_t src_nd_matrix_stride, uint16_t src_d_value, uint16_t dst_nz_c0_stride, | ||
| 81 | - uint16_t dst_nz_n_stride, uint16_t dst_nz_matrix_stride) | ||
| 82 | - __aicore__ inline void asc_copy_gm2l1_nd2nz_sync(__cbuf__ float* dst, __gm__ float* src, uint16_t nd_num, | ||
| 83 | - uint16_t n_value, uint16_t d_value, uint16_t src_nd_matrix_stride, uint16_t src_d_value, uint16_t dst_nz_c0_stride, | ||
| 84 | - uint16_t dst_nz_n_stride, uint16_t dst_nz_matrix_stride) | ||
| 85 | - __aicore__ inline void asc_copy_gm2l1_nd2nz_sync(__cbuf__ int32_t* dst, __gm__ int32_t* src, uint16_t nd_num, | ||
| 86 | - uint16_t n_value, uint16_t d_value, uint16_t src_nd_matrix_stride, uint16_t src_d_value, uint16_t dst_nz_c0_stride, | ||
| 87 | - uint16_t dst_nz_n_stride, uint16_t dst_nz_matrix_stride) | ||
| 88 | - __aicore__ inline void asc_copy_gm2l1_nd2nz_sync(__cbuf__ uint32_t* dst, __gm__ uint32_t* src, uint16_t nd_num, | ||
| 89 | - uint16_t n_value, uint16_t d_value, uint16_t src_nd_matrix_stride, uint16_t src_d_value, uint16_t dst_nz_c0_stride, | ||
| 90 | - uint16_t dst_nz_n_stride, uint16_t dst_nz_matrix_stride) | ||
| 91 | - ``` | ||
| 92 | - | ||
| 93 | ## 参数说明 | 64 | ## 参数说明 |
| 94 | 65 | ||
| 95 | 66 | ||
Mdocs/zh/api/SIMD-API/c_api/cube_datamove/asc_copy_gm2l1_nd2nz/asc_copy_gm2l1_nd2nz_arch_3510.md+0-16
| @@ -51,14 +51,6 @@ __aicore__ inline void asc_copy_gm2l1_nd2nz(__cbuf__ <dtype>* dst, | |||
| 51 | uint32_t d_value, | 51 | uint32_t d_value, |
| 52 | uint64_t loop4_src_stride, | 52 | uint64_t loop4_src_stride, |
| 53 | bool enable_small_c0) | 53 | bool enable_small_c0) |
| 54 | -__aicore__ inline void asc_copy_gm2l1_nd2nz_sync(__cbuf__ <dtype>* dst, | ||
| 55 | - __gm__ <dtype>* src, | ||
| 56 | - uint64_t loop1_src_stride, | ||
| 57 | - uint8_t l2_cache_ctl, | ||
| 58 | - uint16_t n_value, | ||
| 59 | - uint32_t d_value, | ||
| 60 | - uint64_t loop4_src_stride, | ||
| 61 | - bool enable_small_c0) | ||
| 62 | ``` | 54 | ``` |
| 63 | 55 | ||
| 64 | ### dtype支持的数据类型 | 56 | ### dtype支持的数据类型 |
| @@ -77,14 +69,6 @@ __aicore__ inline void asc_copy_gm2l1_nd2nz(__cbuf__ half* dst, | |||
| 77 | uint32_t d_value, | 69 | uint32_t d_value, |
| 78 | uint64_t loop4_src_stride, | 70 | uint64_t loop4_src_stride, |
| 79 | bool enable_small_c0) | 71 | bool enable_small_c0) |
| 80 | -__aicore__ inline void asc_copy_gm2l1_nd2nz_sync(__cbuf__ <dtype>* dst, | ||
| 81 | - __gm__ <dtype>* src, | ||
| 82 | - uint64_t loop1_src_stride, | ||
| 83 | - uint8_t l2_cache_ctl, | ||
| 84 | - uint16_t n_value, | ||
| 85 | - uint32_t d_value, | ||
| 86 | - uint64_t loop4_src_stride, | ||
| 87 | - bool smallc0_en) | ||
| 88 | ``` | 72 | ``` |
| 89 | 73 | ||
| 90 | ## 参数说明 | 74 | ## 参数说明 |
| @@ -55,20 +55,6 @@ | |||
| 55 | __aicore__ inline void asc_copy_l0c2gm(__gm__ int32_t* dst, __cc__ int32_t* src, uint16_t n_size, uint16_t m_size, uint32_t dst_stride_dst_d, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool channel_split, bool nz2nd_en) | 55 | __aicore__ inline void asc_copy_l0c2gm(__gm__ int32_t* dst, __cc__ int32_t* src, uint16_t n_size, uint16_t m_size, uint32_t dst_stride_dst_d, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool channel_split, bool nz2nd_en) |
| 56 | ``` | 56 | ``` |
| 57 | 57 | ||
| 58 | -- 同步搬运 | ||
| 59 | - | ||
| 60 | - ```cpp | ||
| 61 | - __aicore__ inline void asc_copy_l0c2gm_sync(__gm__ half* dst, __cc__ float* src, uint16_t n_size, uint16_t m_size, uint32_t dst_stride_dst_d, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool channel_split, bool nz2nd_en) | ||
| 62 | - __aicore__ inline void asc_copy_l0c2gm_sync(__gm__ bfloat16_t* dst, __cc__ float* src, uint16_t n_size, uint16_t m_size, uint32_t dst_stride_dst_d, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool channel_split, bool nz2nd_en) | ||
| 63 | - __aicore__ inline void asc_copy_l0c2gm_sync(__gm__ int8_t* dst, __cc__ float* src, uint16_t n_size, uint16_t m_size, uint32_t dst_stride_dst_d, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool channel_split, bool nz2nd_en) | ||
| 64 | - __aicore__ inline void asc_copy_l0c2gm_sync(__gm__ uint8_t* dst, __cc__ float* src, uint16_t n_size, uint16_t m_size, uint32_t dst_stride_dst_d, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool channel_split, bool nz2nd_en) | ||
| 65 | - __aicore__ inline void asc_copy_l0c2gm_sync(__gm__ float* dst, __cc__ float* src, uint16_t n_size, uint16_t m_size, uint32_t dst_stride_dst_d, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool channel_split, bool nz2nd_en) | ||
| 66 | - __aicore__ inline void asc_copy_l0c2gm_sync(__gm__ half* dst, __cc__ int32_t* src, uint16_t n_size, uint16_t m_size, uint32_t dst_stride_dst_d, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool channel_split, bool nz2nd_en) | ||
| 67 | - __aicore__ inline void asc_copy_l0c2gm_sync(__gm__ int16_t* dst, __cc__ int32_t* src, uint16_t n_size, uint16_t m_size, uint32_t dst_stride_dst_d, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool channel_split, bool nz2nd_en) | ||
| 68 | - __aicore__ inline void asc_copy_l0c2gm_sync(__gm__ int8_t* dst, __cc__ int32_t* src, uint16_t n_size, uint16_t m_size, uint32_t dst_stride_dst_d, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool channel_split, bool nz2nd_en) | ||
| 69 | - __aicore__ inline void asc_copy_l0c2gm_sync(__gm__ int32_t* dst, __cc__ int32_t* src, uint16_t n_size, uint16_t m_size, uint32_t dst_stride_dst_d, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool channel_split, bool nz2nd_en) | ||
| 70 | - ``` | ||
| 71 | - | ||
| 72 | ## 参数说明 | 58 | ## 参数说明 |
| 73 | 59 | ||
| 74 | **表1** 参数说明 | 60 | **表1** 参数说明 |
| @@ -118,5 +104,6 @@ uint8_t relu_pre = 0; | |||
| 118 | bool channel_split = false; | 104 | bool channel_split = false; |
| 119 | bool nz2nd_en = false; | 105 | bool nz2nd_en = false; |
| 120 | // 函数调用 | 106 | // 函数调用 |
| 121 | -asc_copy_l0c2gm_sync(dst, src, n_size, m_size, dst_stride_dst_d, src_stride, unit_flag_mode, quant_pre, relu_pre, channel_split, nz2nd_en); | 107 | +asc_copy_l0c2gm(dst, src, n_size, m_size, dst_stride_dst_d, src_stride, unit_flag_mode, quant_pre, relu_pre, channel_split, nz2nd_en); |
| 108 | +asc_sync(); | ||
| 122 | ``` | 109 | ``` |
| @@ -100,36 +100,12 @@ __aicore__ inline void asc_copy_l0c2gm(__gm__ <dst_dtype>* dst, | |||
| 100 | bool c0_pad_en, | 100 | bool c0_pad_en, |
| 101 | bool broadcast_en, | 101 | bool broadcast_en, |
| 102 | bool enable_nz2dn) | 102 | bool enable_nz2dn) |
| 103 | -__aicore__ inline void asc_copy_l0c2gm_sync(__gm__ <dst_dtype>* dst, | ||
| 104 | - __cc__ <src_dtype>* src, | ||
| 105 | - uint16_t n_size, | ||
| 106 | - uint16_t m_size, | ||
| 107 | - uint32_t dst_stride, | ||
| 108 | - uint16_t src_stride, | ||
| 109 | - uint8_t l2_cache_mode, | ||
| 110 | - uint8_t enable_clip_relu_pre, | ||
| 111 | - uint8_t unit_flag_mode, | ||
| 112 | - uint64_t quant_pre_mode, | ||
| 113 | - uint8_t relu_pre_mode, | ||
| 114 | - bool enable_channel_split, | ||
| 115 | - bool enable_nz2nd, | ||
| 116 | - uint64_t quant_post, | ||
| 117 | - uint8_t relu_post, | ||
| 118 | - bool clip_relu_post, | ||
| 119 | - uint8_t eltwise_op, | ||
| 120 | - bool eltwise_antq_en, | ||
| 121 | - bool c0_pad_en, | ||
| 122 | - bool broadcast_en, | ||
| 123 | - bool enable_nz2dn) | ||
| 124 | ``` | 103 | ``` |
| 125 | 104 | ||
| 126 | ### dtype支持的数据类型 | 105 | ### dtype支持的数据类型 |
| 127 | 106 | ||
| 128 | src dtype与dst dtype支持以下组合: | 107 | src dtype与dst dtype支持以下组合: |
| 129 | 108 | ||
| 130 | -- `src_dtype`为`int32_t`时,`dst_dtype`支持`int4b_t`、`int8_t`、`uint8_t`、`half`、`bfloat16_t`、`int32_t`。 | ||
| 131 | -- `src_dtype`为`float`时,`dst_dtype`支持`int4b_t`、`int8_t`、`uint8_t`、`hifloat8_t`、`fp8_e4m3fn_t`、`half`、`bfloat16_t`、`float`。 | ||
| 132 | - | ||
| 133 | ### 函数原型典型示例 | 109 | ### 函数原型典型示例 |
| 134 | 110 | ||
| 135 | ```c | 111 | ```c |
| @@ -56,19 +56,6 @@ | |||
| 56 | __aicore__ inline void asc_copy_l0c2l1(__cbuf__ void* dst, __cc__ float* src, uint16_t n_size,uint16_t m_size, uint32_t dst_stride, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool enable_channel_split, bool enable_nz2nd) | 56 | __aicore__ inline void asc_copy_l0c2l1(__cbuf__ void* dst, __cc__ float* src, uint16_t n_size,uint16_t m_size, uint32_t dst_stride, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool enable_channel_split, bool enable_nz2nd) |
| 57 | __aicore__ inline void asc_copy_l0c2l1(__cbuf__ void* dst, __cc__ int32_t* src, uint16_t n_size,uint16_t m_size, uint32_t dst_stride, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool enable_channel_split, bool enable_nz2nd) | 57 | __aicore__ inline void asc_copy_l0c2l1(__cbuf__ void* dst, __cc__ int32_t* src, uint16_t n_size,uint16_t m_size, uint32_t dst_stride, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool enable_channel_split, bool enable_nz2nd) |
| 58 | ``` | 58 | ``` |
| 59 | -- 同步搬运 | ||
| 60 | - | ||
| 61 | - ```cpp | ||
| 62 | - __aicore__ inline void asc_copy_l0c2l1_sync(__cbuf__ half* dst, __cc__ float* src, uint16_t n_size,uint16_t m_size, uint32_t dst_stride, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool enable_channel_split, bool enable_nz2nd) | ||
| 63 | - __aicore__ inline void asc_copy_l0c2l1_sync(__cbuf__ bfloat16_t* dst, __cc__ float* src, uint16_t n_size,uint16_t m_size, uint32_t dst_stride, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool enable_channel_split, bool enable_nz2nd) | ||
| 64 | - __aicore__ inline void asc_copy_l0c2l1_sync(__cbuf__ int8_t* dst, __cc__ float* src, uint16_t n_size,uint16_t m_size, uint32_t dst_stride, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool enable_channel_split, bool enable_nz2nd) | ||
| 65 | - __aicore__ inline void asc_copy_l0c2l1_sync(__cbuf__ half* dst, __cc__ int32_t* src, uint16_t n_size,uint16_t m_size, uint32_t dst_stride, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool enable_channel_split, bool enable_nz2nd) | ||
| 66 | - __aicore__ inline void asc_copy_l0c2l1_sync(__cbuf__ int16_t* dst, __cc__ int32_t* src, uint16_t n_size,uint16_t m_size, uint32_t dst_stride, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool enable_channel_split, bool enable_nz2nd) | ||
| 67 | - __aicore__ inline void asc_copy_l0c2l1_sync(__cbuf__ int8_t* dst, __cc__ int32_t* src, uint16_t n_size,uint16_t m_size, uint32_t dst_stride, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool enable_channel_split, bool enable_nz2nd) | ||
| 68 | - __aicore__ inline void asc_copy_l0c2l1_sync(__cbuf__ uint8_t* dst, __cc__ int32_t* src, uint16_t n_size,uint16_t m_size, uint32_t dst_stride, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool enable_channel_split, bool enable_nz2nd) | ||
| 69 | - __aicore__ inline void asc_copy_l0c2l1_sync(__cbuf__ void* dst, __cc__ float* src, uint16_t n_size,uint16_t m_size, uint32_t dst_stride, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool enable_channel_split, bool enable_nz2nd) | ||
| 70 | - __aicore__ inline void asc_copy_l0c2l1_sync(__cbuf__ void* dst, __cc__ int32_t* src, uint16_t n_size,uint16_t m_size, uint32_t dst_stride, uint16_t src_stride, uint8_t unit_flag_mode, uint64_t quant_pre, uint8_t relu_pre, bool enable_channel_split, bool enable_nz2nd) | ||
| 71 | - ``` | ||
| 72 | 59 | ||
| 73 | ## 参数说明 | 60 | ## 参数说明 |
| 74 | 61 | ||
| @@ -119,33 +119,12 @@ __aicore__ inline void asc_copy_l0c2l1(__cbuf__ int4b_t* dst, | |||
| 119 | bool c0_pad_en, | 119 | bool c0_pad_en, |
| 120 | bool broadcast_en, | 120 | bool broadcast_en, |
| 121 | bool enable_nz2dn) | 121 | bool enable_nz2dn) |
| 122 | -__aicore__ inline void asc_copy_l0c2l1_sync(__cbuf__ int4b_t* dst, | ||
| 123 | - __cc__ <src_dtype>* src, | ||
| 124 | - uint16_t n_size, | ||
| 125 | - uint16_t m_size, | ||
| 126 | - uint32_t dst_stride, | ||
| 127 | - uint16_t src_stride, | ||
| 128 | - uint8_t l2_cache_mode, | ||
| 129 | - uint8_t enable_clip_relu_pre, | ||
| 130 | - uint8_t unit_flag_mode, | ||
| 131 | - uint64_t quant_pre_mode, | ||
| 132 | - uint8_t relu_pre_mode, | ||
| 133 | - bool enable_channel_split, | ||
| 134 | - bool enable_nz2nd, | ||
| 135 | - uint64_t quant_post, | ||
| 136 | - uint8_t relu_post, | ||
| 137 | - bool clip_relu_post, | ||
| 138 | - uint8_t eltwise_op, | ||
| 139 | - bool eltwise_antq_en, | ||
| 140 | - bool c0_pad_en, | ||
| 141 | - bool broadcast_en, | ||
| 142 | - bool enable_nz2dn) | ||
| 143 | ``` | 122 | ``` |
| 144 | 123 | ||
| 145 | ### dtype支持的数据类型 | 124 | ### dtype支持的数据类型 |
| 146 | 125 | ||
| 147 | - 普通原型中,`src_dtype`为`int32_t`时,`dst_dtype`支持`half`、`int8_t`、`uint8_t`、`int32_t`;`src_dtype`为`float`时,`dst_dtype`支持`half`、`bfloat16_t`、`int8_t`、`uint8_t`、`float`。 | 126 | - 普通原型中,`src_dtype`为`int32_t`时,`dst_dtype`支持`half`、`int8_t`、`uint8_t`、`int32_t`;`src_dtype`为`float`时,`dst_dtype`支持`half`、`bfloat16_t`、`int8_t`、`uint8_t`、`float`。 |
| 148 | -- 带`l2_cache_mode`及同步版本的原型中,`dst_dtype`为`int4b_t`,`src_dtype`支持`int32_t`、`float`。 | 127 | +- 带`l2_cache_mode`的原型中,`dst_dtype`为`int4b_t`,`src_dtype`支持`int32_t`、`float`。 |
| 149 | 128 | ||
| 150 | ### 函数原型典型示例 | 129 | ### 函数原型典型示例 |
| 151 | 130 | ||
| @@ -103,28 +103,6 @@ __aicore__ inline void asc_copy_l0c2ub(__ubuf__ <dst_dtype>* dst, | |||
| 103 | bool c0_pad_en, | 103 | bool c0_pad_en, |
| 104 | bool broadcast_en, | 104 | bool broadcast_en, |
| 105 | bool enable_nz2dn) | 105 | bool enable_nz2dn) |
| 106 | -__aicore__ inline void asc_copy_l0c2ub_sync(__ubuf__ <dst_dtype>* dst, | ||
| 107 | - __cc__ <src_dtype>* src, | ||
| 108 | - uint16_t n_size, | ||
| 109 | - uint16_t m_size, | ||
| 110 | - uint32_t dst_stride, | ||
| 111 | - uint16_t src_stride, | ||
| 112 | - uint8_t dual_dst_ctrl, | ||
| 113 | - bool sub_blockid, | ||
| 114 | - uint8_t enable_clip_relu_pre, | ||
| 115 | - uint8_t unit_flag_mode, | ||
| 116 | - uint64_t quant_pre_mode, | ||
| 117 | - uint8_t relu_pre_mode, | ||
| 118 | - bool enable_channel_split, | ||
| 119 | - bool enable_nz2nd, | ||
| 120 | - uint64_t quant_post, | ||
| 121 | - uint8_t relu_post, | ||
| 122 | - bool clip_relu_post, | ||
| 123 | - uint8_t eltwise_op, | ||
| 124 | - bool eltwise_antq_en, | ||
| 125 | - bool c0_pad_en, | ||
| 126 | - bool broadcast_en, | ||
| 127 | - bool enable_nz2dn) | ||
| 128 | ``` | 106 | ``` |
| 129 | 107 | ||
| 130 | ### dtype支持的数据类型 | 108 | ### dtype支持的数据类型 |
| @@ -42,11 +42,6 @@ | |||
| 42 | __aicore__ inline void asc_copy_l12bt(uint64_t dst, __cbuf__ void* src, uint16_t conv_control, uint16_t n_burst, uint16_t len_burst, uint16_t source_gap, uint16_t dst_gap) | 42 | __aicore__ inline void asc_copy_l12bt(uint64_t dst, __cbuf__ void* src, uint16_t conv_control, uint16_t n_burst, uint16_t len_burst, uint16_t source_gap, uint16_t dst_gap) |
| 43 | ``` | 43 | ``` |
| 44 | 44 | ||
| 45 | -- 同步搬运 | ||
| 46 | - ```cpp | ||
| 47 | - __aicore__ inline void asc_copy_l12bt_sync(uint64_t dst, __cbuf__ void* src, uint32_t size) | ||
| 48 | - ``` | ||
| 49 | - | ||
| 50 | ## 参数说明 | 45 | ## 参数说明 |
| 51 | 46 | ||
| 52 | **表1** 参数说明 | 47 | **表1** 参数说明 |
| @@ -76,9 +76,6 @@ __aicore__ inline void asc_copy_l12bt(uint64_t dst, | |||
| 76 | __aicore__ inline void asc_copy_l12bt(uint64_t dst, | 76 | __aicore__ inline void asc_copy_l12bt(uint64_t dst, |
| 77 | __cbuf__ <dtype>* src, | 77 | __cbuf__ <dtype>* src, |
| 78 | uint32_t size) | 78 | uint32_t size) |
| 79 | -__aicore__ inline void asc_copy_l12bt_sync(uint64_t dst, | ||
| 80 | - __cbuf__ <dtype>* src, | ||
| 81 | - uint32_t size) | ||
| 82 | ``` | 79 | ``` |
| 83 | 80 | ||
| 84 | #### dtype支持的数据类型 | 81 | #### dtype支持的数据类型 |
| @@ -42,11 +42,6 @@ | |||
| 42 | __aicore__ inline void asc_copy_l12fb(__fbuf__ void* dst, __cbuf__ void* src, uint16_t n_burst, uint16_t len_burst, uint16_t src_gap_size, uint16_t dst_gap_size) | 42 | __aicore__ inline void asc_copy_l12fb(__fbuf__ void* dst, __cbuf__ void* src, uint16_t n_burst, uint16_t len_burst, uint16_t src_gap_size, uint16_t dst_gap_size) |
| 43 | ``` | 43 | ``` |
| 44 | 44 | ||
| 45 | -- 同步搬运 | ||
| 46 | - ```cpp | ||
| 47 | - __aicore__ inline void asc_copy_l12fb_sync(__fbuf__ void* dst, __cbuf__ void* src, uint32_t size) | ||
| 48 | - ``` | ||
| 49 | - | ||
| 50 | ## 参数说明 | 45 | ## 参数说明 |
| 51 | 46 | ||
| 52 | **表1** 参数说明 | 47 | **表1** 参数说明 |
| @@ -56,12 +56,6 @@ | |||
| 56 | __aicore__ inline void asc_copy_l12fb(__fbuf__ void* dst, __cbuf__ void* src, uint32_t size) | 56 | __aicore__ inline void asc_copy_l12fb(__fbuf__ void* dst, __cbuf__ void* src, uint32_t size) |
| 57 | ``` | 57 | ``` |
| 58 | 58 | ||
| 59 | -- 同步搬运 | ||
| 60 | - | ||
| 61 | - ```c | ||
| 62 | - __aicore__ inline void asc_copy_l12fb_sync(__fbuf__ void* dst, __cbuf__ void* src, uint32_t size) | ||
| 63 | - ``` | ||
| 64 | - | ||
| 65 | ## 参数说明 | 59 | ## 参数说明 |
| 66 | 60 | ||
| 67 | **表1** 参数说明 | 61 | **表1** 参数说明 |
| @@ -37,11 +37,6 @@ | |||
| 37 | ```cpp | 37 | ```cpp |
| 38 | __aicore__ inline void asc_copy_l12gm(__gm__ void* dst, __cbuf__ void* src, uint16_t n_burst, uint16_t len_burst, uint16_t src_gap, uint16_t dst_gap) | 38 | __aicore__ inline void asc_copy_l12gm(__gm__ void* dst, __cbuf__ void* src, uint16_t n_burst, uint16_t len_burst, uint16_t src_gap, uint16_t dst_gap) |
| 39 | ``` | 39 | ``` |
| 40 | -- 同步搬运 | ||
| 41 | - | ||
| 42 | - ```cpp | ||
| 43 | - __aicore__ inline void asc_copy_l12gm_sync(__gm__ void* dst, __cbuf__ void* src, uint16_t n_burst, uint16_t len_burst, uint16_t src_gap, uint16_t dst_gap) | ||
| 44 | - ``` | ||
| 45 | 40 | ||
| 46 | ## 参数说明 | 41 | ## 参数说明 |
| 47 | 42 | ||
| @@ -52,14 +52,6 @@ __aicore__ inline void asc_copy_l12l0a(__ca__ <dtype>* dst, | |||
| 52 | uint8_t k_step, | 52 | uint8_t k_step, |
| 53 | int16_t src_stride, | 53 | int16_t src_stride, |
| 54 | uint16_t dst_stride) | 54 | uint16_t dst_stride) |
| 55 | -__aicore__ inline void asc_copy_l12l0a_sync(__ca__ <dtype>* dst, | ||
| 56 | - __cbuf__ <dtype>* src, | ||
| 57 | - uint16_t m_start_position, | ||
| 58 | - uint16_t k_start_position, | ||
| 59 | - uint8_t m_step, | ||
| 60 | - uint8_t k_step, | ||
| 61 | - int16_t src_stride, | ||
| 62 | - uint16_t dst_stride) | ||
| 63 | ``` | 55 | ``` |
| 64 | 56 | ||
| 65 | ### dtype支持的数据类型 | 57 | ### dtype支持的数据类型 |
| @@ -91,14 +83,6 @@ __aicore__ inline void asc_copy_l12l0a_transpose(__ca__ <dtype>* dst, | |||
| 91 | uint8_t k_step, | 83 | uint8_t k_step, |
| 92 | int16_t src_stride, | 84 | int16_t src_stride, |
| 93 | uint16_t dst_stride) | 85 | uint16_t dst_stride) |
| 94 | -__aicore__ inline void asc_copy_l12l0a_transpose_sync(__ca__ <dtype>* dst, | ||
| 95 | - __cbuf__ <dtype>* src, | ||
| 96 | - uint16_t m_start_position, | ||
| 97 | - uint16_t k_start_position, | ||
| 98 | - uint8_t m_step, | ||
| 99 | - uint8_t k_step, | ||
| 100 | - int16_t src_stride, | ||
| 101 | - uint16_t dst_stride) | ||
| 102 | ``` | 86 | ``` |
| 103 | 87 | ||
| 104 | ### dtype支持的数据类型 | 88 | ### dtype支持的数据类型 |
| @@ -62,23 +62,6 @@ __aicore__ inline void asc_copy_l12l0a(__ca__ <dtype>* dst, | |||
| 62 | bool transpose, | 62 | bool transpose, |
| 63 | bool f_matrix_ctrl, | 63 | bool f_matrix_ctrl, |
| 64 | uint16_t channel_size) | 64 | uint16_t channel_size) |
| 65 | -__aicore__ inline void asc_copy_l12l0a_sync(__ca__ <dtype>* dst, | ||
| 66 | - __cbuf__ <dtype>* src, | ||
| 67 | - uint16_t k_extension, | ||
| 68 | - uint16_t m_extension, | ||
| 69 | - uint16_t k_start_pt, | ||
| 70 | - uint16_t m_start_pt, | ||
| 71 | - uint8_t stride_w, | ||
| 72 | - uint8_t stride_h, | ||
| 73 | - uint8_t filter_w, | ||
| 74 | - uint8_t filter_h, | ||
| 75 | - uint8_t dilation_filter_w, | ||
| 76 | - uint8_t dilation_filter_h, | ||
| 77 | - bool filter_size_w, | ||
| 78 | - bool filter_size_h, | ||
| 79 | - bool transpose, | ||
| 80 | - bool f_matrix_ctrl, | ||
| 81 | - uint16_t channel_size) | ||
| 82 | ``` | 65 | ``` |
| 83 | 66 | ||
| 84 | #### dtype支持的数据类型 | 67 | #### dtype支持的数据类型 |
| @@ -44,19 +44,6 @@ | |||
| 44 | __aicore__ inline void asc_copy_l12l0a(__ca__ float* dst, __cbuf__ float* src, uint16_t start_index, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | 44 | __aicore__ inline void asc_copy_l12l0a(__ca__ float* dst, __cbuf__ float* src, uint16_t start_index, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) |
| 45 | ``` | 45 | ``` |
| 46 | 46 | ||
| 47 | -- 同步高维切分搬运2D格式 | ||
| 48 | - | ||
| 49 | - ```cpp | ||
| 50 | - __aicore__ inline void asc_copy_l12l0a_sync(__ca__ int4b_t* dst, __cbuf__ int4b_t* src, uint16_t start_index, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 51 | - __aicore__ inline void asc_copy_l12l0a_sync(__ca__ uint8_t* dst, __cbuf__ uint8_t* src, uint16_t start_index, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 52 | - __aicore__ inline void asc_copy_l12l0a_sync(__ca__ int8_t* dst, __cbuf__ int8_t* src, uint16_t start_index, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 53 | - __aicore__ inline void asc_copy_l12l0a_sync(__ca__ half* dst, __cbuf__ half* src, uint16_t start_index, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 54 | - __aicore__ inline void asc_copy_l12l0a_sync(__ca__ bfloat16_t* dst, __cbuf__ bfloat16_t* src, uint16_t start_index, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 55 | - __aicore__ inline void asc_copy_l12l0a_sync(__ca__ uint32_t* dst, __cbuf__ uint32_t* src, uint16_t start_index, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 56 | - __aicore__ inline void asc_copy_l12l0a_sync(__ca__ int32_t* dst, __cbuf__ int32_t* src, uint16_t start_index, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 57 | - __aicore__ inline void asc_copy_l12l0a_sync(__ca__ float* dst, __cbuf__ float* src, uint16_t start_index, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 58 | - ``` | ||
| 59 | - | ||
| 60 | - 高维切分搬运3D格式 | 47 | - 高维切分搬运3D格式 |
| 61 | 48 | ||
| 62 | ```cpp | 49 | ```cpp |
| @@ -70,19 +57,6 @@ | |||
| 70 | __aicore__ inline void asc_copy_l12l0a(__ca__ float* dst, __cbuf__ float* src, uint16_t k_extension, uint16_t m_extension, uint16_t k_start_pt, uint16_t m_start_pt, uint8_t stride_w, uint8_t stride_h, uint8_t filter_w, uint8_t filter_h, uint8_t dilation_filter_w, uint8_t dilation_filter_h, bool filter_size_w, bool filter_size_h, bool transpose, bool f_matrix_ctrl, uint16_t channel_size) | 57 | __aicore__ inline void asc_copy_l12l0a(__ca__ float* dst, __cbuf__ float* src, uint16_t k_extension, uint16_t m_extension, uint16_t k_start_pt, uint16_t m_start_pt, uint8_t stride_w, uint8_t stride_h, uint8_t filter_w, uint8_t filter_h, uint8_t dilation_filter_w, uint8_t dilation_filter_h, bool filter_size_w, bool filter_size_h, bool transpose, bool f_matrix_ctrl, uint16_t channel_size) |
| 71 | ``` | 58 | ``` |
| 72 | 59 | ||
| 73 | -- 同步高维切分搬运3D格式 | ||
| 74 | - | ||
| 75 | - ```cpp | ||
| 76 | - __aicore__ inline void asc_copy_l12l0a_sync(__ca__ int4b_t* dst, __cbuf__ int4b_t* src, uint16_t k_extension, uint16_t m_extension, uint16_t k_start_pt, uint16_t m_start_pt, uint8_t stride_w, uint8_t stride_h, uint8_t filter_w, uint8_t filter_h, uint8_t dilation_filter_w, uint8_t dilation_filter_h, bool filter_size_w, bool filter_size_h, bool transpose, bool f_matrix_ctrl, uint16_t channel_size) | ||
| 77 | - __aicore__ inline void asc_copy_l12l0a_sync(__ca__ uint8_t* dst, __cbuf__ uint8_t* src, uint16_t k_extension, uint16_t m_extension, uint16_t k_start_pt, uint16_t m_start_pt, uint8_t stride_w, uint8_t stride_h, uint8_t filter_w, uint8_t filter_h, uint8_t dilation_filter_w, uint8_t dilation_filter_h, bool filter_size_w, bool filter_size_h, bool transpose, bool f_matrix_ctrl, uint16_t channel_size) | ||
| 78 | - __aicore__ inline void asc_copy_l12l0a_sync(__ca__ int8_t* dst, __cbuf__ int8_t* src, uint16_t k_extension, uint16_t m_extension, uint16_t k_start_pt, uint16_t m_start_pt, uint8_t stride_w, uint8_t stride_h, uint8_t filter_w, uint8_t filter_h, uint8_t dilation_filter_w, uint8_t dilation_filter_h, bool filter_size_w, bool filter_size_h, bool transpose, bool f_matrix_ctrl, uint16_t channel_size) | ||
| 79 | - __aicore__ inline void asc_copy_l12l0a_sync(__ca__ half* dst, __cbuf__ half* src, uint16_t k_extension, uint16_t m_extension, uint16_t k_start_pt, uint16_t m_start_pt, uint8_t stride_w, uint8_t stride_h, uint8_t filter_w, uint8_t filter_h, uint8_t dilation_filter_w, uint8_t dilation_filter_h, bool filter_size_w, bool filter_size_h, bool transpose, bool f_matrix_ctrl, uint16_t channel_size) | ||
| 80 | - __aicore__ inline void asc_copy_l12l0a_sync(__ca__ bfloat16_t* dst, __cbuf__ bfloat16_t* src, uint16_t k_extension, uint16_t m_extension, uint16_t k_start_pt, uint16_t m_start_pt, uint8_t stride_w, uint8_t stride_h, uint8_t filter_w, uint8_t filter_h, uint8_t dilation_filter_w, uint8_t dilation_filter_h, bool filter_size_w, bool filter_size_h, bool transpose, bool f_matrix_ctrl, uint16_t channel_size) | ||
| 81 | - __aicore__ inline void asc_copy_l12l0a_sync(__ca__ uint32_t* dst, __cbuf__ uint32_t* src, uint16_t k_extension, uint16_t m_extension, uint16_t k_start_pt, uint16_t m_start_pt, uint8_t stride_w, uint8_t stride_h, uint8_t filter_w, uint8_t filter_h, uint8_t dilation_filter_w, uint8_t dilation_filter_h, bool filter_size_w, bool filter_size_h, bool transpose, bool f_matrix_ctrl, uint16_t channel_size) | ||
| 82 | - __aicore__ inline void asc_copy_l12l0a_sync(__ca__ int32_t* dst, __cbuf__ int32_t* src, uint16_t k_extension, uint16_t m_extension, uint16_t k_start_pt, uint16_t m_start_pt, uint8_t stride_w, uint8_t stride_h, uint8_t filter_w, uint8_t filter_h, uint8_t dilation_filter_w, uint8_t dilation_filter_h, bool filter_size_w, bool filter_size_h, bool transpose, bool f_matrix_ctrl, uint16_t channel_size) | ||
| 83 | - __aicore__ inline void asc_copy_l12l0a_sync(__ca__ float* dst, __cbuf__ float* src, uint16_t k_extension, uint16_t m_extension, uint16_t k_start_pt, uint16_t m_start_pt, uint8_t stride_w, uint8_t stride_h, uint8_t filter_w, uint8_t filter_h, uint8_t dilation_filter_w, uint8_t dilation_filter_h, bool filter_size_w, bool filter_size_h, bool transpose, bool f_matrix_ctrl, uint16_t channel_size) | ||
| 84 | - ``` | ||
| 85 | - | ||
| 86 | ## 参数说明 | 60 | ## 参数说明 |
| 87 | 61 | ||
| 88 | **表1** 2D格式参数说明 | 62 | **表1** 2D格式参数说明 |
| @@ -51,15 +51,6 @@ __aicore__ inline void asc_copy_l12l0a_mx(uint64_t dst, | |||
| 51 | uint8_t y_step, | 51 | uint8_t y_step, |
| 52 | uint16_t src_stride, | 52 | uint16_t src_stride, |
| 53 | uint16_t dst_stride) | 53 | uint16_t dst_stride) |
| 54 | - | ||
| 55 | -__aicore__ inline void asc_copy_l12l0a_mx_sync(uint64_t dst, | ||
| 56 | - __cbuf__ fp8_e8m0_t* src, | ||
| 57 | - uint16_t x_start_pos, | ||
| 58 | - uint16_t y_start_pos, | ||
| 59 | - uint8_t x_step, | ||
| 60 | - uint8_t y_step, | ||
| 61 | - uint16_t src_stride, | ||
| 62 | - uint16_t dst_stride) | ||
| 63 | ``` | 54 | ``` |
| 64 | 55 | ||
| 65 | ## 参数说明 | 56 | ## 参数说明 |
| @@ -75,7 +75,6 @@ | |||
| 75 | 75 | ||
| 76 |  | 76 |  |
| 77 | 77 | ||
| 78 | - | ||
| 79 | ## 函数原型 | 78 | ## 函数原型 |
| 80 | 79 | ||
| 81 | - 高维切分搬运 | 80 | - 高维切分搬运 |
| @@ -90,18 +89,6 @@ | |||
| 90 | __aicore__ inline void asc_copy_l12l0a_trans(__ca__ float* dst, __cbuf__ float* src, uint16_t index_id, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap, bool enable_addr_decrement, uint16_t dst_frac_gap) | 89 | __aicore__ inline void asc_copy_l12l0a_trans(__ca__ float* dst, __cbuf__ float* src, uint16_t index_id, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap, bool enable_addr_decrement, uint16_t dst_frac_gap) |
| 91 | ``` | 90 | ``` |
| 92 | 91 | ||
| 93 | -- 同步高维切分搬运 | ||
| 94 | - | ||
| 95 | - ```cpp | ||
| 96 | - __aicore__ inline void asc_copy_l12l0a_trans_sync(__ca__ uint8_t* dst, __cbuf__ uint8_t* src, uint16_t index_id, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap, bool enable_addr_decrement, uint16_t dst_frac_gap) | ||
| 97 | - __aicore__ inline void asc_copy_l12l0a_trans_sync(__ca__ int8_t* dst, __cbuf__ int8_t* src, uint16_t index_id, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap, bool enable_addr_decrement, uint16_t dst_frac_gap) | ||
| 98 | - __aicore__ inline void asc_copy_l12l0a_trans_sync(__ca__ half* dst, __cbuf__ half* src, uint16_t index_id, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap, bool enable_addr_decrement, uint16_t dst_frac_gap) | ||
| 99 | - __aicore__ inline void asc_copy_l12l0a_trans_sync(__ca__ bfloat16_t* dst, __cbuf__ bfloat16_t* src, uint16_t index_id, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap, bool enable_addr_decrement, uint16_t dst_frac_gap) | ||
| 100 | - __aicore__ inline void asc_copy_l12l0a_trans_sync(__ca__ uint32_t* dst, __cbuf__ uint32_t* src, uint16_t index_id, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap, bool enable_addr_decrement, uint16_t dst_frac_gap) | ||
| 101 | - __aicore__ inline void asc_copy_l12l0a_trans_sync(__ca__ int32_t* dst, __cbuf__ int32_t* src, uint16_t index_id, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap, bool enable_addr_decrement, uint16_t dst_frac_gap) | ||
| 102 | - __aicore__ inline void asc_copy_l12l0a_trans_sync(__ca__ float* dst, __cbuf__ float* src, uint16_t index_id, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap, bool enable_addr_decrement, uint16_t dst_frac_gap) | ||
| 103 | - ``` | ||
| 104 | - | ||
| 105 | ## 参数说明 | 92 | ## 参数说明 |
| 106 | 93 | ||
| 107 | **表1** 参数说明 | 94 | **表1** 参数说明 |
| @@ -52,14 +52,6 @@ __aicore__ inline void asc_copy_l12l0b(__cb__ <dtype>* dst, | |||
| 52 | uint8_t k_step, | 52 | uint8_t k_step, |
| 53 | int16_t src_stride, | 53 | int16_t src_stride, |
| 54 | uint16_t dst_stride) | 54 | uint16_t dst_stride) |
| 55 | -__aicore__ inline void asc_copy_l12l0b_sync(__cb__ <dtype>* dst, | ||
| 56 | - __cbuf__ <dtype>* src, | ||
| 57 | - uint16_t m_start_position, | ||
| 58 | - uint16_t k_start_position, | ||
| 59 | - uint8_t m_step, | ||
| 60 | - uint8_t k_step, | ||
| 61 | - int16_t src_stride, | ||
| 62 | - uint16_t dst_stride) | ||
| 63 | ``` | 55 | ``` |
| 64 | 56 | ||
| 65 | ### dtype支持的数据类型 | 57 | ### dtype支持的数据类型 |
| @@ -91,14 +83,6 @@ __aicore__ inline void asc_copy_l12l0b_transpose(__cb__ <dtype>* dst, | |||
| 91 | uint8_t k_step, | 83 | uint8_t k_step, |
| 92 | int16_t src_stride, | 84 | int16_t src_stride, |
| 93 | uint16_t dst_stride) | 85 | uint16_t dst_stride) |
| 94 | -__aicore__ inline void asc_copy_l12l0b_transpose_sync(__cb__ <dtype>* dst, | ||
| 95 | - __cbuf__ <dtype>* src, | ||
| 96 | - uint16_t m_start_position, | ||
| 97 | - uint16_t k_start_position, | ||
| 98 | - uint8_t m_step, | ||
| 99 | - uint8_t k_step, | ||
| 100 | - int16_t src_stride, | ||
| 101 | - uint16_t dst_stride) | ||
| 102 | ``` | 86 | ``` |
| 103 | 87 | ||
| 104 | ### dtype支持的数据类型 | 88 | ### dtype支持的数据类型 |
| @@ -56,23 +56,6 @@ __aicore__ inline void asc_copy_l12l0b(__cb__ <dtype>* dst, | |||
| 56 | bool transpose, | 56 | bool transpose, |
| 57 | bool f_matrix_ctrl, | 57 | bool f_matrix_ctrl, |
| 58 | uint16_t channel_size) | 58 | uint16_t channel_size) |
| 59 | -__aicore__ inline void asc_copy_l12l0b_sync(__cb__ <dtype>* dst, | ||
| 60 | - __cbuf__ <dtype>* src, | ||
| 61 | - uint16_t k_extension, | ||
| 62 | - uint16_t m_extension, | ||
| 63 | - uint16_t k_start_pt, | ||
| 64 | - uint16_t m_start_pt, | ||
| 65 | - uint8_t stride_w, | ||
| 66 | - uint8_t stride_h, | ||
| 67 | - uint8_t filter_w, | ||
| 68 | - uint8_t filter_h, | ||
| 69 | - uint8_t dilation_filter_w, | ||
| 70 | - uint8_t dilation_filter_h, | ||
| 71 | - bool filter_size_w, | ||
| 72 | - bool filter_size_h, | ||
| 73 | - bool transpose, | ||
| 74 | - bool f_matrix_ctrl, | ||
| 75 | - uint16_t channel_size) | ||
| 76 | ``` | 59 | ``` |
| 77 | 60 | ||
| 78 | ### dtype支持的数据类型 | 61 | ### dtype支持的数据类型 |
| @@ -44,19 +44,6 @@ | |||
| 44 | __aicore__ inline void asc_copy_l12l0b(__cb__ float* dst, __cbuf__ float* src, uint16_t start_index, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | 44 | __aicore__ inline void asc_copy_l12l0b(__cb__ float* dst, __cbuf__ float* src, uint16_t start_index, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) |
| 45 | ``` | 45 | ``` |
| 46 | 46 | ||
| 47 | -- 同步高维切分搬运2D格式 | ||
| 48 | - | ||
| 49 | - ```cpp | ||
| 50 | - __aicore__ inline void asc_copy_l12l0b_sync(__cb__ int4b_t* dst, __cbuf__ int4b_t* src, uint16_t start_index, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 51 | - __aicore__ inline void asc_copy_l12l0b_sync(__cb__ uint8_t* dst, __cbuf__ uint8_t* src, uint16_t start_index, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 52 | - __aicore__ inline void asc_copy_l12l0b_sync(__cb__ int8_t* dst, __cbuf__ int8_t* src, uint16_t start_index, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 53 | - __aicore__ inline void asc_copy_l12l0b_sync(__cb__ half* dst, __cbuf__ half* src, uint16_t start_index, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 54 | - __aicore__ inline void asc_copy_l12l0b_sync(__cb__ bfloat16_t* dst, __cbuf__ bfloat16_t* src, uint16_t start_index, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 55 | - __aicore__ inline void asc_copy_l12l0b_sync(__cb__ uint32_t* dst, __cbuf__ uint32_t* src, uint16_t start_index, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 56 | - __aicore__ inline void asc_copy_l12l0b_sync(__cb__ int32_t* dst, __cbuf__ int32_t* src, uint16_t start_index, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 57 | - __aicore__ inline void asc_copy_l12l0b_sync(__cb__ float* dst, __cbuf__ float* src, uint16_t start_index, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 58 | - ``` | ||
| 59 | - | ||
| 60 | - 高维切分搬运3D格式 | 47 | - 高维切分搬运3D格式 |
| 61 | 48 | ||
| 62 | ```cpp | 49 | ```cpp |
| @@ -67,16 +54,6 @@ | |||
| 67 | __aicore__ inline void asc_copy_l12l0b(__cb__ float* dst, __cbuf__ float* src, uint16_t k_extension, uint16_t m_extension, uint16_t k_start_pt, uint16_t m_start_pt, uint8_t stride_w, uint8_t stride_h, uint8_t filter_w, uint8_t filter_h, uint8_t dilation_filter_w, uint8_t dilation_filter_h, bool filter_size_w, bool filter_size_h, bool transpose, bool f_matrix_ctrl, uint16_t channel_size) | 54 | __aicore__ inline void asc_copy_l12l0b(__cb__ float* dst, __cbuf__ float* src, uint16_t k_extension, uint16_t m_extension, uint16_t k_start_pt, uint16_t m_start_pt, uint8_t stride_w, uint8_t stride_h, uint8_t filter_w, uint8_t filter_h, uint8_t dilation_filter_w, uint8_t dilation_filter_h, bool filter_size_w, bool filter_size_h, bool transpose, bool f_matrix_ctrl, uint16_t channel_size) |
| 68 | ``` | 55 | ``` |
| 69 | 56 | ||
| 70 | -- 同步高维切分搬运3D格式 | ||
| 71 | - | ||
| 72 | - ```cpp | ||
| 73 | - __aicore__ inline void asc_copy_l12l0b_sync(__cb__ half* dst, __cbuf__ half* src, uint16_t k_extension, uint16_t m_extension, uint16_t k_start_pt, uint16_t m_start_pt, uint8_t stride_w, uint8_t stride_h, uint8_t filter_w, uint8_t filter_h, uint8_t dilation_filter_w, uint8_t dilation_filter_h, bool filter_size_w, bool filter_size_h, bool transpose, bool f_matrix_ctrl, uint16_t channel_size) | ||
| 74 | - __aicore__ inline void asc_copy_l12l0b_sync(__cb__ bfloat16_t* dst, __cbuf__ bfloat16_t* src, uint16_t k_extension, uint16_t m_extension, uint16_t k_start_pt, uint16_t m_start_pt, uint8_t stride_w, uint8_t stride_h, uint8_t filter_w, uint8_t filter_h, uint8_t dilation_filter_w, uint8_t dilation_filter_h, bool filter_size_w, bool filter_size_h, bool transpose, bool f_matrix_ctrl, uint16_t channel_size) | ||
| 75 | - __aicore__ inline void asc_copy_l12l0b_sync(__cb__ uint32_t* dst, __cbuf__ uint32_t* src, uint16_t k_extension, uint16_t m_extension, uint16_t k_start_pt, uint16_t m_start_pt, uint8_t stride_w, uint8_t stride_h, uint8_t filter_w, uint8_t filter_h, uint8_t dilation_filter_w, uint8_t dilation_filter_h, bool filter_size_w, bool filter_size_h, bool transpose, bool f_matrix_ctrl, uint16_t channel_size) | ||
| 76 | - __aicore__ inline void asc_copy_l12l0b_sync(__cb__ int32_t* dst, __cbuf__ int32_t* src, uint16_t k_extension, uint16_t m_extension, uint16_t k_start_pt, uint16_t m_start_pt, uint8_t stride_w, uint8_t stride_h, uint8_t filter_w, uint8_t filter_h, uint8_t dilation_filter_w, uint8_t dilation_filter_h, bool filter_size_w, bool filter_size_h, bool transpose, bool f_matrix_ctrl, uint16_t channel_size) | ||
| 77 | - __aicore__ inline void asc_copy_l12l0b_sync(__cb__ float* dst, __cbuf__ float* src, uint16_t k_extension, uint16_t m_extension, uint16_t k_start_pt, uint16_t m_start_pt, uint8_t stride_w, uint8_t stride_h, uint8_t filter_w, uint8_t filter_h, uint8_t dilation_filter_w, uint8_t dilation_filter_h, bool filter_size_w, bool filter_size_h, bool transpose, bool f_matrix_ctrl, uint16_t channel_size) | ||
| 78 | - ``` | ||
| 79 | - | ||
| 80 | ## 参数说明 | 57 | ## 参数说明 |
| 81 | 58 | ||
| 82 | **表1** 2D格式参数说明 | 59 | **表1** 2D格式参数说明 |
| @@ -51,15 +51,6 @@ __aicore__ inline void asc_copy_l12l0b_mx(uint64_t dst, | |||
| 51 | uint8_t y_step, | 51 | uint8_t y_step, |
| 52 | uint16_t src_stride, | 52 | uint16_t src_stride, |
| 53 | uint16_t dst_stride) | 53 | uint16_t dst_stride) |
| 54 | - | ||
| 55 | -__aicore__ inline void asc_copy_l12l0b_mx_sync(uint64_t dst, | ||
| 56 | - __cbuf__ fp8_e8m0_t* src, | ||
| 57 | - uint16_t x_start_pos, | ||
| 58 | - uint16_t y_start_pos, | ||
| 59 | - uint8_t x_step, | ||
| 60 | - uint8_t y_step, | ||
| 61 | - uint16_t src_stride, | ||
| 62 | - uint16_t dst_stride) | ||
| 63 | ``` | 54 | ``` |
| 64 | 55 | ||
| 65 | ## 参数说明 | 56 | ## 参数说明 |
| @@ -39,11 +39,6 @@ | |||
| 39 | __aicore__ inline void asc_copy_l12l0b_sparse(__cb__ int8_t* dst, __cbuf__ int8_t* src, __cbuf__ int8_t* index, uint16_t start_index, uint8_t repeat) | 39 | __aicore__ inline void asc_copy_l12l0b_sparse(__cb__ int8_t* dst, __cbuf__ int8_t* src, __cbuf__ int8_t* index, uint16_t start_index, uint8_t repeat) |
| 40 | ``` | 40 | ``` |
| 41 | 41 | ||
| 42 | -- 同步搬运 | ||
| 43 | - ```cpp | ||
| 44 | - __aicore__ inline void asc_copy_l12l0b_sparse_sync(__cb__ int8_t* dst, __cbuf__ int8_t* src, __cbuf__ int8_t* index, uint16_t start_index, uint8_t repeat) | ||
| 45 | - ``` | ||
| 46 | - | ||
| 47 | ## 参数说明 | 42 | ## 参数说明 |
| 48 | 43 | ||
| 49 | **表1** 参数说明 | 44 | **表1** 参数说明 |
Mdocs/zh/api/SIMD-API/c_api/cube_datamove/asc_copy_l12l0b_trans/asc_copy_l12l0b_trans_arch_2201.md+0-12
| @@ -75,7 +75,6 @@ | |||
| 75 | 75 | ||
| 76 |  | 76 |  |
| 77 | 77 | ||
| 78 | - | ||
| 79 | ## 函数原型 | 78 | ## 函数原型 |
| 80 | 79 | ||
| 81 | - 高维切分搬运 | 80 | - 高维切分搬运 |
| @@ -89,17 +88,6 @@ __aicore__ inline void asc_copy_l12l0b_trans(__cb__ int32_t* dst, __cbuf__ int32 | |||
| 89 | __aicore__ inline void asc_copy_l12l0b_trans(__cb__ float* dst, __cbuf__ float* src, uint16_t index_id, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap, bool enable_addr_decrement, uint16_t dst_frac_gap) | 88 | __aicore__ inline void asc_copy_l12l0b_trans(__cb__ float* dst, __cbuf__ float* src, uint16_t index_id, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap, bool enable_addr_decrement, uint16_t dst_frac_gap) |
| 90 | ``` | 89 | ``` |
| 91 | 90 | ||
| 92 | -- 同步高维切分搬运 | ||
| 93 | -```cpp | ||
| 94 | -__aicore__ inline void asc_copy_l12l0b_trans_sync(__cb__ uint8_t* dst, __cbuf__ uint8_t* src, uint16_t index_id, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap, bool enable_addr_decrement, uint16_t dst_frac_gap) | ||
| 95 | -__aicore__ inline void asc_copy_l12l0b_trans_sync(__cb__ int8_t* dst, __cbuf__ int8_t* src, uint16_t index_id, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap, bool enable_addr_decrement, uint16_t dst_frac_gap) | ||
| 96 | -__aicore__ inline void asc_copy_l12l0b_trans_sync(__cb__ half* dst, __cbuf__ half* src, uint16_t index_id, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap, bool enable_addr_decrement, uint16_t dst_frac_gap) | ||
| 97 | -__aicore__ inline void asc_copy_l12l0b_trans_sync(__cb__ bfloat16_t* dst, __cbuf__ bfloat16_t* src, uint16_t index_id, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap, bool enable_addr_decrement, uint16_t dst_frac_gap) | ||
| 98 | -__aicore__ inline void asc_copy_l12l0b_trans_sync(__cb__ uint32_t* dst, __cbuf__ uint32_t* src, uint16_t index_id, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap, bool enable_addr_decrement, uint16_t dst_frac_gap) | ||
| 99 | -__aicore__ inline void asc_copy_l12l0b_trans_sync(__cb__ int32_t* dst, __cbuf__ int32_t* src, uint16_t index_id, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap, bool enable_addr_decrement, uint16_t dst_frac_gap) | ||
| 100 | -__aicore__ inline void asc_copy_l12l0b_trans_sync(__cb__ float* dst, __cbuf__ float* src, uint16_t index_id, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap, bool enable_addr_decrement, uint16_t dst_frac_gap) | ||
| 101 | -``` | ||
| 102 | - | ||
| 103 | ## 参数说明 | 91 | ## 参数说明 |
| 104 | 92 | ||
| 105 | **表1** 参数说明 | 93 | **表1** 参数说明 |
Mdocs/zh/api/SIMD-API/c_api/cube_datamove/asc_copy_l12l0b_trans/asc_copy_l12l0b_trans_arch_3510.md+0-8
| @@ -104,14 +104,6 @@ __aicore__ inline void asc_copy_l12l0b_trans(__cb__ <dtype>* dst, | |||
| 104 | uint16_t dst_gap, | 104 | uint16_t dst_gap, |
| 105 | uint16_t dst_frac_gap, | 105 | uint16_t dst_frac_gap, |
| 106 | uint16_t src_frac_gap) | 106 | uint16_t src_frac_gap) |
| 107 | -__aicore__ inline void asc_copy_l12l0b_trans_sync(__cb__ <dtype>* dst, | ||
| 108 | - __cbuf__ <dtype>* src, | ||
| 109 | - uint16_t index_id, | ||
| 110 | - uint8_t repeat, | ||
| 111 | - uint16_t src_stride, | ||
| 112 | - uint16_t dst_gap, | ||
| 113 | - uint16_t dst_frac_gap, | ||
| 114 | - uint16_t src_frac_gap) | ||
| 115 | ``` | 107 | ``` |
| 116 | 108 | ||
| 117 | ### dtype支持的数据类型 | 109 | ### dtype支持的数据类型 |
| @@ -50,17 +50,6 @@ | |||
| 50 | __aicore__ inline void asc_copy_l12l0c(__cc__ int32_t* dst, __cbuf__ int32_t* src, uint16_t n_burst, uint16_t len_burst, uint16_t src_gap, uint16_t dst_gap) | 50 | __aicore__ inline void asc_copy_l12l0c(__cc__ int32_t* dst, __cbuf__ int32_t* src, uint16_t n_burst, uint16_t len_burst, uint16_t src_gap, uint16_t dst_gap) |
| 51 | __aicore__ inline void asc_copy_l12l0c(__cc__ uint32_t* dst, __cbuf__ uint32_t* src, uint16_t n_burst, uint16_t len_burst, uint16_t src_gap, uint16_t dst_gap) | 51 | __aicore__ inline void asc_copy_l12l0c(__cc__ uint32_t* dst, __cbuf__ uint32_t* src, uint16_t n_burst, uint16_t len_burst, uint16_t src_gap, uint16_t dst_gap) |
| 52 | ``` | 52 | ``` |
| 53 | -- 同步搬运 | ||
| 54 | - | ||
| 55 | - ```cpp | ||
| 56 | - __aicore__ inline void asc_copy_l12l0c_sync(__cc__ bfloat16_t* dst, __cbuf__ bfloat16_t* src, uint16_t n_burst, uint16_t len_burst, uint16_t src_gap, uint16_t dst_gap) | ||
| 57 | - __aicore__ inline void asc_copy_l12l0c_sync(__cc__ half* dst, __cbuf__ half* src, uint16_t n_burst, uint16_t len_burst, uint16_t src_gap, uint16_t dst_gap) | ||
| 58 | - __aicore__ inline void asc_copy_l12l0c_sync(__cc__ half* dst, __cbuf__ float* src, uint16_t n_burst, uint16_t len_burst, uint16_t src_gap, uint16_t dst_gap) | ||
| 59 | - __aicore__ inline void asc_copy_l12l0c_sync(__cc__ bfloat16_t* dst, __cbuf__ float* src, uint16_t n_burst, uint16_t len_burst, uint16_t src_gap, uint16_t dst_gap) | ||
| 60 | - __aicore__ inline void asc_copy_l12l0c_sync(__cc__ float* dst, __cbuf__ float* src, uint16_t n_burst, uint16_t len_burst, uint16_t src_gap, uint16_t dst_gap) | ||
| 61 | - __aicore__ inline void asc_copy_l12l0c_sync(__cc__ int32_t* dst, __cbuf__ int32_t* src, uint16_t n_burst, uint16_t len_burst, uint16_t src_gap, uint16_t dst_gap) | ||
| 62 | - __aicore__ inline void asc_copy_l12l0c_sync(__cc__ uint32_t* dst, __cbuf__ uint32_t* src, uint16_t n_burst, uint16_t len_burst, uint16_t src_gap, uint16_t dst_gap) | ||
| 63 | - ``` | ||
| 64 | 53 | ||
| 65 | ## 参数说明 | 54 | ## 参数说明 |
| 66 | 55 | ||
| @@ -36,7 +36,6 @@ | |||
| 36 | 36 | ||
| 37 | ```c | 37 | ```c |
| 38 | __aicore__ inline void asc_copy_l12ub(__ubuf__ void* dst_addr, __cbuf__ void* src_addr, int8_t sub_blockid, uint16_t burst_count, uint16_t burst_len, uint16_t src_gap, uint16_t dst_gap) | 38 | __aicore__ inline void asc_copy_l12ub(__ubuf__ void* dst_addr, __cbuf__ void* src_addr, int8_t sub_blockid, uint16_t burst_count, uint16_t burst_len, uint16_t src_gap, uint16_t dst_gap) |
| 39 | -__aicore__ inline void asc_copy_l12ub_sync(__ubuf__ void* dst_addr, __cbuf__ void* src_addr, int8_t sub_blockid, uint16_t burst_count, uint16_t burst_len, uint16_t src_gap, uint16_t dst_gap) | ||
| 40 | ``` | 39 | ``` |
| 41 | 40 | ||
| 42 | ## 参数说明 | 41 | ## 参数说明 |
| @@ -52,26 +52,6 @@ | |||
| 52 | __aicore__ inline void asc_fill_l0a(__ca__ float* dst, uint32_t value, const asc_fill_value_config& config) | 52 | __aicore__ inline void asc_fill_l0a(__ca__ float* dst, uint32_t value, const asc_fill_value_config& config) |
| 53 | ``` | 53 | ``` |
| 54 | 54 | ||
| 55 | -- 同步计算 | ||
| 56 | - | ||
| 57 | - ```cpp | ||
| 58 | - __aicore__ inline void asc_fill_l0a_sync(__ca__ int16_t* dst, half value, const asc_fill_value_config& config) | ||
| 59 | - __aicore__ inline void asc_fill_l0a_sync(__ca__ int16_t* dst, uint32_t value, const asc_fill_value_config& config) | ||
| 60 | - __aicore__ inline void asc_fill_l0a_sync(__ca__ uint16_t* dst, half value, const asc_fill_value_config& config) | ||
| 61 | - __aicore__ inline void asc_fill_l0a_sync(__ca__ uint16_t* dst, uint32_t value, const asc_fill_value_config& config) | ||
| 62 | - __aicore__ inline void asc_fill_l0a_sync(__ca__ half* dst, half value, const asc_fill_value_config& config) | ||
| 63 | - __aicore__ inline void asc_fill_l0a_sync(__ca__ half* dst, uint32_t value, const asc_fill_value_config& config) | ||
| 64 | - __aicore__ inline void asc_fill_l0a_sync(__ca__ bfloat16_t* dst, bfloat16_t value, const asc_fill_value_config& config) | ||
| 65 | - __aicore__ inline void asc_fill_l0a_sync(__ca__ bfloat16_t* dst, half value, const asc_fill_value_config& config) | ||
| 66 | - __aicore__ inline void asc_fill_l0a_sync(__ca__ bfloat16_t* dst, uint32_t value, const asc_fill_value_config& config) | ||
| 67 | - __aicore__ inline void asc_fill_l0a_sync(__ca__ int32_t* dst, half value, const asc_fill_value_config& config) | ||
| 68 | - __aicore__ inline void asc_fill_l0a_sync(__ca__ int32_t* dst, uint32_t value, const asc_fill_value_config& config) | ||
| 69 | - __aicore__ inline void asc_fill_l0a_sync(__ca__ uint32_t* dst, half value, const asc_fill_value_config& config) | ||
| 70 | - __aicore__ inline void asc_fill_l0a_sync(__ca__ uint32_t* dst, uint32_t value, const asc_fill_value_config& config) | ||
| 71 | - __aicore__ inline void asc_fill_l0a_sync(__ca__ float* dst, half value, const asc_fill_value_config& config) | ||
| 72 | - __aicore__ inline void asc_fill_l0a_sync(__ca__ float* dst, uint32_t value, const asc_fill_value_config& config) | ||
| 73 | - ``` | ||
| 74 | - | ||
| 75 | ## 参数说明 | 55 | ## 参数说明 |
| 76 | 56 | ||
| 77 | **表1** 参数说明 | 57 | **表1** 参数说明 |
| @@ -52,26 +52,6 @@ | |||
| 52 | __aicore__ inline void asc_fill_l0b(__cb__ float* dst, uint32_t value, const asc_fill_value_config& config) | 52 | __aicore__ inline void asc_fill_l0b(__cb__ float* dst, uint32_t value, const asc_fill_value_config& config) |
| 53 | ``` | 53 | ``` |
| 54 | 54 | ||
| 55 | -- 同步计算 | ||
| 56 | - | ||
| 57 | - ```cpp | ||
| 58 | - __aicore__ inline void asc_fill_l0b_sync(__cb__ int16_t* dst, half value, const asc_fill_value_config& config) | ||
| 59 | - __aicore__ inline void asc_fill_l0b_sync(__cb__ int16_t* dst, uint32_t value, const asc_fill_value_config& config) | ||
| 60 | - __aicore__ inline void asc_fill_l0b_sync(__cb__ uint16_t* dst, half value, const asc_fill_value_config& config) | ||
| 61 | - __aicore__ inline void asc_fill_l0b_sync(__cb__ uint16_t* dst, uint32_t value, const asc_fill_value_config& config) | ||
| 62 | - __aicore__ inline void asc_fill_l0b_sync(__cb__ half* dst, half value, const asc_fill_value_config& config) | ||
| 63 | - __aicore__ inline void asc_fill_l0b_sync(__cb__ half* dst, uint32_t value, const asc_fill_value_config& config) | ||
| 64 | - __aicore__ inline void asc_fill_l0b_sync(__cb__ bfloat16_t* dst, bfloat16_t value, const asc_fill_value_config& config) | ||
| 65 | - __aicore__ inline void asc_fill_l0b_sync(__cb__ bfloat16_t* dst, half value, const asc_fill_value_config& config) | ||
| 66 | - __aicore__ inline void asc_fill_l0b_sync(__cb__ bfloat16_t* dst, uint32_t value, const asc_fill_value_config& config) | ||
| 67 | - __aicore__ inline void asc_fill_l0b_sync(__cb__ int32_t* dst, half value, const asc_fill_value_config& config) | ||
| 68 | - __aicore__ inline void asc_fill_l0b_sync(__cb__ int32_t* dst, uint32_t value, const asc_fill_value_config& config) | ||
| 69 | - __aicore__ inline void asc_fill_l0b_sync(__cb__ uint32_t* dst, half value, const asc_fill_value_config& config) | ||
| 70 | - __aicore__ inline void asc_fill_l0b_sync(__cb__ uint32_t* dst, uint32_t value, const asc_fill_value_config& config) | ||
| 71 | - __aicore__ inline void asc_fill_l0b_sync(__cb__ float* dst, half value, const asc_fill_value_config& config) | ||
| 72 | - __aicore__ inline void asc_fill_l0b_sync(__cb__ float* dst, uint32_t value, const asc_fill_value_config& config) | ||
| 73 | - ``` | ||
| 74 | - | ||
| 75 | ## 参数说明 | 55 | ## 参数说明 |
| 76 | 56 | ||
| 77 | **表1** 参数说明 | 57 | **表1** 参数说明 |
| @@ -38,9 +38,6 @@ | |||
| 38 | __aicore__ inline void asc_fill_l1(__cbuf__ <dst_dtype>* dst, | 38 | __aicore__ inline void asc_fill_l1(__cbuf__ <dst_dtype>* dst, |
| 39 | <value_dtype> value, | 39 | <value_dtype> value, |
| 40 | const asc_fill_value_config& config) | 40 | const asc_fill_value_config& config) |
| 41 | -__aicore__ inline void asc_fill_l1_sync(__cbuf__ <dst_dtype>* dst, | ||
| 42 | - <value_dtype> value, | ||
| 43 | - const asc_fill_value_config& config) | ||
| 44 | ``` | 41 | ``` |
| 45 | 42 | ||
| 46 | ### dtype支持的数据类型 | 43 | ### dtype支持的数据类型 |
| @@ -95,7 +92,7 @@ PIPE_MTE2 | |||
| 95 | - 本接口非AIC调用直接返回。 | 92 | - 本接口非AIC调用直接返回。 |
| 96 | - `dst`起始地址需要按照32字节对齐(L1 Buffer对齐要求),否则触发地址对齐异常。 | 93 | - `dst`起始地址需要按照32字节对齐(L1 Buffer对齐要求),否则触发地址对齐异常。 |
| 97 | - L1 Buffer总容量为512KB。`dst`偏移量与实际占用空间之和不可超过L1 Buffer容量,否则触发地址溢出异常。 | 94 | - L1 Buffer总容量为512KB。`dst`偏移量与实际占用空间之和不可超过L1 Buffer容量,否则触发地址溢出异常。 |
| 98 | -- 如果本指令与其他指令存在目的地址重叠,需要插入同步指令([asc_sync_notify](../sync/asc_sync_notify.md)和[asc_sync_wait](../sync/asc_sync_wait.md)),保证多个指令串行化,防止出现异常数据。调用`asc_fill_l1_sync`时,接口内部完成同步。 | 95 | +- 如果本指令与其他指令存在目的地址重叠,需要插入同步指令([asc_sync_notify](../sync/asc_sync_notify.md)和[asc_sync_wait](../sync/asc_sync_wait.md)),保证多个指令串行化,防止出现异常数据。 |
| 99 | - `value`的数据类型需与`dst`的数据类型满足函数原型章节中的组合关系。两者数据类型不相同时,需要根据`dst`的数据类型转换`value`的值,具体请参考调用示例。 | 96 | - `value`的数据类型需与`dst`的数据类型满足函数原型章节中的组合关系。两者数据类型不相同时,需要根据`dst`的数据类型转换`value`的值,具体请参考调用示例。 |
| 100 | 97 | ||
| 101 | ## 调用示例 | 98 | ## 调用示例 |
| @@ -39,13 +39,6 @@ | |||
| 39 | __aicore__ inline void asc_load_image_to_cbuf(__cbuf__ half* dst, uint16_t hor_size, uint16_t ver_size, uint16_t hor_start_pos, uint16_t ver_start_pos, uint16_t src_hor_size, uint8_t top_pad_size, uint8_t bot_pad_size, uint16_t left_pad_size, uint16_t right_pad_size) | 39 | __aicore__ inline void asc_load_image_to_cbuf(__cbuf__ half* dst, uint16_t hor_size, uint16_t ver_size, uint16_t hor_start_pos, uint16_t ver_start_pos, uint16_t src_hor_size, uint8_t top_pad_size, uint8_t bot_pad_size, uint16_t left_pad_size, uint16_t right_pad_size) |
| 40 | ``` | 40 | ``` |
| 41 | 41 | ||
| 42 | -- 同步搬运 | ||
| 43 | - | ||
| 44 | - ```cpp | ||
| 45 | - __aicore__ inline void asc_load_image_to_cbuf_sync(__cbuf__ int8_t* dst, uint16_t hor_size, uint16_t ver_size, uint16_t hor_start_pos, uint16_t ver_start_pos, uint16_t src_hor_size, uint8_t top_pad_size, uint8_t bot_pad_size, uint16_t left_pad_size, uint16_t right_pad_size) | ||
| 46 | - __aicore__ inline void asc_load_image_to_cbuf_sync(__cbuf__ half* dst, uint16_t hor_size, uint16_t ver_size, uint16_t hor_start_pos, uint16_t ver_start_pos, uint16_t src_hor_size, uint8_t top_pad_size, uint8_t bot_pad_size, uint16_t left_pad_size, uint16_t right_pad_size) | ||
| 47 | - ``` | ||
| 48 | - | ||
| 49 | ## 参数说明 | 42 | ## 参数说明 |
| 50 | 43 | ||
| 51 | **表1** 参数说明 | 44 | **表1** 参数说明 |
| @@ -74,5 +74,5 @@ PIPE_V | |||
| 74 | constexpr uint32_t total_length = 128; | 74 | constexpr uint32_t total_length = 128; |
| 75 | __ubuf__ half src[total_length]; | 75 | __ubuf__ half src[total_length]; |
| 76 | __ubuf__ half dst[total_length]; | 76 | __ubuf__ half dst[total_length]; |
| 77 | -asc_abs(dst, src, total_length); | 77 | +asc_abs_sync(dst, src, total_length); |
| 78 | ``` | 78 | ``` |
| @@ -0,0 +1,95 @@ | |||
| 1 | +# asc_add_relu_sync(废弃) | ||
| 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 | +<!-- end id5 --> | ||
| 20 | +<!-- npu="310p" id6 --> | ||
| 21 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 22 | +<!-- end id6 --> | ||
| 23 | +<!-- npu="910" id7 --> | ||
| 24 | +- Atlas 训练系列产品:不支持 | ||
| 25 | +<!-- end id7 --> | ||
| 26 | + | ||
| 27 | +## 功能说明 | ||
| 28 | + | ||
| 29 | +头文件路径为:`"c_api/composite/vector_compute_composite.h"`。 | ||
| 30 | + | ||
| 31 | +**`asc_add_relu_sync`接口已废弃,请使用[对应的非同步接口](../vector_compute/vector_fused/asc_add_relu.md)和同步接口[asc_sync](../sync/asc_sync.md)替代。** | ||
| 32 | + | ||
| 33 | +按元素求和,再进行Relu计算(结果和0对比取较大值),并提供转换最终结果的数据类型的功能(s162s8、f322f16、f162s8)。计算公式如下: | ||
| 34 | + | ||
| 35 | +$$ | ||
| 36 | +dst_i = relu(src0_i + src1_i) | ||
| 37 | +$$ | ||
| 38 | + | ||
| 39 | +## 函数原型 | ||
| 40 | + | ||
| 41 | +- 同步计算 | ||
| 42 | + | ||
| 43 | + ```cpp | ||
| 44 | + __aicore__ inline void asc_add_relu_sync(__ubuf__ half* dst, __ubuf__ half* src0, __ubuf__ half* src1, uint32_t count) | ||
| 45 | + __aicore__ inline void asc_add_relu_sync(__ubuf__ float* dst, __ubuf__ float* src0, __ubuf__ float* src1, uint32_t count) | ||
| 46 | + __aicore__ inline void asc_add_relu_sync(__ubuf__ int16_t* dst, __ubuf__ int16_t* src0, __ubuf__ int16_t* src1, uint32_t count) | ||
| 47 | + __aicore__ inline void asc_add_relu_sync(__ubuf__ int8_t* dst, __ubuf__ int16_t* src0, __ubuf__ int16_t* src1, uint32_t count) | ||
| 48 | + __aicore__ inline void asc_add_relu_sync(__ubuf__ half* dst, __ubuf__ float* src0, __ubuf__ float* src1, uint32_t count) | ||
| 49 | + __aicore__ inline void asc_add_relu_sync(__ubuf__ int8_t* dst, __ubuf__ half* src0, __ubuf__ half* src1, uint32_t count) | ||
| 50 | + ``` | ||
| 51 | + | ||
| 52 | +## 参数说明 | ||
| 53 | + | ||
| 54 | +**表1** 参数说明 | ||
| 55 | + | ||
| 56 | +| 参数名 | 输入/输出 | 描述 | | ||
| 57 | +|:----------| :-----|:----------------------------------| | ||
| 58 | +| dst | 输出 | 目的操作数(矢量)的起始地址。 | | ||
| 59 | +| src0、src1 | 输入 | 源操作数(矢量)的起始地址。 | | ||
| 60 | +| count | 输入 | 参与计算的元素个数。 | | ||
| 61 | + | ||
| 62 | +## 返回值说明 | ||
| 63 | + | ||
| 64 | +无 | ||
| 65 | + | ||
| 66 | +## 流水类型 | ||
| 67 | + | ||
| 68 | +PIPE_V | ||
| 69 | + | ||
| 70 | +## 约束说明 | ||
| 71 | + | ||
| 72 | +- dst、src0、src1的起始地址需要32字节对齐。 | ||
| 73 | +- 操作数地址重叠约束请参考[通用地址重叠约束](../general_description_and_constraints.md#通用地址重叠约束)。 | ||
| 74 | + | ||
| 75 | +## 调用示例 | ||
| 76 | + | ||
| 77 | +```cpp | ||
| 78 | +// 目的操作数和源操作数的数据类型一致 | ||
| 79 | +// total_length指参与计算的数据总长度 | ||
| 80 | +constexpr uint64_t total_length = 128; | ||
| 81 | +__ubuf__ half src0[total_length]; | ||
| 82 | +__ubuf__ half src1[total_length]; | ||
| 83 | +__ubuf__ half dst[total_length]; | ||
| 84 | +asc_add_relu_sync(dst, src0, src1, total_length); | ||
| 85 | +``` | ||
| 86 | + | ||
| 87 | +```cpp | ||
| 88 | +// 目的操作数和源操作数的数据类型不一致(s162s8) | ||
| 89 | +// total_length指参与计算的数据长度 | ||
| 90 | +constexpr uint32_t total_length = 32; | ||
| 91 | +__ubuf__ int8_t dst[total_length]; | ||
| 92 | +__ubuf__ int16_t src0[total_length]; | ||
| 93 | +__ubuf__ int16_t src1[total_length]; | ||
| 94 | +asc_add_relu_sync(dst, src0, src1, total_length); | ||
| 95 | +``` | ||
| @@ -0,0 +1,83 @@ | |||
| 1 | +# asc_add_scalar_sync(废弃) | ||
| 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 | +<!-- end id5 --> | ||
| 20 | +<!-- npu="310p" id6 --> | ||
| 21 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 22 | +<!-- end id6 --> | ||
| 23 | +<!-- npu="910" id7 --> | ||
| 24 | +- Atlas 训练系列产品:不支持 | ||
| 25 | +<!-- end id7 --> | ||
| 26 | + | ||
| 27 | +## 功能说明 | ||
| 28 | + | ||
| 29 | +头文件路径为:`"c_api/composite/vector_compute_composite.h"`。 | ||
| 30 | + | ||
| 31 | +**`asc_add_scalar_sync`接口已废弃,请使用[对应的非同步接口](../vector_compute/vector_arith/asc_add_scalar.md)和同步接口[asc_sync](../sync/asc_sync.md)替代。** | ||
| 32 | + | ||
| 33 | +执行矢量加法运算。计算公式如下: | ||
| 34 | + | ||
| 35 | +$$ | ||
| 36 | +dst_i = src_i + value | ||
| 37 | +$$ | ||
| 38 | + | ||
| 39 | +## 函数原型 | ||
| 40 | + | ||
| 41 | +- 同步计算 | ||
| 42 | + | ||
| 43 | +```cpp | ||
| 44 | +__aicore__ inline void asc_add_scalar_sync(__ubuf__ int16_t* dst, __ubuf__ int16_t* src, int16_t value, uint32_t count) | ||
| 45 | +__aicore__ inline void asc_add_scalar_sync(__ubuf__ half* dst, __ubuf__ half* src, half value, uint32_t count) | ||
| 46 | +__aicore__ inline void asc_add_scalar_sync(__ubuf__ int32_t* dst, __ubuf__ int32_t* src, int32_t value, uint32_t count) | ||
| 47 | +__aicore__ inline void asc_add_scalar_sync(__ubuf__ float* dst, __ubuf__ float* src, float value, uint32_t count) | ||
| 48 | +``` | ||
| 49 | + | ||
| 50 | +## 参数说明 | ||
| 51 | + | ||
| 52 | +**表1** 参数说明 | ||
| 53 | + | ||
| 54 | +| 参数名 | 输入/输出 | 描述 | | ||
| 55 | +| --------- | ----- | ---------------- | | ||
| 56 | +| dst | 输出 | 目的操作数。 | | ||
| 57 | +| src | 输入 | 源操作数(矢量)的起始地址。 | | ||
| 58 | +| value | 输入 | 源操作数(标量)。 | | ||
| 59 | +| count | 输入 | 参与连续计算的元素个数。 | | ||
| 60 | + | ||
| 61 | +## 返回值说明 | ||
| 62 | + | ||
| 63 | +无 | ||
| 64 | + | ||
| 65 | +## 流水类型 | ||
| 66 | + | ||
| 67 | +PIPE_V | ||
| 68 | + | ||
| 69 | +## 约束说明 | ||
| 70 | + | ||
| 71 | +- 操作数地址重叠约束请参考[通用地址重叠约束](../general_description_and_constraints.md#通用地址重叠约束)。 | ||
| 72 | +- dst、src的起始地址需要32字节对齐。 | ||
| 73 | + | ||
| 74 | +## 调用示例 | ||
| 75 | + | ||
| 76 | +```cpp | ||
| 77 | +//total_length指参与计算的数据长度 | ||
| 78 | +constexpr uint64_t total_length = 64; | ||
| 79 | +half scalar_val = 0.0f; | ||
| 80 | +__ubuf__ half src[total_length]; | ||
| 81 | +__ubuf__ half dst[total_length]; | ||
| 82 | +asc_add_scalar_sync(dst, src, scalar_val, total_length); | ||
| 83 | +``` | ||
| @@ -0,0 +1,82 @@ | |||
| 1 | +# asc_add_sync(废弃) | ||
| 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 | +<!-- end id5 --> | ||
| 20 | +<!-- npu="310p" id6 --> | ||
| 21 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 22 | +<!-- end id6 --> | ||
| 23 | +<!-- npu="910" id7 --> | ||
| 24 | +- Atlas 训练系列产品:不支持 | ||
| 25 | +<!-- end id7 --> | ||
| 26 | + | ||
| 27 | +## 功能说明 | ||
| 28 | + | ||
| 29 | +头文件路径为:`"c_api/composite/vector_compute_composite.h"`。 | ||
| 30 | + | ||
| 31 | +**`asc_add_sync`接口已废弃,请使用[对应的非同步接口](../vector_compute/vector_arith/asc_add.md)和同步接口[asc_sync](../sync/asc_sync.md)替代。** | ||
| 32 | + | ||
| 33 | +执行矢量加法运算。计算公式如下: | ||
| 34 | + | ||
| 35 | +$$ | ||
| 36 | +dst_i = src0_i + src1_i | ||
| 37 | +$$ | ||
| 38 | + | ||
| 39 | +## 函数原型 | ||
| 40 | + | ||
| 41 | +- 同步计算 | ||
| 42 | + | ||
| 43 | +```cpp | ||
| 44 | +__aicore__ inline void asc_add_sync(__ubuf__ int16_t* dst, __ubuf__ int16_t* src0, __ubuf__ int16_t* src1, uint32_t count) | ||
| 45 | +__aicore__ inline void asc_add_sync(__ubuf__ half* dst, __ubuf__ half* src0, __ubuf__ half* src1, uint32_t count) | ||
| 46 | +__aicore__ inline void asc_add_sync(__ubuf__ int32_t* dst, __ubuf__ int32_t* src0, __ubuf__ int32_t* src1, uint32_t count) | ||
| 47 | +__aicore__ inline void asc_add_sync(__ubuf__ float* dst, __ubuf__ float* src0, __ubuf__ float* src1, uint32_t count) | ||
| 48 | +``` | ||
| 49 | + | ||
| 50 | +## 参数说明 | ||
| 51 | + | ||
| 52 | +**表1** 参数说明 | ||
| 53 | + | ||
| 54 | +| 参数名 | 输入/输出 | 描述 | | ||
| 55 | +| --------- | ----- | ----------------- | | ||
| 56 | +| dst | 输出 | 目的操作数。 | | ||
| 57 | +| src0、src1 | 输入 | 源操作数(矢量)的起始地址。 | | ||
| 58 | +| count | 输入 | 参与计算的元素个数。 | | ||
| 59 | + | ||
| 60 | +## 返回值说明 | ||
| 61 | + | ||
| 62 | +无 | ||
| 63 | + | ||
| 64 | +## 流水类型 | ||
| 65 | + | ||
| 66 | +PIPE_V | ||
| 67 | + | ||
| 68 | +## 约束说明 | ||
| 69 | + | ||
| 70 | +- 操作数地址重叠约束请参考[通用地址重叠约束](../general_description_and_constraints.md#通用地址重叠约束)。 | ||
| 71 | +- dst、src0、src1的起始地址需要32字节对齐。 | ||
| 72 | + | ||
| 73 | +## 调用示例 | ||
| 74 | + | ||
| 75 | +```cpp | ||
| 76 | +//total_length指参与计算的数据长度 | ||
| 77 | +constexpr uint64_t total_length = 64; | ||
| 78 | +__ubuf__ half src0[total_length]; | ||
| 79 | +__ubuf__ half src1[total_length]; | ||
| 80 | +__ubuf__ half dst[total_length]; | ||
| 81 | +asc_add_sync(dst, src0, src1, total_length); | ||
| 82 | +``` | ||
| @@ -0,0 +1,80 @@ | |||
| 1 | +# asc_and_sync(废弃) | ||
| 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 | +<!-- end id5 --> | ||
| 20 | +<!-- npu="310p" id6 --> | ||
| 21 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 22 | +<!-- end id6 --> | ||
| 23 | +<!-- npu="910" id7 --> | ||
| 24 | +- Atlas 训练系列产品:不支持 | ||
| 25 | +<!-- end id7 --> | ||
| 26 | + | ||
| 27 | +## 功能说明 | ||
| 28 | + | ||
| 29 | +头文件路径为:`"c_api/composite/vector_compute_composite.h"`。 | ||
| 30 | + | ||
| 31 | +**`asc_and_sync`接口已废弃,请使用[对应的非同步接口](../vector_compute/vector_logic/asc_and.md)和同步接口[asc_sync](../sync/asc_sync.md)替代。** | ||
| 32 | + | ||
| 33 | +执行矢量与运算。计算公式如下: | ||
| 34 | + | ||
| 35 | +$$ | ||
| 36 | +dst_i = src0_i \quad \& \quad src1_i | ||
| 37 | +$$ | ||
| 38 | + | ||
| 39 | +## 函数原型 | ||
| 40 | + | ||
| 41 | +- 同步计算 | ||
| 42 | + | ||
| 43 | + ```cpp | ||
| 44 | + __aicore__ inline void asc_and_sync(__ubuf__ int16_t* dst, __ubuf__ int16_t* src0, __ubuf__ int16_t* src1, uint32_t count) | ||
| 45 | + __aicore__ inline void asc_and_sync(__ubuf__ uint16_t* dst, __ubuf__ uint16_t* src0, __ubuf__ uint16_t* src1, uint32_t count) | ||
| 46 | + ``` | ||
| 47 | + | ||
| 48 | +## 参数说明 | ||
| 49 | + | ||
| 50 | +**表1** 参数说明 | ||
| 51 | + | ||
| 52 | +| 参数名 | 输入/输出 | 描述 | | ||
| 53 | +| --------- | ----- | ----------------- | | ||
| 54 | +| dst | 输出 | 目的操作数。 | | ||
| 55 | +| src0、src1 | 输入 | 源操作数(矢量)的起始地址。 | | ||
| 56 | +| count | 输入 | 参与计算的元素个数。 | | ||
| 57 | + | ||
| 58 | +## 返回值说明 | ||
| 59 | + | ||
| 60 | +无 | ||
| 61 | + | ||
| 62 | +## 流水类型 | ||
| 63 | + | ||
| 64 | +PIPE_V | ||
| 65 | + | ||
| 66 | +## 约束说明 | ||
| 67 | + | ||
| 68 | +- 操作数地址重叠约束请参考[通用地址重叠约束](../general_description_and_constraints.md#通用地址重叠约束)。 | ||
| 69 | +- dst、src0、src1的起始地址需要32字节对齐。 | ||
| 70 | + | ||
| 71 | +## 调用示例 | ||
| 72 | + | ||
| 73 | +```cpp | ||
| 74 | +constexpr uint64_t total_length = 64; | ||
| 75 | +//total_length指参与计算的数据长度 | ||
| 76 | +__ubuf__ int16_t src0[total_length]; | ||
| 77 | +__ubuf__ int16_t src1[total_length]; | ||
| 78 | +__ubuf__ int16_t dst[total_length]; | ||
| 79 | +asc_and_sync(dst, src0, src1, total_length); | ||
| 80 | +``` | ||
| @@ -0,0 +1,81 @@ | |||
| 1 | +# asc_axpy_sync(废弃) | ||
| 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 | +<!-- end id5 --> | ||
| 20 | +<!-- npu="310p" id6 --> | ||
| 21 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 22 | +<!-- end id6 --> | ||
| 23 | +<!-- npu="910" id7 --> | ||
| 24 | +- Atlas 训练系列产品:不支持 | ||
| 25 | +<!-- end id7 --> | ||
| 26 | + | ||
| 27 | +## 功能说明 | ||
| 28 | + | ||
| 29 | +头文件路径为:`"c_api/composite/vector_compute_composite.h"`。 | ||
| 30 | + | ||
| 31 | +**`asc_axpy_sync`接口已废弃,请使用[对应的非同步接口](../vector_compute/vector_fused/asc_axpy.md)和同步接口[asc_sync](../sync/asc_sync.md)替代。** | ||
| 32 | + | ||
| 33 | +源操作数src中每个元素与标量value求积后和目的操作数dst中的对应元素相加计算公式如下: | ||
| 34 | + | ||
| 35 | +$$ | ||
| 36 | +dst_i = src_i * value + dst_i | ||
| 37 | +$$ | ||
| 38 | + | ||
| 39 | +## 函数原型 | ||
| 40 | + | ||
| 41 | +- 同步计算 | ||
| 42 | + | ||
| 43 | + ```cpp | ||
| 44 | + __aicore__ inline void asc_axpy_sync(__ubuf__ half* dst, __ubuf__ half* src, half value, uint32_t count) | ||
| 45 | + __aicore__ inline void asc_axpy_sync(__ubuf__ float* dst, __ubuf__ half* src, half value, uint32_t count) | ||
| 46 | + __aicore__ inline void asc_axpy_sync(__ubuf__ float* dst, __ubuf__ float* src, float value, uint32_t count) | ||
| 47 | + ``` | ||
| 48 | + | ||
| 49 | +## 参数说明 | ||
| 50 | + | ||
| 51 | +**表1** 参数说明 | ||
| 52 | + | ||
| 53 | +| 参数名 | 输入/输出 | 描述 | | ||
| 54 | +| --------- | ----- | ---------------- | | ||
| 55 | +| dst | 输出 | 目的操作数(矢量)的起始地址。 | | ||
| 56 | +| src | 输入 | 源操作数(矢量)的起始地址。 | | ||
| 57 | +| value | 输入 | 源操作数(标量)。 | | ||
| 58 | +| count | 输入 | 参与连续计算的元素个数。 | | ||
| 59 | + | ||
| 60 | +## 返回值说明 | ||
| 61 | + | ||
| 62 | +无 | ||
| 63 | + | ||
| 64 | +## 流水类型 | ||
| 65 | + | ||
| 66 | +PIPE_V | ||
| 67 | + | ||
| 68 | +## 约束说明 | ||
| 69 | + | ||
| 70 | +- 操作数地址重叠约束请参考[通用地址重叠约束](../general_description_and_constraints.md#通用地址重叠约束)。 | ||
| 71 | +- dst、src的起始地址需要32字节对齐。 | ||
| 72 | + | ||
| 73 | +## 调用示例 | ||
| 74 | + | ||
| 75 | +```cpp | ||
| 76 | +constexpr uint64_t total_length = 128; // total_length指参与计算的数据长度 | ||
| 77 | +half value = 10; | ||
| 78 | +__ubuf__ half src[total_length]; | ||
| 79 | +__ubuf__ half dst[total_length]; | ||
| 80 | +asc_axpy_sync(dst, src, value, total_length); | ||
| 81 | +``` | ||
| @@ -0,0 +1,72 @@ | |||
| 1 | +# asc_bfloat162float_sync(废弃) | ||
| 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 | +<!-- end id5 --> | ||
| 20 | +<!-- npu="310p" id6 --> | ||
| 21 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 22 | +<!-- end id6 --> | ||
| 23 | +<!-- npu="910" id7 --> | ||
| 24 | +- Atlas 训练系列产品:不支持 | ||
| 25 | +<!-- end id7 --> | ||
| 26 | + | ||
| 27 | +## 功能说明 | ||
| 28 | + | ||
| 29 | +头文件路径为:`"c_api/composite/vector_compute_composite.h"`。 | ||
| 30 | + | ||
| 31 | +**`asc_bfloat162float_sync`接口已废弃,请使用[对应的非同步接口](../vector_compute/vector_convert/asc_bfloat162float.md)和同步接口[asc_sync](../sync/asc_sync.md)替代。** | ||
| 32 | + | ||
| 33 | +将bfloat16_t类型数据转为float,无舍入模式。 | ||
| 34 | + | ||
| 35 | +## 函数原型 | ||
| 36 | + | ||
| 37 | +- 同步计算 | ||
| 38 | +```cpp | ||
| 39 | +__aicore__ inline void asc_bfloat162float_sync(__ubuf__ float* dst, __ubuf__ bfloat16_t* src, uint32_t count) | ||
| 40 | +``` | ||
| 41 | + | ||
| 42 | +## 参数说明 | ||
| 43 | + | ||
| 44 | +**表1** 参数说明 | ||
| 45 | + | ||
| 46 | +|参数名|输入/输出|描述| | ||
| 47 | +| ------------ | ------------ | ------------ | | ||
| 48 | +|dst|输出|目的操作数(矢量)的起始地址。| | ||
| 49 | +|src|输入|源操作数(矢量)的起始地址。| | ||
| 50 | +|count|输入|参与计算的元素个数。| | ||
| 51 | + | ||
| 52 | +## 返回值说明 | ||
| 53 | + | ||
| 54 | +无 | ||
| 55 | + | ||
| 56 | +## 流水类型 | ||
| 57 | + | ||
| 58 | +PIPE_V | ||
| 59 | + | ||
| 60 | +## 约束说明 | ||
| 61 | + | ||
| 62 | +- 操作数地址重叠约束请参考[通用地址重叠约束](../general_description_and_constraints.md#通用地址重叠约束)。 | ||
| 63 | +- dst、src的起始地址需要32字节对齐。 | ||
| 64 | + | ||
| 65 | +## 调用示例 | ||
| 66 | + | ||
| 67 | +```cpp | ||
| 68 | +constexpr uint32_t total_length = 256; | ||
| 69 | +__ubuf__ bfloat16_t src[total_length]; | ||
| 70 | +__ubuf__ float dst[total_length]; | ||
| 71 | +asc_bfloat162float_sync(dst, src, total_length); | ||
| 72 | +``` | ||
| @@ -0,0 +1,91 @@ | |||
| 1 | +# asc_bfloat162int32_sync(废弃) | ||
| 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 | +<!-- end id5 --> | ||
| 20 | +<!-- npu="310p" id6 --> | ||
| 21 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 22 | +<!-- end id6 --> | ||
| 23 | +<!-- npu="910" id7 --> | ||
| 24 | +- Atlas 训练系列产品:不支持 | ||
| 25 | +<!-- end id7 --> | ||
| 26 | + | ||
| 27 | +## 功能说明 | ||
| 28 | + | ||
| 29 | +头文件路径为:`"c_api/composite/vector_compute_composite.h"`。 | ||
| 30 | + | ||
| 31 | +**`asc_bfloat162int32_rn_sync`、`asc_bfloat162int32_rna_sync`、`asc_bfloat162int32_rd_sync`、`asc_bfloat162int32_ru_sync`和`asc_bfloat162int32_rz_sync`接口已废弃,请使用[对应的非同步接口](../vector_compute/vector_convert/asc_bfloat162int32.md)和同步接口[asc_sync](../sync/asc_sync.md)替代。** | ||
| 32 | + | ||
| 33 | +将bfloat16_t类型数据转换为int32_t类型,并支持多种舍入模式: | ||
| 34 | + | ||
| 35 | +- RINT舍入模式:四舍六入五成双舍入 | ||
| 36 | +- ROUND舍入模式:四舍五入舍入 | ||
| 37 | +- FLOOR舍入模式:向负无穷舍入 | ||
| 38 | +- CEIL舍入模式:向正无穷舍入 | ||
| 39 | +- TRUNC舍入模式:向零舍入 | ||
| 40 | + | ||
| 41 | +## 函数原型 | ||
| 42 | + | ||
| 43 | +- 同步计算 | ||
| 44 | + ```cpp | ||
| 45 | + // RINT舍入模式 | ||
| 46 | + __aicore__ inline void asc_bfloat162int32_rn_sync(__ubuf__ int32_t* dst, __ubuf__ bfloat16_t* src, uint32_t count) | ||
| 47 | + | ||
| 48 | + // ROUND舍入模式 | ||
| 49 | + __aicore__ inline void asc_bfloat162int32_rna_sync(__ubuf__ int32_t* dst, __ubuf__ bfloat16_t* src, uint32_t count) | ||
| 50 | + | ||
| 51 | + // FLOOR舍入模式 | ||
| 52 | + __aicore__ inline void asc_bfloat162int32_rd_sync(__ubuf__ int32_t* dst, __ubuf__ bfloat16_t* src, uint32_t count) | ||
| 53 | + | ||
| 54 | + // CEIL舍入模式 | ||
| 55 | + __aicore__ inline void asc_bfloat162int32_ru_sync(__ubuf__ int32_t* dst, __ubuf__ bfloat16_t* src, uint32_t count) | ||
| 56 | + | ||
| 57 | + // TRUNC舍入模式 | ||
| 58 | + __aicore__ inline void asc_bfloat162int32_rz_sync(__ubuf__ int32_t* dst, __ubuf__ bfloat16_t* src, uint32_t count) | ||
| 59 | + ``` | ||
| 60 | + | ||
| 61 | +## 参数说明 | ||
| 62 | + | ||
| 63 | +**表1** 参数说明 | ||
| 64 | + | ||
| 65 | +| 参数名 | 输入/输出 | 描述 | | ||
| 66 | +| :----| :-----| :-----| | ||
| 67 | +| dst | 输出 | 目的操作数(矢量)的起始地址。 | | ||
| 68 | +| src | 输入 | 源操作数(矢量)的起始地址。| | ||
| 69 | +| count | 输入 | 参与计算的元素个数。 | | ||
| 70 | + | ||
| 71 | +## 返回值说明 | ||
| 72 | + | ||
| 73 | +无 | ||
| 74 | + | ||
| 75 | +## 流水类型 | ||
| 76 | + | ||
| 77 | +PIPE_V | ||
| 78 | + | ||
| 79 | +## 约束说明 | ||
| 80 | + | ||
| 81 | +- dst、src的起始地址需要32字节对齐。 | ||
| 82 | +- 操作数地址重叠约束请参考[通用地址重叠约束](../general_description_and_constraints.md#通用地址重叠约束)。 | ||
| 83 | + | ||
| 84 | +## 调用示例 | ||
| 85 | + | ||
| 86 | +```cpp | ||
| 87 | +constexpr uint32_t total_length = 256; | ||
| 88 | +__ubuf__ bfloat16_t src[total_length]; | ||
| 89 | +__ubuf__ int32_t dst[total_length]; | ||
| 90 | +asc_bfloat162int32_rna_sync(dst, src, 128); | ||
| 91 | +``` | ||
| @@ -0,0 +1,76 @@ | |||
| 1 | +# asc_bitsort_sync(废弃) | ||
| 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 | +<!-- end id5 --> | ||
| 20 | +<!-- npu="310p" id6 --> | ||
| 21 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 22 | +<!-- end id6 --> | ||
| 23 | +<!-- npu="910" id7 --> | ||
| 24 | +- Atlas 训练系列产品:不支持 | ||
| 25 | +<!-- end id7 --> | ||
| 26 | + | ||
| 27 | +## 功能说明 | ||
| 28 | + | ||
| 29 | +头文件路径为:`"c_api/composite/vector_compute_composite.h"`。 | ||
| 30 | + | ||
| 31 | +**`asc_bitsort_sync`接口已废弃,请使用[对应的非同步接口](../vector_compute/vector_sort/asc_bitsort.md)和同步接口[asc_sync](../sync/asc_sync.md)替代。** | ||
| 32 | + | ||
| 33 | +位图排序函数,一次迭代可以完成32个元素的排序,数据按如下描述结构进行保存: | ||
| 34 | + | ||
| 35 | +Score和Index分别存储在src0和src1中,按Score进行排序(Score大的元素排前面),排序后的Score与其对应的Index一起以(Score,Index)的结构存储在dst中。 | ||
| 36 | + | ||
| 37 | +## 函数原型 | ||
| 38 | + | ||
| 39 | +- 同步计算 | ||
| 40 | + ```cpp | ||
| 41 | + __aicore__ inline void asc_bitsort_sync(__ubuf__ half* dst, __ubuf__ half* src0, __ubuf__ uint32_t* src1, int32_t repeat) | ||
| 42 | + __aicore__ inline void asc_bitsort_sync(__ubuf__ float* dst, __ubuf__ float* src0, __ubuf__ uint32_t* src1, int32_t repeat) | ||
| 43 | + ``` | ||
| 44 | + | ||
| 45 | +## 参数说明 | ||
| 46 | + | ||
| 47 | +**表1** 参数说明 | ||
| 48 | + | ||
| 49 | +| 参数名 | 输入/输出 | 描述 | | ||
| 50 | +| --------- | ----- | ----------------- | | ||
| 51 | +| dst | 输出 | 目的操作数(矢量)的起始地址。 | | ||
| 52 | +| src0 | 输入 | 源操作数(矢量)的起始地址。 | | ||
| 53 | +| src1 | 输入 | 源操作数(矢量)的起始地址。 | | ||
| 54 | +| repeat | 输入 | 重复迭代次数,每次迭代完成32个元素的排序,下次迭代src0和src1各跳过32个元素,dst跳过256 Byte空间。取值范围:[0, 255]。 | | ||
| 55 | + | ||
| 56 | +## 返回值说明 | ||
| 57 | + | ||
| 58 | +无 | ||
| 59 | + | ||
| 60 | +## 流水类型 | ||
| 61 | + | ||
| 62 | +PIPE_V | ||
| 63 | + | ||
| 64 | +## 约束说明 | ||
| 65 | + | ||
| 66 | +- 操作数地址重叠约束请参考[通用地址重叠约束](../general_description_and_constraints.md#通用地址重叠约束)。 | ||
| 67 | +- dst、src的起始地址需要32字节对齐。 | ||
| 68 | + | ||
| 69 | +## 调用示例 | ||
| 70 | + | ||
| 71 | +```cpp | ||
| 72 | +__ubuf__ half dst[256]; | ||
| 73 | +__ubuf__ half src0[256]; | ||
| 74 | +__ubuf__ uint32_t src1[256]; | ||
| 75 | +asc_bitsort_sync(dst, src0, src1, 8); | ||
| 76 | +``` | ||
| @@ -0,0 +1,83 @@ | |||
| 1 | +# asc_brcb_sync(废弃) | ||
| 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 | +<!-- end id5 --> | ||
| 20 | +<!-- npu="310p" id6 --> | ||
| 21 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 22 | +<!-- end id6 --> | ||
| 23 | +<!-- npu="910" id7 --> | ||
| 24 | +- Atlas 训练系列产品:不支持 | ||
| 25 | +<!-- end id7 --> | ||
| 26 | + | ||
| 27 | +## 功能说明 | ||
| 28 | + | ||
| 29 | +头文件路径为:`"c_api/composite/vector_compute_composite.h"`。 | ||
| 30 | + | ||
| 31 | +**`asc_brcb_sync`接口已废弃,请使用[对应的非同步接口](../vector_compute/vector_broadcast/asc_brcb.md)和同步接口[asc_sync](../sync/asc_sync.md)替代。** | ||
| 32 | + | ||
| 33 | +给定一个输入矢量,每一次取输入矢量中的8个数填充到结果矢量的8个datablock(32Bytes)中去,每个数对应一个datablock。 | ||
| 34 | + | ||
| 35 | +## 函数原型 | ||
| 36 | + | ||
| 37 | +- 同步高维切分计算 | ||
| 38 | + | ||
| 39 | + ```cpp | ||
| 40 | + __aicore__ inline void asc_brcb_sync(__ubuf__ uint16_t* dst, __ubuf__ uint16_t* src, uint16_t dst_block_stride, uint16_t dst_repeat_stride, uint8_t repeat) | ||
| 41 | + __aicore__ inline void asc_brcb_sync(__ubuf__ uint32_t* dst, __ubuf__ uint32_t* src, uint16_t dst_block_stride, uint16_t dst_repeat_stride, uint8_t repeat) | ||
| 42 | + ``` | ||
| 43 | + | ||
| 44 | +## 参数说明 | ||
| 45 | + | ||
| 46 | +**表1** 参数说明 | ||
| 47 | + | ||
| 48 | +| 参数名 | 输入/输出 | 描述 | | ||
| 49 | +| :--- | :--- | :--- | | ||
| 50 | +| dst | 输出 | 目的操作数(矢量)的起始地址。 | | ||
| 51 | +| src | 输入 | 源操作数(矢量)的起始地址。 | | ||
| 52 | +| dst_block_stride | 输入 | 目的操作数单次迭代内不同DataBlock间地址步长。 | | ||
| 53 | +| dst_repeat_stride | 输入 | 目的操作数相邻迭代间相同DataBlock的地址步长。 | | ||
| 54 | +| repeat | 输入 | 迭代次数。 | | ||
| 55 | + | ||
| 56 | +## 返回值说明 | ||
| 57 | + | ||
| 58 | +无 | ||
| 59 | + | ||
| 60 | +## 流水类型 | ||
| 61 | + | ||
| 62 | +PIPE_V | ||
| 63 | + | ||
| 64 | +## 约束说明 | ||
| 65 | + | ||
| 66 | +- 不支持src与dst为同一块内存地址。 | ||
| 67 | + | ||
| 68 | +## 调用示例 | ||
| 69 | + | ||
| 70 | +```cpp | ||
| 71 | +constexpr uint32_t src_length = 16; | ||
| 72 | +constexpr uint32_t dst_length = 256; | ||
| 73 | +__ubuf__ uint16_t src[src_length]; | ||
| 74 | +__ubuf__ uint16_t dst[dst_length]; | ||
| 75 | +asc_brcb_sync(dst, src, 1, 8, 2); | ||
| 76 | +``` | ||
| 77 | + | ||
| 78 | +结果示例: | ||
| 79 | + | ||
| 80 | +``` | ||
| 81 | +输入数据src:[1 2 3 ... 16] | ||
| 82 | +输出数据dst:[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ... 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16] | ||
| 83 | +``` | ||
| @@ -0,0 +1,81 @@ | |||
| 1 | +# asc_copy_gm2l0a_sync(废弃) | ||
| 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 | +<!-- end id5 --> | ||
| 20 | +<!-- npu="310p" id6 --> | ||
| 21 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 22 | +<!-- end id6 --> | ||
| 23 | +<!-- npu="910" id7 --> | ||
| 24 | +- Atlas 训练系列产品:不支持 | ||
| 25 | +<!-- end id7 --> | ||
| 26 | + | ||
| 27 | +## 功能说明 | ||
| 28 | + | ||
| 29 | +头文件路径为:`"c_api/composite/cube_datamove_composite.h"`。 | ||
| 30 | + | ||
| 31 | +**`asc_copy_gm2l0a_sync`接口已废弃,请使用[对应的非同步接口](../cube_datamove/asc_copy_gm2l0a.md)和同步接口[asc_sync](../sync/asc_sync.md)替代。** | ||
| 32 | + | ||
| 33 | +将数据从GM搬运到L0A Buffer。 | ||
| 34 | + | ||
| 35 | +## 函数原型 | ||
| 36 | + | ||
| 37 | +- 同步搬运 | ||
| 38 | + | ||
| 39 | + ```cpp | ||
| 40 | + __aicore__ inline void asc_copy_gm2l0a_sync(__ca__ bfloat16_t* dst, __gm__ bfloat16_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 41 | + __aicore__ inline void asc_copy_gm2l0a_sync(__ca__ half* dst, __gm__ half* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 42 | + __aicore__ inline void asc_copy_gm2l0a_sync(__ca__ float* dst, __gm__ float* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 43 | + __aicore__ inline void asc_copy_gm2l0a_sync(__ca__ int32_t* dst, __gm__ int32_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 44 | + __aicore__ inline void asc_copy_gm2l0a_sync(__ca__ uint8_t* dst, __gm__ uint8_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 45 | + __aicore__ inline void asc_copy_gm2l0a_sync(__ca__ int8_t* dst, __gm__ int8_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 46 | + __aicore__ inline void asc_copy_gm2l0a_sync(__ca__ uint32_t* dst, __gm__ uint32_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 47 | + __aicore__ inline void asc_copy_gm2l0a_sync(__ca__ int4b_t* dst, __gm__ int4b_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 48 | + ``` | ||
| 49 | + | ||
| 50 | +## 参数说明 | ||
| 51 | + | ||
| 52 | +**表1** 参数说明 | ||
| 53 | + | ||
| 54 | +| 参数名 |输入/输出| 描述 | | ||
| 55 | +|-----| ------------ |-----------------------------------------------------------| | ||
| 56 | +| dst | 输出 | 目的操作数起始地址。 | | ||
| 57 | +| src | 输入 | 源操作数起始地址。 | | ||
| 58 | +| base_idx | 输入 | 分形矩阵ID,搬运起始位置为源操作数的第几个分形(0为源操作数中第1个分形矩阵)。取值范围:[0, 65535]。 | | ||
| 59 | +| repeat | 输入 | 迭代次数,每个迭代可以处理512B数据。取值范围:[1, 255]。 | | ||
| 60 | +| src_stride | 输入 | 相邻迭代间,源操作数前一个分形与后一个分形起始地址的间隔,单位:512B。取值范围:[0, 65535]。 | | ||
| 61 | +| dst_gap | 输入 | 相邻迭代间,目的操作数前一个迭代第一个分形的结束地址到下一个迭代第一个分形起始地址的间隔。单位:512B。取值范围:[0, 65535]。 | | ||
| 62 | + | ||
| 63 | +## 返回值说明 | ||
| 64 | + | ||
| 65 | +无 | ||
| 66 | + | ||
| 67 | +## 流水类型 | ||
| 68 | + | ||
| 69 | +PIPE_MTE2 | ||
| 70 | + | ||
| 71 | +## 约束说明 | ||
| 72 | + | ||
| 73 | +- 各存储单元的空间大小和对齐要求请参考[存储单元说明](../general_description_and_constraints.md#存储单元说明)。 | ||
| 74 | +- 操作数地址重叠约束请参考[通用地址重叠约束](../general_description_and_constraints.md#通用地址重叠约束)。 | ||
| 75 | + | ||
| 76 | +## 调用示例 | ||
| 77 | +```cpp | ||
| 78 | +__ca__ half dst[256]; | ||
| 79 | +// src表示源操作数的起始地址 | ||
| 80 | +asc_copy_gm2l0a_sync(dst, src, 0, 1, 64, 64); | ||
| 81 | +``` | ||
| @@ -0,0 +1,88 @@ | |||
| 1 | +# asc_copy_gm2l0b_sync(废弃) | ||
| 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 | +<!-- end id5 --> | ||
| 20 | +<!-- npu="310p" id6 --> | ||
| 21 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 22 | +<!-- end id6 --> | ||
| 23 | +<!-- npu="910" id7 --> | ||
| 24 | +- Atlas 训练系列产品:不支持 | ||
| 25 | +<!-- end id7 --> | ||
| 26 | + | ||
| 27 | +## 功能说明 | ||
| 28 | + | ||
| 29 | +头文件路径为:`"c_api/composite/cube_datamove_composite.h"`。 | ||
| 30 | + | ||
| 31 | +**`asc_copy_gm2l0b_sync`接口已废弃,请使用[对应的非同步接口](../cube_datamove/asc_copy_gm2l0b.md)和同步接口[asc_sync](../sync/asc_sync.md)替代。** | ||
| 32 | + | ||
| 33 | +将矩阵数据从Global Memory搬运到L0B Buffer。 | ||
| 34 | + | ||
| 35 | +## 函数原型 | ||
| 36 | + | ||
| 37 | +- 同步搬运 | ||
| 38 | + | ||
| 39 | + ```cpp | ||
| 40 | + __aicore__ inline void asc_copy_gm2l0b_sync(__cb__ int4b_t* dst, __gm__ int4b_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 41 | + __aicore__ inline void asc_copy_gm2l0b_sync(__cb__ int8_t* dst, __gm__ int8_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 42 | + __aicore__ inline void asc_copy_gm2l0b_sync(__cb__ uint8_t* dst, __gm__ uint8_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 43 | + __aicore__ inline void asc_copy_gm2l0b_sync(__cb__ half* dst, __gm__ half* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 44 | + __aicore__ inline void asc_copy_gm2l0b_sync(__cb__ bfloat16_t* dst, __gm__ bfloat16_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 45 | + __aicore__ inline void asc_copy_gm2l0b_sync(__cb__ int32_t* dst, __gm__ int32_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 46 | + __aicore__ inline void asc_copy_gm2l0b_sync(__cb__ uint32_t* dst, __gm__ uint32_t* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 47 | + __aicore__ inline void asc_copy_gm2l0b_sync(__cb__ float* dst, __gm__ float* src, uint16_t base_idx, uint8_t repeat, uint16_t src_stride, uint16_t dst_gap) | ||
| 48 | + ``` | ||
| 49 | + | ||
| 50 | +## 参数说明 | ||
| 51 | + | ||
| 52 | +**表1** 参数说明 | ||
| 53 | + | ||
| 54 | +| 参数名 | 输入/输出 | 描述 | | ||
| 55 | +| :----- | :------- | :------- | | ||
| 56 | +| dst | 输出 | 目的操作数(矢量)的起始地址。 | | ||
| 57 | +| src | 输入 | 源操作数(矢量)的起始地址。 | | ||
| 58 | +| base_idx | 输入 | 以16*16个数对矩阵进行分块,搬运的起始分块ID。 | | ||
| 59 | +| repeat | 输入 | 迭代次数。 | | ||
| 60 | +| src_stride |输入| 相邻迭代间,源操作数前一个分形与后一个分形起始地址的间隔。 | | ||
| 61 | +| dst_gap | 输入 | 相邻迭代间,目的操作数前一个迭代第一个分形的结束地址到下一个迭代第一个分形起始地址的间隔。 | | ||
| 62 | + | ||
| 63 | +## 返回值说明 | ||
| 64 | + | ||
| 65 | +无 | ||
| 66 | + | ||
| 67 | +## 流水类型 | ||
| 68 | + | ||
| 69 | +PIPE_MTE2 | ||
| 70 | + | ||
| 71 | +## 约束说明 | ||
| 72 | + | ||
| 73 | +- 各存储单元的空间大小和对齐要求请参考[存储单元说明](../general_description_and_constraints.md#存储单元说明)。 | ||
| 74 | + | ||
| 75 | +## 调用示例 | ||
| 76 | + | ||
| 77 | +```cpp | ||
| 78 | +//搬运的起始分块为1 | ||
| 79 | +constexpr uint16_t base_idx = 1; | ||
| 80 | +//搬运的迭代次数为2 | ||
| 81 | +constexpr uint8_t repeat = 2; | ||
| 82 | +//输入的搬运步长为0字节,输出的搬运步长为1024字节 | ||
| 83 | +constexpr uint16_t src_stride = 0; | ||
| 84 | +constexpr uint16_t dst_gap = 1; | ||
| 85 | +// src表示源操作数的起始地址 | ||
| 86 | +__cb__ half dst[256]; | ||
| 87 | +asc_copy_gm2l0b_sync(dst, src, base_idx, repeat, src_stride, dst_gap); | ||
| 88 | +``` | ||
| @@ -0,0 +1,319 @@ | |||
| 1 | +# asc_copy_gm2l1_align_sync(废弃) | ||
| 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 | +<!-- end id5 --> | ||
| 20 | +<!-- npu="310p" id6 --> | ||
| 21 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 22 | +<!-- end id6 --> | ||
| 23 | +<!-- npu="910" id7 --> | ||
| 24 | +- Atlas 训练系列产品:不支持 | ||
| 25 | +<!-- end id7 --> | ||
| 26 | + | ||
| 27 | +## 功能说明 | ||
| 28 | + | ||
| 29 | +头文件路径为:`"c_api/composite/cube_datamove_composite.h"`。 | ||
| 30 | + | ||
| 31 | +**`asc_copy_gm2l1_align_sync`接口已废弃,请使用[对应的非同步接口](../cube_datamove/asc_copy_gm2l1_align.md)和同步接口[asc_sync](../sync/asc_sync.md)替代。** | ||
| 32 | + | ||
| 33 | +将数据从Global Memory搬运到L1 Buffer,提供非32B对齐搬运能力,搬运过程中对支持对数据进行padding。 | ||
| 34 | + | ||
| 35 | +若搬运数据长度非32字节对齐,会将搬运数据补齐至32字节对齐。可通过配置参数`burst_dst_stride`选择Normal模式或Compact模式。非32字节对齐场景支持以下两种填充方式: | ||
| 36 | + | ||
| 37 | +- 手动填充:搬运前调用[asc_set_gm2l1_pad](../cube_datamove/asc_set_gm2l1_pad.md)设置填充值,并将`data_select_bit`设置为`true`。 | ||
| 38 | +- 自动填充:将`data_select_bit`设置为`false`,由硬件自动填充dummy假数据,dummy假数据的值为数据块的第一个元素的值。 | ||
| 39 | + | ||
| 40 | +数据搬运模式说明如下: | ||
| 41 | + | ||
| 42 | +- Compact模式:将`burst_dst_stride`设置为`len_burst`,并将`left_padding_count`和`right_padding_count`设置为0。多个数据块在L1中紧密排列,在32字节补齐处理上被视为一个整体;若所有数据块的总长度,即`n_burst *len_burst`非32字节对齐,则仅在整体末尾通过上述手动或自动填充方式补齐至32字节对齐。填充数据的数据量为`32 - n_burst * len_burst % 32`,单位为字节。 | ||
| 43 | +- Normal模式:将`burst_dst_stride`设置为不等于`len_burst`且满足32字节对齐的值。相邻目的数据块的首地址间隔由`burst_dst_stride`指定,数据块之间可以预留间隔,无需紧密排列。 | ||
| 44 | + - 当`left_padding_count`和`right_padding_count`均为0时,通过上述手动或自动填充方式将每个数据块分别补齐至32字节对齐。每个数据块填充数据的数据量为`32 - len_burst % 32`,单位为字节。 | ||
| 45 | + - 当`left_padding_count`或`right_padding_count`非0时,即为左右填充模式。`data_select_bit`不生效,必须在搬运前调用`asc_set_gm2l1_pad`配置填充值。若数据块长度与左右Padding的总字节数非32字节对齐,硬件会在右侧继续填充dummy假数据至32字节对齐,dummy假数据的值为`asc_set_gm2l1_pad`配置的值。 | ||
| 46 | + | ||
| 47 | +例如,搬运3个`len_burst`为48字节的数据块时: | ||
| 48 | + | ||
| 49 | +- Normal模式下将`burst_dst_stride`设置为64,各数据块在L1中的起始偏移依次为0、64、128,每个数据块分别补充16字节填充数据。 | ||
| 50 | + | ||
| 51 | + **图1** Normal填充模式示意图 | ||
| 52 | + | ||
| 53 | +  | ||
| 54 | + | ||
| 55 | +- Compact模式下将`burst_dst_stride`设置为48,各数据块在L1中的起始偏移依次为0、48、96,仅在144字节有效数据的末尾补充16字节填充数据。 | ||
| 56 | + | ||
| 57 | + **图2** Compact填充模式示意图 | ||
| 58 | + | ||
| 59 | +  | ||
| 60 | + | ||
| 61 | +当只搬运1个数据块,或`len_burst`已经32字节对齐且无左右Padding时,两种模式的搬运结果相同。 | ||
| 62 | + | ||
| 63 | +循环填充模式即支持多次循环调用Normal填充模式与Compact填充模式,不支持多次循环调用左右填充模式。必须配合[asc_set_gm2l1_loop_size](../cube_datamove/asc_set_gm2l1_loop_size.md)、[asc_set_gm2l1_loop1_stride](../cube_datamove/asc_set_gm2l1_loop1_stride.md)、[asc_set_gm2l1_loop2_stride](../cube_datamove/asc_set_gm2l1_loop2_stride.md)使用,通过上述接口配置loop1/loop2的搬运次数与源/目步长。 | ||
| 64 | + | ||
| 65 | +本接口仅在AIC上执行有效。 | ||
| 66 | + | ||
| 67 | +## 函数原型 | ||
| 68 | + | ||
| 69 | +```c | ||
| 70 | +// 占位符形式 | ||
| 71 | +__aicore__ inline void asc_copy_gm2l1_align_sync(__cbuf__ <dtype>* dst, | ||
| 72 | + __gm__ <dtype>* src, | ||
| 73 | + uint32_t n_burst, | ||
| 74 | + uint32_t len_burst, | ||
| 75 | + uint8_t left_padding_count, | ||
| 76 | + uint8_t right_padding_count, | ||
| 77 | + bool data_select_bit, | ||
| 78 | + uint8_t l2_cache_ctl, | ||
| 79 | + uint64_t burst_src_stride, | ||
| 80 | + uint32_t burst_dst_stride) | ||
| 81 | +``` | ||
| 82 | + | ||
| 83 | +### dtype支持的数据类型 | ||
| 84 | + | ||
| 85 | +dtype取值为:`int8_t`、`uint8_t`、`hifloat8_t`、`int16_t`、`uint16_t`、`half`、`bfloat16_t`、`int32_t`、`uint32_t`、`float`。 | ||
| 86 | + | ||
| 87 | +## 参数说明 | ||
| 88 | + | ||
| 89 | +**表1** 参数说明 | ||
| 90 | + | ||
| 91 | +| 参数名 | 输入/输出 | 描述 | | ||
| 92 | +|---|---|---| | ||
| 93 | +| dst | 输出 | 目的操作数,存储位置为L1 Buffer。目的地址需32字节对齐。 | | ||
| 94 | +| src | 输入 | 源操作数,存储位置为GM。源地址需1字节对齐。 | | ||
| 95 | +| n_burst | 输入 | 待搬运的连续数据块个数。取值范围:[1, $2^{21}-1$]。 | | ||
| 96 | +| len_burst | 输入 | 待搬运的每个连续数据块的长度,单位字节。取值范围:[1, $2^{21}-1$]。需满足dtype字节对齐:dtype为`b16`类型时len_burst需为2的倍数,dtype为`b32`时len_burst需为4的倍数。 | | ||
| 97 | +| left_padding_count | 输入 | 左侧填充元素个数。填充字节数需满足`left_padding_count × sizeof(dtype) ≤ 32`字节,对应dtype上限:dtype为`b8`时取值范围:[0, 32],dtype为`b16`时取值范围:[0, 16],dtype为`b32`时取值范围:[0, 8]。 | | ||
| 98 | +| right_padding_count | 输入 | 右侧填充元素个数。填充字节数需满足`right_padding_count × sizeof(dtype) ≤ 32`字节,对应dtype上限:dtype为`b8`时取值范围:[0, 32],dtype为`b16`时取值范围:[0, 16],dtype为`b32`时取值范围:[0, 8]。 | | ||
| 99 | +| data_select_bit | 输入 | 填充数据来源选择。<br> • `false`:首元素填充模式,填充数据取每个burst的首元素;<br> • `true`:常量填充模式,填充数据取[asc_set_gm2l1_pad](../cube_datamove/asc_set_gm2l1_pad.md)预先配置的填充值。当`left_padding_count`与`right_padding_count`至少有一个非0时,硬件强制使用预先配置的常量填充值,本参数设置无效。 | | ||
| 100 | +| l2_cache_ctl | 输入 | 配置数据在L2 Cache中的管理策略。取值说明请参见[表2](#l2_cache_ctl_values)。 | | ||
| 101 | +| burst_src_stride | 输入 | 相邻连续数据块在源端(Global Memory)的步长,单位字节。取值范围:[1, $2^{40}-1$]。 | | ||
| 102 | +| burst_dst_stride | 输入 | 相邻连续数据块在目的端(L1 Buffer)的步长,单位字节。取值范围:[1, $2^{21}-1$]。当`burst_dst_stride`不等于`len_burst`时(即存在padding),`burst_dst_stride`需32字节对齐,否则触发异常(即使`n_burst`为1)。 | | ||
| 103 | + | ||
| 104 | +**表2** `l2_cache_ctl`取值说明 <a id="l2_cache_ctl_values"></a> | ||
| 105 | + | ||
| 106 | +| 取值 | 模式 | 含义 | | ||
| 107 | +|------|------|------| | ||
| 108 | +| 0 | Normal模式 | 启用L2 Cache,并将分配的Cache Line标记为高替换优先级。 | | ||
| 109 | +| 1 | Last模式 | • 启用L2 Cache,并将分配的Cache Line标记为低替换优先级。<br>• **Last模式暂不支持。**| | ||
| 110 | +| 2 | Persistent模式 | • 启用L2 Cache。已存入L2 Cache中的数据可能被替换,若需确保特定GM的数据始终保留在L2 Cache中,可采用驻留模式。<br>• 被标记为驻留模式的Cache Line只能被其他同样标记为驻留模式的Cache Line替换。<br>• **Persistent模式暂不支持。**| | ||
| 111 | +| 4 | Disable模式 | 不启用L2 Cache,每次都直接从GM中读取,并保持已有Cache Line的状态不变。 | | ||
| 112 | + | ||
| 113 | +## 返回值说明 | ||
| 114 | + | ||
| 115 | +无 | ||
| 116 | + | ||
| 117 | +## 流水类型 | ||
| 118 | + | ||
| 119 | +PIPE_MTE2 | ||
| 120 | + | ||
| 121 | +## 约束说明 | ||
| 122 | + | ||
| 123 | +### 通用约束 | ||
| 124 | + | ||
| 125 | +- 本接口非AIC调用直接返回。 | ||
| 126 | +- `dst`起始地址需32字节对齐(L1 Buffer对齐要求),否则触发异常。 | ||
| 127 | +- `src`起始地址需1字节对齐(Global Memory对齐要求),不满足触发异常。 | ||
| 128 | +- 如果本指令与其他指令存在目的地址重叠,需要插入同步指令([asc_sync_notify](../sync/asc_sync_notify.md)和[asc_sync_wait](../sync/asc_sync_wait.md)),保证多个指令串行化,防止出现异常数据。 | ||
| 129 | +- L1 Buffer容量上限:L1 Buffer总容量512KB,dst偏移与搬运大小之和不可越界,否则触发目的地址越界异常。 | ||
| 130 | +- `len_burst`、`n_burst`、`burst_src_stride`、`burst_dst_stride`、`left_padding_count`与`right_padding_count`需满足参数说明的取值范围,否则会导致搬运结果不符合预期。 | ||
| 131 | +- `data_select_bit`设置为true时,或者左右填充模式(`left_padding_count`和`right_padding_count`任意不为0)时,须先调用[asc_set_gm2l1_pad](../cube_datamove/asc_set_gm2l1_pad.md)配置填充值。 | ||
| 132 | + | ||
| 133 | +### Normal填充模式约束 | ||
| 134 | + | ||
| 135 | +- 当`burst_dst_stride`不等于`len_burst`时,`burst_dst_stride`需32字节对齐,否则触发异常,该约束即使`n_burst`为1仍生效。 | ||
| 136 | + | ||
| 137 | +### 左右填充模式约束 | ||
| 138 | + | ||
| 139 | +- 左右填充模式下,`left_padding_count×sizeof(dtype) + right_padding_count×sizeof(dtype) + len_burst + pad`需32字节对齐,其中`pad`为不满足32字节对齐需要填充的部分,填充值不受`data_select_bit`控制,必须先调用[asc_set_gm2l1_pad](../cube_datamove/asc_set_gm2l1_pad.md)配置填充值。 | ||
| 140 | + | ||
| 141 | +### 循环填充模式约束 | ||
| 142 | + | ||
| 143 | +- 循环填充模式不能和左右填充模式同时开启。 | ||
| 144 | +- 循环填充模式`loop1 dst stride`与`loop2 dst stride`必须32字节对齐,该约束即使loop size为1仍生效。 | ||
| 145 | + | ||
| 146 | +## 调用示例 | ||
| 147 | + | ||
| 148 | +以下示例一次覆盖三种填充模式。三个场景均搬运3个48字节数据块:Normal场景每块的尾部补齐16字节,Compact场景只在144字节有效数据的整体尾部补齐16字节,左右填充场景在每块的左侧填充4字节、右侧填充12字节。示例使用物理L1/UB地址在AIC和AIV间传递结果,并在Host侧逐字节比对结果。 | ||
| 149 | + | ||
| 150 | +将代码保存为`examples.asc`后,可通过`bisheng`命令编译运行,其中`--npu-arch`参数需根据实际产品型号指定对应的NPU架构,具体产品与NPU架构的映射关系请参考[`__NPU_ARCH__`](../../../../guide/programming_guide/language_extension/simd_builtin_keywords.md#npu-arch)。 | ||
| 151 | + | ||
| 152 | +<!-- npu="950" id8 --> | ||
| 153 | +以Ascend 950PR/Ascend 950DT产品(对应NPU架构为`dav-3510`)为例,编译运行命令如下: | ||
| 154 | + | ||
| 155 | +```bash | ||
| 156 | +bisheng example.asc -o main --npu-arch=dav-3510 && ./main | ||
| 157 | +``` | ||
| 158 | + | ||
| 159 | +```cpp | ||
| 160 | +#include <algorithm> | ||
| 161 | +#include <cstdint> | ||
| 162 | +#include <cstring> | ||
| 163 | +#include <iostream> | ||
| 164 | +#include <vector> | ||
| 165 | + | ||
| 166 | +#include "acl/acl.h" | ||
| 167 | +#include "c_api/asc_simd.h" | ||
| 168 | + | ||
| 169 | +namespace { | ||
| 170 | +constexpr uint32_t BURST_COUNT = 3; | ||
| 171 | +constexpr uint32_t BURST_BYTES = 48; | ||
| 172 | +constexpr uint32_t NORMAL_STRIDE = 64; | ||
| 173 | +constexpr uint32_t INPUT_BYTES = BURST_COUNT * BURST_BYTES; | ||
| 174 | +constexpr uint32_t NORMAL_OUTPUT_BYTES = BURST_COUNT * NORMAL_STRIDE; | ||
| 175 | +constexpr uint32_t COMPACT_OUTPUT_BYTES = 160; | ||
| 176 | +constexpr uint8_t PAD_BYTE = 0xA5; | ||
| 177 | +constexpr uint32_t PAD_DWORD = 0xA5A5A5A5; | ||
| 178 | +constexpr uint8_t LEFT_PADDING = 4; | ||
| 179 | +constexpr uint8_t RIGHT_PADDING = 12; | ||
| 180 | +constexpr int64_t CROSS_CORE_FLAG_ID = 0x8; | ||
| 181 | +constexpr uint64_t AIV_TO_AIC_SYNC_ID = 0x1; | ||
| 182 | +constexpr uint64_t AIC_TO_AIV_SYNC_ID = 0x2; | ||
| 183 | + | ||
| 184 | +enum class PaddingMode : uint32_t { NORMAL, COMPACT, LEFT_RIGHT }; | ||
| 185 | + | ||
| 186 | +__global__ __mix__(1, 2) void asc_copy_gm2l1_align_modes_kernel( // __mix__:一个AIC和两个AIV协同执行。 | ||
| 187 | + __gm__ uint8_t* output, __gm__ uint8_t* input, uint32_t mode) | ||
| 188 | +{ | ||
| 189 | + asc_init(); | ||
| 190 | + // AIC写L1、AIV写GM;跨核共享缓冲区使用物理地址,不能与数组形式的局部缓冲区混用。 | ||
| 191 | + __cbuf__ uint8_t* l1 = (__cbuf__ uint8_t*)asc_get_phy_buf_addr(0); | ||
| 192 | + __ubuf__ uint8_t* staging_ub = (__ubuf__ uint8_t*)asc_get_phy_buf_addr(0); | ||
| 193 | + __ubuf__ uint8_t* result_ub = (__ubuf__ uint8_t*)asc_get_phy_buf_addr(NORMAL_OUTPUT_BYTES); | ||
| 194 | + uint32_t output_bytes = NORMAL_OUTPUT_BYTES; | ||
| 195 | + | ||
| 196 | + if ASC_IS_AIV { | ||
| 197 | + const bool is_output_core = asc_get_sub_block_id() == 0; | ||
| 198 | + if (is_output_core) { | ||
| 199 | + // 初始化AIV侧物理UB,并确保其MTE2操作完成后再通知AIC。 | ||
| 200 | + asc_copy_gm2ub(staging_ub, input, INPUT_BYTES); | ||
| 201 | + asc_sync_notify(PIPE_MTE2, PIPE_MTE3, EVENT_ID0); | ||
| 202 | + asc_sync_wait(PIPE_MTE2, PIPE_MTE3, EVENT_ID0); | ||
| 203 | + asc_sync_intra_arrive(PIPE_MTE3, AIV_TO_AIC_SYNC_ID); | ||
| 204 | + } | ||
| 205 | + asc_sync_block_arrive(PIPE_MTE3, CROSS_CORE_FLAG_ID); | ||
| 206 | + if (is_output_core) { | ||
| 207 | + output_bytes = mode == static_cast<uint32_t>(PaddingMode::COMPACT) ? | ||
| 208 | + COMPACT_OUTPUT_BYTES : NORMAL_OUTPUT_BYTES; | ||
| 209 | + asc_sync_intra_wait(PIPE_MTE3, AIC_TO_AIV_SYNC_ID); | ||
| 210 | + asc_copy_ub2gm(output, result_ub, output_bytes); | ||
| 211 | + } | ||
| 212 | + } | ||
| 213 | + | ||
| 214 | + if ASC_IS_AIC { | ||
| 215 | + asc_sync_intra_wait(PIPE_MTE1, AIV_TO_AIC_SYNC_ID); | ||
| 216 | + asc_sync_block_wait(PIPE_MTE1, CROSS_CORE_FLAG_ID); | ||
| 217 | + asc_set_gm2l1_pad(PAD_DWORD); | ||
| 218 | + if (mode == static_cast<uint32_t>(PaddingMode::NORMAL)) { | ||
| 219 | + // Normal:dst stride为64B,每个48B burst尾部用该burst首字节填充16B。 | ||
| 220 | + asc_copy_gm2l1_align_sync(l1, input, BURST_COUNT, BURST_BYTES, 0, 0, false, | ||
| 221 | + 4, BURST_BYTES, NORMAL_STRIDE); | ||
| 222 | + } else if (mode == static_cast<uint32_t>(PaddingMode::COMPACT)) { | ||
| 223 | + // Compact:dst stride等于48B;仅在144B整体数据末尾用0xA5填充16B。 | ||
| 224 | + output_bytes = COMPACT_OUTPUT_BYTES; | ||
| 225 | + asc_copy_gm2l1_align_sync(l1, input, BURST_COUNT, BURST_BYTES, 0, 0, true, | ||
| 226 | + 4, BURST_BYTES, BURST_BYTES); | ||
| 227 | + } else { | ||
| 228 | + // 左右填充:每个burst为4B左填充 + 48B数据 + 12B右填充,强制使用0xA5。 | ||
| 229 | + asc_copy_gm2l1_align_sync(l1, input, BURST_COUNT, BURST_BYTES, LEFT_PADDING, RIGHT_PADDING, false, | ||
| 230 | + 4, BURST_BYTES, NORMAL_STRIDE); | ||
| 231 | + } | ||
| 232 | + // GM到L1在MTE2执行,L1到UB在MTE1执行;通过事件建立跨流水依赖。 | ||
| 233 | + asc_sync_notify(PIPE_MTE2, PIPE_MTE1, EVENT_ID0); | ||
| 234 | + asc_sync_wait(PIPE_MTE2, PIPE_MTE1, EVENT_ID0); | ||
| 235 | + // L1结果回读到另一个物理UB,交由AIV写回GM进行主机校验。 | ||
| 236 | + asc_copy_l12ub(result_ub, l1, 0, 1, output_bytes / 32, 0, 0); | ||
| 237 | + asc_sync_pipe(PIPE_MTE1); | ||
| 238 | + asc_sync_intra_arrive(PIPE_MTE1, AIC_TO_AIV_SYNC_ID); | ||
| 239 | + } | ||
| 240 | + asc_sync_pipe(PIPE_ALL); | ||
| 241 | +} | ||
| 242 | + | ||
| 243 | +std::vector<uint8_t> MakeInput() | ||
| 244 | +{ | ||
| 245 | + std::vector<uint8_t> input(INPUT_BYTES); | ||
| 246 | + for (uint32_t burst = 0; burst < BURST_COUNT; ++burst) { | ||
| 247 | + for (uint32_t i = 0; i < BURST_BYTES; ++i) { | ||
| 248 | + input[burst * BURST_BYTES + i] = static_cast<uint8_t>(0x10 * (burst + 1) + i); | ||
| 249 | + } | ||
| 250 | + } | ||
| 251 | + return input; | ||
| 252 | +} | ||
| 253 | + | ||
| 254 | +std::vector<uint8_t> MakeGolden(const std::vector<uint8_t>& input, PaddingMode mode) | ||
| 255 | +{ | ||
| 256 | + const uint32_t output_bytes = mode == PaddingMode::COMPACT ? COMPACT_OUTPUT_BYTES : NORMAL_OUTPUT_BYTES; | ||
| 257 | + std::vector<uint8_t> golden(output_bytes, PAD_BYTE); | ||
| 258 | + for (uint32_t burst = 0; burst < BURST_COUNT; ++burst) { | ||
| 259 | + const uint32_t src_offset = burst * BURST_BYTES; | ||
| 260 | + if (mode == PaddingMode::NORMAL) { | ||
| 261 | + const uint32_t dst_offset = burst * NORMAL_STRIDE; | ||
| 262 | + std::memcpy(golden.data() + dst_offset, input.data() + src_offset, BURST_BYTES); | ||
| 263 | + std::memset(golden.data() + dst_offset + BURST_BYTES, input[src_offset], NORMAL_STRIDE - BURST_BYTES); | ||
| 264 | + } else if (mode == PaddingMode::COMPACT) { | ||
| 265 | + std::memcpy(golden.data() + src_offset, input.data() + src_offset, BURST_BYTES); | ||
| 266 | + } else { | ||
| 267 | + const uint32_t dst_offset = burst * NORMAL_STRIDE; | ||
| 268 | + std::memcpy(golden.data() + dst_offset + LEFT_PADDING, input.data() + src_offset, BURST_BYTES); | ||
| 269 | + } | ||
| 270 | + } | ||
| 271 | + return golden; | ||
| 272 | +} | ||
| 273 | + | ||
| 274 | +const char* ModeName(PaddingMode mode) | ||
| 275 | +{ | ||
| 276 | + return mode == PaddingMode::NORMAL ? "normal" : | ||
| 277 | + (mode == PaddingMode::COMPACT ? "compact" : "left_right"); | ||
| 278 | +} | ||
| 279 | + | ||
| 280 | +bool RunMode(PaddingMode mode, const std::vector<uint8_t>& input, | ||
| 281 | + uint8_t* input_device, uint8_t* output_device) | ||
| 282 | +{ | ||
| 283 | + const std::vector<uint8_t> golden = MakeGolden(input, mode); | ||
| 284 | + std::vector<uint8_t> output(golden.size(), 0); | ||
| 285 | + asc_copy_gm2l1_align_modes_kernel<<<1, 0>>>(output_device, input_device, static_cast<uint32_t>(mode)); | ||
| 286 | + if (aclrtSynchronizeDevice() != ACL_SUCCESS || | ||
| 287 | + aclrtMemcpy(output.data(), output.size(), output_device, output.size(), ACL_MEMCPY_DEVICE_TO_HOST) != ACL_SUCCESS) { | ||
| 288 | + return false; | ||
| 289 | + } | ||
| 290 | + const bool passed = output == golden; | ||
| 291 | + std::cout << "RESULT mode=" << ModeName(mode) << " status=" << (passed ? "PASS" : "FAIL") | ||
| 292 | + << " output_bytes=" << output.size() << std::endl; | ||
| 293 | + return passed; | ||
| 294 | +} | ||
| 295 | +} // namespace | ||
| 296 | + | ||
| 297 | +int main() | ||
| 298 | +{ | ||
| 299 | + const std::vector<uint8_t> input = MakeInput(); | ||
| 300 | + uint8_t* input_device = nullptr; | ||
| 301 | + uint8_t* output_device = nullptr; | ||
| 302 | + if (aclInit(nullptr) != ACL_SUCCESS || aclrtSetDevice(0) != ACL_SUCCESS || | ||
| 303 | + aclrtMalloc(reinterpret_cast<void**>(&input_device), INPUT_BYTES, ACL_MEM_MALLOC_HUGE_FIRST) != ACL_SUCCESS || | ||
| 304 | + aclrtMalloc(reinterpret_cast<void**>(&output_device), NORMAL_OUTPUT_BYTES, ACL_MEM_MALLOC_HUGE_FIRST) != ACL_SUCCESS || | ||
| 305 | + aclrtMemcpy(input_device, INPUT_BYTES, input.data(), INPUT_BYTES, ACL_MEMCPY_HOST_TO_DEVICE) != ACL_SUCCESS) { | ||
| 306 | + return 1; | ||
| 307 | + } | ||
| 308 | + const bool passed = RunMode(PaddingMode::NORMAL, input, input_device, output_device) && | ||
| 309 | + RunMode(PaddingMode::COMPACT, input, input_device, output_device) && | ||
| 310 | + RunMode(PaddingMode::LEFT_RIGHT, input, input_device, output_device); | ||
| 311 | + std::cout << "SUMMARY total=3 passed=" << (passed ? 3 : 0) << std::endl; | ||
| 312 | + aclrtFree(output_device); | ||
| 313 | + aclrtFree(input_device); | ||
| 314 | + aclrtResetDevice(0); | ||
| 315 | + aclFinalize(); | ||
| 316 | + return passed ? 0 : 1; | ||
| 317 | +} | ||
| 318 | +``` | ||
| 319 | +<!-- end id8 --> | ||
| @@ -0,0 +1,255 @@ | |||
| 1 | +# asc_copy_gm2l1_dn2nz_sync(废弃) | ||
| 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 | +<!-- end id5 --> | ||
| 20 | +<!-- npu="310p" id6 --> | ||
| 21 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 22 | +<!-- end id6 --> | ||
| 23 | +<!-- npu="910" id7 --> | ||
| 24 | +- Atlas 训练系列产品:不支持 | ||
| 25 | +<!-- end id7 --> | ||
| 26 | + | ||
| 27 | +## 功能说明 | ||
| 28 | + | ||
| 29 | +头文件路径为:`"c_api/composite/cube_datamove_composite.h"`。 | ||
| 30 | + | ||
| 31 | +**`asc_copy_gm2l1_dn2nz_sync`接口已废弃,请使用[对应的非同步接口](../cube_datamove/asc_copy_gm2l1_dn2nz.md)和同步接口[asc_sync](../sync/asc_sync.md)替代。** | ||
| 32 | + | ||
| 33 | +将数据从Global Memory搬运到L1 Buffer,并在搬运过程中进行DN到Nz格式的转换,使其满足后续矩阵计算对分形列连续性的要求。 | ||
| 34 | + | ||
| 35 | +进行DN2Nz格式搬运前,需先通过[asc_set_gm2l1_nz_para](../cube_datamove/asc_set_gm2l1_nz_para.md)接口配置DN2Nz搬运的目的Nz矩阵步长与DN矩阵搬运个数。 | ||
| 36 | + | ||
| 37 | +本接口仅在AIC上执行有效。 | ||
| 38 | + | ||
| 39 | +如[图1](#dn2nz_equivalent_conversion)所示,DN到Nz的格式转换也等价于ND到Zn的格式转换,如果要进行ND到Zn的格式转换可采用此指令。 | ||
| 40 | + | ||
| 41 | +**图1** DN2Nz与ND2Zn示意图<a id="dn2nz_equivalent_conversion"></a> | ||
| 42 | + | ||
| 43 | + | ||
| 44 | + | ||
| 45 | +## 函数原型 | ||
| 46 | + | ||
| 47 | +### 模板原型(占位符形式) | ||
| 48 | + | ||
| 49 | +```cpp | ||
| 50 | +__aicore__ inline void asc_copy_gm2l1_dn2nz_sync(__cbuf__ <dtype>* dst, | ||
| 51 | + __gm__ <dtype>* src, | ||
| 52 | + uint64_t loop1_src_stride, | ||
| 53 | + uint8_t l2_cache_ctl, | ||
| 54 | + uint16_t n_value, | ||
| 55 | + uint32_t d_value, | ||
| 56 | + uint64_t loop4_src_stride, | ||
| 57 | + bool smallc0_en) | ||
| 58 | +``` | ||
| 59 | + | ||
| 60 | +### dtype支持的数据类型 | ||
| 61 | + | ||
| 62 | +dtype支持的数据类型为`int8_t`、`uint8_t`、`hifloat8_t`、`fp8_e5m2_t`、`fp8_e4m3fn_t`、`int16_t`、`uint16_t`、`half`、`bfloat16_t`、`int32_t`、`uint32_t`、`float`。 | ||
| 63 | + | ||
| 64 | +## 参数说明 | ||
| 65 | + | ||
| 66 | +**表1** 参数说明 | ||
| 67 | + | ||
| 68 | +| 参数名 | 输入/输出 | 描述 | | ||
| 69 | +|---|---|---| | ||
| 70 | +| dst | 输出 | 目的操作数,存储位置为L1 Buffer。目的地址需32字节对齐。 | | ||
| 71 | +| src | 输入 | 源操作数,存储位置为GM。起始地址需要按照1字节对齐。 | | ||
| 72 | +| loop1_src_stride | 输入 | 源操作数同一DN矩阵的相邻行起始地址间的偏移,单位字节。取值范围:[0, $2^{40}-1$]。 | | ||
| 73 | +| l2_cache_ctl | 输入 | 配置输入的GM数据在L2 Cache中的管理策略。取值需为已定义的策略(0/1/2/4之一),其他值触发L2 Cache策略异常。取值说明见[表2](#l2_cache_ctl_values)。 | | ||
| 74 | +| n_value | 输入 | 源矩阵中DN矩阵的列数,单位为元素。取值范围:[1, 65535]。 | | ||
| 75 | +| d_value | 输入 | 源矩阵中DN矩阵的行数,单位为元素。取值范围:[1, $2^{21}-1$]。 | | ||
| 76 | +| loop4_src_stride | 输入 | 源矩阵相邻DN矩阵起始地址间的偏移,单位为字节。取值范围:[0, $2^{40}-1$]。<br> • 源矩阵DN矩阵个数为1时,此参数无意义,设置为0即可。<br> • 源矩阵DN矩阵个数大于1时,当`loop4_src_stride = 0`时,表示重复搬出源矩阵的第一个DN矩阵。 | | ||
| 77 | +| smallc0_en | 输入 | SmallC0模式开关,仅当$d\_value \le 4$时可开启,否则导致搬运异常。<br> • `false`:不开启SmallC0模式,按标准Nz格式的C0(32字节)排布搬运;<br> • `true`:开启SmallC0模式,搬运过程中搬运的数据量不满足$4 \times \mathrm{sizeof}(\mathrm{dtype})$字节对齐时,硬件在目的矩阵中自动补0至$4 \times \mathrm{sizeof}(\mathrm{dtype})$字节对齐。 | | ||
| 78 | + | ||
| 79 | +**表2** `l2_cache_ctl`取值说明 <a id="l2_cache_ctl_values"></a> | ||
| 80 | + | ||
| 81 | +| 取值 | 模式 | 含义 | | ||
| 82 | +|------|------|------| | ||
| 83 | +| 0 | Normal模式 | 启用L2 Cache,并将分配的Cache Line标记为高替换优先级。 | | ||
| 84 | +| 1 | Last模式 | • 启用L2 Cache,并将分配的Cache Line标记为低替换优先级。<br>• **Last模式暂不支持。**| | ||
| 85 | +| 2 | Persistent模式 | • 启用L2 Cache。已存入L2 Cache中的数据可能被替换,若需确保特定GM的数据始终保留在L2 Cache中,可采用驻留模式。<br>• 被标记为驻留模式的Cache Line只能被其他同样标记为驻留模式的Cache Line替换。<br>• **Persistent模式暂不支持。**| | ||
| 86 | +| 4 | Disable模式 | 不启用L2 Cache,每次都直接从GM中读取,并保持已有Cache Line的状态不变。 | | ||
| 87 | + | ||
| 88 | +## 返回值说明 | ||
| 89 | + | ||
| 90 | +无 | ||
| 91 | + | ||
| 92 | +## 流水类型 | ||
| 93 | + | ||
| 94 | +PIPE_MTE2 | ||
| 95 | + | ||
| 96 | +## 约束说明 | ||
| 97 | + | ||
| 98 | +### 通用约束 | ||
| 99 | + | ||
| 100 | +- 本接口非AIC调用直接返回。 | ||
| 101 | +- `dst`的起始地址要求32字节对齐(L1 Buffer对齐要求),否则会导致搬运异常。 | ||
| 102 | +- `src`的起始地址要求1字节对齐(Global Memory对齐要求),否则会导致搬运异常。 | ||
| 103 | +- 如果本指令与其他指令存在目的地址重叠,需要插入同步指令([asc_sync_notify](../sync/asc_sync_notify.md)和[asc_sync_wait](../sync/asc_sync_wait.md)),保证多个指令串行化,防止出现异常数据。 | ||
| 104 | +- L1 Buffer容量上限:L1 Buffer总容量512KB,`dst`偏移量与搬运大小之和不可越界,否则触发异常。 | ||
| 105 | + | ||
| 106 | +### DN2Nz约束 | ||
| 107 | + | ||
| 108 | +- 调用本接口前,需要先调用[asc_set_gm2l1_nz_para](../cube_datamove/asc_set_gm2l1_nz_para.md)接口配置DN2Nz搬运的目的Nz矩阵步长与DN矩阵搬运个数。 | ||
| 109 | +- `loop1_src_stride`、`n_value`、`d_value`、`loop4_src_stride`取值需确保在取值范围内,超出取值范围的值会被截断,导致搬运结果不符合预期。 | ||
| 110 | +- `smallc0_en`设置为`true`时,$d\_value \le 4$,否则导致搬运异常。 | ||
| 111 | + | ||
| 112 | +## 调用示例 | ||
| 113 | + | ||
| 114 | +将代码保存为`examples.asc`后,可通过`bisheng`命令编译运行,其中`--npu-arch`参数需根据实际产品型号指定对应的NPU架构,具体产品与NPU架构的映射关系请参考[`__NPU_ARCH__`](../../../../guide/programming_guide/language_extension/simd_builtin_keywords.md#npu-arch)。 | ||
| 115 | + | ||
| 116 | +<!-- npu="950" id8 --> | ||
| 117 | +以Ascend 950PR/Ascend 950DT产品(对应NPU架构为`dav-3510`)为例,编译运行命令如下: | ||
| 118 | + | ||
| 119 | +```bash | ||
| 120 | +bisheng examples.asc -o main --npu-arch=dav-3510 && ./main | ||
| 121 | +``` | ||
| 122 | +<!-- end id8 --> | ||
| 123 | + | ||
| 124 | +样例单核占用64KB L1 Buffer、32KB L0A Buffer、32KB L0B Buffer和64KB L0C Buffer。样例依次复用`EVENT_ID0`完成MTE2到MTE1、MTE1到M、M到FIX的同步。基础API同类场景可参考[data_copy_gm2l1样例](../../../../../../examples/01_simd_cpp_api/03_basic_api/00_data_movement/data_copy_gm2l1)中的场景3。 | ||
| 125 | + | ||
| 126 | +```cpp | ||
| 127 | +#include <cstdint> | ||
| 128 | +#include <iostream> | ||
| 129 | +#include <vector> | ||
| 130 | +#include "c_api/asc_simd.h" | ||
| 131 | +#include "acl/acl.h" | ||
| 132 | + | ||
| 133 | +namespace { | ||
| 134 | +constexpr uint32_t M = 128; | ||
| 135 | +constexpr uint32_t K = 128; | ||
| 136 | +constexpr uint32_t N = 128; | ||
| 137 | +constexpr uint32_t ELEMENTS = M * N; | ||
| 138 | +constexpr uint32_t CUBE_M = 16; | ||
| 139 | +constexpr uint32_t CUBE_K = 16; | ||
| 140 | +constexpr uint16_t HALF_ONE = 0x3c00; | ||
| 141 | +constexpr uint16_t HALF_NEG_ONE = 0xbc00; | ||
| 142 | + | ||
| 143 | +__global__ __cube__ void AscCopyGm2l1Dn2nzKernel( | ||
| 144 | + __gm__ uint16_t* a, __gm__ uint16_t* b, __gm__ float* output) | ||
| 145 | +{ | ||
| 146 | + asc_init(); | ||
| 147 | + __cbuf__ half a_l1[M * K], b_l1[N * K]; | ||
| 148 | + __ca__ half a_l0[M * K]; | ||
| 149 | + __cb__ half b_l0[K * N]; | ||
| 150 | + __cc__ float c_l0[ELEMENTS]; | ||
| 151 | + | ||
| 152 | + // 输入A、B分别按[K, M]和[N, K]的DN格式存放,搬入后转换为Nz格式。 | ||
| 153 | + asc_set_gm2l1_nz_para(1, 1, 128, 0); | ||
| 154 | + asc_copy_gm2l1_dn2nz_sync(reinterpret_cast<__cbuf__ half*>(a_l1), reinterpret_cast<__gm__ half*>(a), | ||
| 155 | + M * sizeof(half), 0, M, K, 0, false); | ||
| 156 | + asc_set_gm2l1_nz_para(1, 1, 128, 0); | ||
| 157 | + asc_copy_gm2l1_dn2nz_sync(reinterpret_cast<__cbuf__ half*>(b_l1), reinterpret_cast<__gm__ half*>(b), | ||
| 158 | + K * sizeof(half), 0, K, N, 0, false); | ||
| 159 | + asc_sync_notify(PIPE_MTE2, PIPE_MTE1, EVENT_ID0); | ||
| 160 | + asc_sync_wait(PIPE_MTE2, PIPE_MTE1, EVENT_ID0); | ||
| 161 | + | ||
| 162 | + // 将Nz矩阵分别搬入L0A Buffer和L0B Buffer,供矩阵乘计算使用。 | ||
| 163 | + asc_copy_l12l0a(a_l0, a_l1, 0, 0, M / CUBE_M, K / CUBE_K, | ||
| 164 | + M / CUBE_M, M / CUBE_M); | ||
| 165 | + asc_copy_l12l0b_transpose(b_l0, b_l1, 0, 0, K / CUBE_M, N / CUBE_K, | ||
| 166 | + K / CUBE_M, N / CUBE_M); | ||
| 167 | + asc_sync_notify(PIPE_MTE1, PIPE_M, EVENT_ID0); | ||
| 168 | + asc_sync_wait(PIPE_MTE1, PIPE_M, EVENT_ID0); | ||
| 169 | + | ||
| 170 | + // 计算128 x 128矩阵乘,并将结果从L0C Buffer搬回Global Memory。 | ||
| 171 | + asc_mmad(c_l0, a_l0, b_l0, M, K, N, 0, false, false, true); | ||
| 172 | + asc_sync_notify(PIPE_M, PIPE_FIX, EVENT_ID0); | ||
| 173 | + asc_sync_wait(PIPE_M, PIPE_FIX, EVENT_ID0); | ||
| 174 | + asc_set_l0c_copy_nz_para(1, 0, 0); | ||
| 175 | + asc_copy_l0c2gm(output, c_l0, N, M, N, M, 0, 0, 0, | ||
| 176 | + static_cast<uint64_t>(QuantMode_t::NoQuant), 0, false, true, | ||
| 177 | + static_cast<uint64_t>(QuantMode_post::NoConv), 0, false, 0, false, false, false, false); | ||
| 178 | + asc_sync_pipe(PIPE_FIX); | ||
| 179 | +} | ||
| 180 | + | ||
| 181 | +uint16_t ToHalfBits(int32_t value) | ||
| 182 | +{ | ||
| 183 | + return value > 0 ? HALF_ONE : (value < 0 ? HALF_NEG_ONE : 0); | ||
| 184 | +} | ||
| 185 | + | ||
| 186 | +template <typename T> | ||
| 187 | +void PrintRow(const char* label, const std::vector<T>& data) | ||
| 188 | +{ | ||
| 189 | + std::cout << label << ':'; | ||
| 190 | + for (uint32_t i = 0; i < 8; ++i) { | ||
| 191 | + std::cout << ' ' << +data[i]; | ||
| 192 | + } | ||
| 193 | + std::cout << " ..." << std::endl; | ||
| 194 | +} | ||
| 195 | +} // namespace | ||
| 196 | + | ||
| 197 | +int main() | ||
| 198 | +{ | ||
| 199 | + // 在GM中按DN格式存放A和B,即分别存放A、B的转置矩阵。 | ||
| 200 | + std::vector<uint16_t> a(K * M), b(N * K); | ||
| 201 | + std::vector<float> output(ELEMENTS), golden(ELEMENTS); | ||
| 202 | + for (uint32_t row = 0; row < M; ++row) { | ||
| 203 | + for (uint32_t k = 0; k < K; ++k) { | ||
| 204 | + const int32_t value = static_cast<int32_t>((row + 2 * k) % 3) - 1; | ||
| 205 | + a[k * M + row] = ToHalfBits(value); | ||
| 206 | + } | ||
| 207 | + } | ||
| 208 | + for (uint32_t k = 0; k < K; ++k) { | ||
| 209 | + for (uint32_t col = 0; col < N; ++col) { | ||
| 210 | + const int32_t value = static_cast<int32_t>((2 * k + col) % 3) - 1; | ||
| 211 | + b[col * K + k] = ToHalfBits(value); | ||
| 212 | + } | ||
| 213 | + } | ||
| 214 | + for (uint32_t row = 0; row < M; ++row) { | ||
| 215 | + for (uint32_t col = 0; col < N; ++col) { | ||
| 216 | + int32_t sum = 0; | ||
| 217 | + for (uint32_t k = 0; k < K; ++k) { | ||
| 218 | + const int32_t a_value = static_cast<int32_t>((row + 2 * k) % 3) - 1; | ||
| 219 | + const int32_t b_value = static_cast<int32_t>((2 * k + col) % 3) - 1; | ||
| 220 | + sum += a_value * b_value; | ||
| 221 | + } | ||
| 222 | + golden[row * N + col] = static_cast<float>(sum); | ||
| 223 | + } | ||
| 224 | + } | ||
| 225 | + | ||
| 226 | + aclInit(nullptr); | ||
| 227 | + aclrtSetDevice(0); | ||
| 228 | + uint16_t *a_device = nullptr, *b_device = nullptr; | ||
| 229 | + float* output_device = nullptr; | ||
| 230 | + aclrtMalloc(reinterpret_cast<void**>(&a_device), a.size() * sizeof(uint16_t), ACL_MEM_MALLOC_HUGE_FIRST); | ||
| 231 | + aclrtMalloc(reinterpret_cast<void**>(&b_device), b.size() * sizeof(uint16_t), ACL_MEM_MALLOC_HUGE_FIRST); | ||
| 232 | + aclrtMalloc(reinterpret_cast<void**>(&output_device), output.size() * sizeof(float), ACL_MEM_MALLOC_HUGE_FIRST); | ||
| 233 | + aclrtMemcpy(a_device, a.size() * sizeof(uint16_t), a.data(), a.size() * sizeof(uint16_t), | ||
| 234 | + ACL_MEMCPY_HOST_TO_DEVICE); | ||
| 235 | + aclrtMemcpy(b_device, b.size() * sizeof(uint16_t), b.data(), b.size() * sizeof(uint16_t), | ||
| 236 | + ACL_MEMCPY_HOST_TO_DEVICE); | ||
| 237 | + AscCopyGm2l1Dn2nzKernel<<<1, 0>>>(a_device, b_device, output_device); | ||
| 238 | + aclrtSynchronizeDevice(); | ||
| 239 | + aclrtMemcpy(output.data(), output.size() * sizeof(float), output_device, | ||
| 240 | + output.size() * sizeof(float), ACL_MEMCPY_DEVICE_TO_HOST); | ||
| 241 | + | ||
| 242 | + PrintRow("Output row 0", output); | ||
| 243 | + PrintRow("Golden row 0", golden); | ||
| 244 | + const bool passed = output == golden; | ||
| 245 | + std::cout << (passed ? "[Success] asc_copy_gm2l1_dn2nz preserved the MMAD operands/result." | ||
| 246 | + : "[Failed] asc_copy_gm2l1_dn2nz result mismatch.") << std::endl; | ||
| 247 | + | ||
| 248 | + aclrtFree(a_device); | ||
| 249 | + aclrtFree(b_device); | ||
| 250 | + aclrtFree(output_device); | ||
| 251 | + aclrtResetDevice(0); | ||
| 252 | + aclFinalize(); | ||
| 253 | + return passed ? 0 : 1; | ||
| 254 | +} | ||
| 255 | +``` | ||
Adocs/zh/api/SIMD-API/c_api/deprecated_interface/asc_copy_gm2l1_nd2nz_sync_arch_2201_deprecated.md+121-0
| @@ -0,0 +1,121 @@ | |||
| 1 | +# asc_copy_gm2l1_nd2nz_sync_arch_2201(废弃) | ||
| 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 | +<!-- end id5 --> | ||
| 20 | +<!-- npu="310p" id6 --> | ||
| 21 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 22 | +<!-- end id6 --> | ||
| 23 | +<!-- npu="910" id7 --> | ||
| 24 | +- Atlas 训练系列产品:不支持 | ||
| 25 | +<!-- end id7 --> | ||
| 26 | + | ||
| 27 | +## 功能说明 | ||
| 28 | + | ||
| 29 | +头文件路径为:`"c_api/composite/cube_datamove_composite.h"`。 | ||
| 30 | + | ||
| 31 | +**`asc_copy_gm2l1_nd2nz_sync`接口已废弃,请使用[对应的非同步接口](../cube_datamove/asc_copy_gm2l1_nd2nz/asc_copy_gm2l1_nd2nz_arch_2201.md)和同步接口[asc_sync](../sync/asc_sync.md)替代。** | ||
| 32 | + | ||
| 33 | +将数据从Global Memory (GM)搬运到Level 1 cache (L1),支持在数据搬运时进行ND格式到NZ格式的转换。 | ||
| 34 | + | ||
| 35 | +## 函数原型 | ||
| 36 | + | ||
| 37 | +- 同步搬运 | ||
| 38 | + | ||
| 39 | + ```cpp | ||
| 40 | + __aicore__ inline void asc_copy_gm2l1_nd2nz_sync(__cbuf__ int8_t* dst, __gm__ int8_t* src, uint16_t nd_num, | ||
| 41 | + uint16_t n_value, uint16_t d_value, uint16_t src_nd_matrix_stride, uint16_t src_d_value, uint16_t dst_nz_c0_stride, | ||
| 42 | + uint16_t dst_nz_n_stride, uint16_t dst_nz_matrix_stride) | ||
| 43 | + __aicore__ inline void asc_copy_gm2l1_nd2nz_sync(__cbuf__ uint8_t* dst, __gm__ uint8_t* src, uint16_t nd_num, | ||
| 44 | + uint16_t n_value, uint16_t d_value, uint16_t src_nd_matrix_stride, uint16_t src_d_value, uint16_t dst_nz_c0_stride, | ||
| 45 | + uint16_t dst_nz_n_stride, uint16_t dst_nz_matrix_stride) | ||
| 46 | + __aicore__ inline void asc_copy_gm2l1_nd2nz_sync(__cbuf__ bfloat16_t* dst, __gm__ bfloat16_t* src, uint16_t nd_num, | ||
| 47 | + uint16_t n_value, uint16_t d_value, uint16_t src_nd_matrix_stride, uint16_t src_d_value, uint16_t dst_nz_c0_stride, | ||
| 48 | + uint16_t dst_nz_n_stride, uint16_t dst_nz_matrix_stride) | ||
| 49 | + __aicore__ inline void asc_copy_gm2l1_nd2nz_sync(__cbuf__ half* dst, __gm__ half* src, uint16_t nd_num, | ||
| 50 | + uint16_t n_value, uint16_t d_value, uint16_t src_nd_matrix_stride, uint16_t src_d_value, uint16_t dst_nz_c0_stride, | ||
| 51 | + uint16_t dst_nz_n_stride, uint16_t dst_nz_matrix_stride) | ||
| 52 | + __aicore__ inline void asc_copy_gm2l1_nd2nz_sync(__cbuf__ int16_t* dst, __gm__ int16_t* src, uint16_t nd_num, | ||
| 53 | + uint16_t n_value, uint16_t d_value, uint16_t src_nd_matrix_stride, uint16_t src_d_value, uint16_t dst_nz_c0_stride, | ||
| 54 | + uint16_t dst_nz_n_stride, uint16_t dst_nz_matrix_stride) | ||
| 55 | + __aicore__ inline void asc_copy_gm2l1_nd2nz_sync(__cbuf__ float* dst, __gm__ float* src, uint16_t nd_num, | ||
| 56 | + uint16_t n_value, uint16_t d_value, uint16_t src_nd_matrix_stride, uint16_t src_d_value, uint16_t dst_nz_c0_stride, | ||
| 57 | + uint16_t dst_nz_n_stride, uint16_t dst_nz_matrix_stride) | ||
| 58 | + __aicore__ inline void asc_copy_gm2l1_nd2nz_sync(__cbuf__ int32_t* dst, __gm__ int32_t* src, uint16_t nd_num, | ||
| 59 | + uint16_t n_value, uint16_t d_value, uint16_t src_nd_matrix_stride, uint16_t src_d_value, uint16_t dst_nz_c0_stride, | ||
| 60 | + uint16_t dst_nz_n_stride, uint16_t dst_nz_matrix_stride) | ||
| 61 | + __aicore__ inline void asc_copy_gm2l1_nd2nz_sync(__cbuf__ uint32_t* dst, __gm__ uint32_t* src, uint16_t nd_num, | ||
| 62 | + uint16_t n_value, uint16_t d_value, uint16_t src_nd_matrix_stride, uint16_t src_d_value, uint16_t dst_nz_c0_stride, | ||
| 63 | + uint16_t dst_nz_n_stride, uint16_t dst_nz_matrix_stride) | ||
| 64 | + ``` | ||
| 65 | + | ||
| 66 | +## 参数说明 | ||
| 67 | + | ||
| 68 | + | ||
| 69 | +**表1** 参数说明 | ||
| 70 | + | ||
| 71 | +| 参数名 | 输入/输出 | 描述 | | ||
| 72 | +|:---------------------|:------|:--------------------------------------------------------------------------------------------------------------------------------------| | ||
| 73 | +| dst | 输出 | 目的操作数(矢量)的起始地址。 | | ||
| 74 | +| src | 输入 | 源操作数的起始地址。 | | ||
| 75 | +| nd_num | 输入 | 传输ND矩阵的数目,取值范围:nd_num∈[0, 4095]。 | | ||
| 76 | +| n_value | 输入 | ND矩阵的行数,取值范围:n_value∈[0, 16384]。 | | ||
| 77 | +| d_value | 输入 | ND矩阵的列数,取值范围:d_value∈[0, 65535]。 | | ||
| 78 | +| src_nd_matrix_stride | 输入 | 源操作数相邻ND矩阵起始地址间的偏移,取值范围:src_nd_matrix_stride∈[0, 65535],单位为元素。 | | ||
| 79 | +| src_d_value | 输入 | 源操作数同一ND矩阵的相邻行起始地址间的偏移,取值范围:src_d_value∈[1, 65535],单位为元素。 | | ||
| 80 | +| dst_nz_c0_stride | 输入 | ND转换到NZ格式后,源操作数中的一行会转换为目的操作数的多行。dst_nz_c0_stride表示,目的NZ矩阵中,来自源操作数同一行的多行数据相邻起始地址间的偏移,取值范围:dst_nz_c0_stride∈[1, 16384],单位:C0_SIZE(32B)。 | | ||
| 81 | +| dst_nz_n_stride | 输入 | 目的NZ矩阵中,Z型矩阵相邻行起始地址之间的偏移。取值范围:dst_nz_n_stride∈[1, 16384],单位:C0_SIZE(32B)。 | | ||
| 82 | +| dst_nz_matrix_stride | 输入 | 目的NZ矩阵中,相邻NZ矩阵起始地址间的偏移,取值范围:dst_nz_matrix_stride∈[1, 65535],单位为元素。 | | ||
| 83 | + | ||
| 84 | +## 返回值说明 | ||
| 85 | + | ||
| 86 | +无 | ||
| 87 | + | ||
| 88 | +## 流水类型 | ||
| 89 | + | ||
| 90 | +PIPE_MTE2 | ||
| 91 | + | ||
| 92 | +## 约束说明 | ||
| 93 | + | ||
| 94 | +- 各存储单元的空间大小和对齐要求请参考[存储单元说明](../general_description_and_constraints.md#存储单元说明)。 | ||
| 95 | +- 如果需要执行多条asc_copy_gm2l1_nd2nz指令,且asc_copy_gm2l1_nd2nz指令的目的地址存在重叠,需要插入同步指令,保证多个asc_copy_gm2l1_nd2nz指令的串行化,防止出现异常数据。 | ||
| 96 | + | ||
| 97 | +## 调用示例 | ||
| 98 | + | ||
| 99 | +```cpp | ||
| 100 | +//total_length指参与搬运的数据总长度。 | ||
| 101 | +constexpr uint64_t total_length = 128; | ||
| 102 | +__cbuf__ int8_t dst[total_length]; | ||
| 103 | +// 传输nd矩阵的数目 | ||
| 104 | +constexpr uint16_t nd_num = 2; | ||
| 105 | +// nd矩阵的行数 | ||
| 106 | +constexpr uint16_t n_value = 4; | ||
| 107 | +// nd矩阵的列数 | ||
| 108 | +constexpr uint16_t d_value = 24; | ||
| 109 | +// 相邻nd矩阵的起始偏移 | ||
| 110 | +constexpr uint16_t src_nd_matrix_stride = 144; | ||
| 111 | +// 一行所含元素 | ||
| 112 | +constexpr uint16_t src_d_value = 48; | ||
| 113 | +// 格式从nd转换为nz后,多行数据起始地址之间的偏移 | ||
| 114 | +constexpr uint16_t dst_nz_c0_stride = 11; | ||
| 115 | +// src中一个nd矩阵的第x行和第x+1行转换为nz格式后在dst中的偏移 | ||
| 116 | +constexpr uint16_t dst_nz_n_stride = 2; | ||
| 117 | +// dst中第x个nd矩阵的起点和第x+1个nd矩阵的起点的偏移 | ||
| 118 | +constexpr uint16_t dst_nz_matrix_stride = 96; | ||
| 119 | +// src表示源操作数的起始地址 | ||
| 120 | +asc_copy_gm2l1_nd2nz_sync(dst, src, nd_num, n_value, d_value, src_nd_matrix_stride, src_d_value, dst_nz_c0_stride, dst_nz_n_stride, dst_nz_matrix_stride); | ||
| 121 | +``` | ||
Adocs/zh/api/SIMD-API/c_api/deprecated_interface/asc_copy_gm2l1_nd2nz_sync_arch_3510_deprecated.md+263-0
| @@ -0,0 +1,263 @@ | |||
| 1 | +# asc_copy_gm2l1_nd2nz_sync_arch_3510(废弃) | ||
| 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 | +<!-- end id5 --> | ||
| 20 | +<!-- npu="310p" id6 --> | ||
| 21 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 22 | +<!-- end id6 --> | ||
| 23 | +<!-- npu="910" id7 --> | ||
| 24 | +- Atlas 训练系列产品:不支持 | ||
| 25 | +<!-- end id7 --> | ||
| 26 | + | ||
| 27 | +## 功能说明 | ||
| 28 | + | ||
| 29 | +头文件路径为:`"c_api/composite/cube_datamove_composite.h"`。 | ||
| 30 | + | ||
| 31 | +**`asc_copy_gm2l1_nd2nz_sync`接口已废弃,请使用[对应的非同步接口](../cube_datamove/asc_copy_gm2l1_nd2nz/asc_copy_gm2l1_nd2nz_arch_3510.md)和同步接口[asc_sync](../sync/asc_sync.md)替代。** | ||
| 32 | + | ||
| 33 | +将数据从Global Memory搬运到L1 Buffer,并在搬运过程中将源端按N维连续排布的ND格式数据转换为L1 Buffer侧的Nz分形排布,使其满足后续矩阵计算对分形列连续性的要求。该接口也适用于卷积格式NHWC(ND)转换为NC1HWC0格式等转换场景。 | ||
| 34 | + | ||
| 35 | +进行ND2Nz格式搬运前,需先通过[asc_set_gm2l1_nz_para](../cube_datamove/asc_set_gm2l1_nz_para.md)接口配置ND2Nz搬运的目的Nz矩阵的stride与ND矩阵搬运个数。 | ||
| 36 | + | ||
| 37 | +本接口仅在AIC上执行有效。 | ||
| 38 | + | ||
| 39 | +如[图1](#nd2nz_equivalent_conversion)所示,ND到Nz的格式转换也等价于DN到Zn的格式转换,如果要进行DN到Zn的格式转换可采用此指令。 | ||
| 40 | + | ||
| 41 | +**图1** ND2Nz与DN2Zn示意图<a id="nd2nz_equivalent_conversion"></a> | ||
| 42 | + | ||
| 43 | + | ||
| 44 | + | ||
| 45 | +## 函数原型 | ||
| 46 | + | ||
| 47 | +```cpp | ||
| 48 | +__aicore__ inline void asc_copy_gm2l1_nd2nz_sync(__cbuf__ <dtype>* dst, | ||
| 49 | + __gm__ <dtype>* src, | ||
| 50 | + uint64_t loop1_src_stride, | ||
| 51 | + uint8_t l2_cache_ctl, | ||
| 52 | + uint16_t n_value, | ||
| 53 | + uint32_t d_value, | ||
| 54 | + uint64_t loop4_src_stride, | ||
| 55 | + bool enable_small_c0) | ||
| 56 | +``` | ||
| 57 | + | ||
| 58 | +### dtype支持的数据类型 | ||
| 59 | + | ||
| 60 | +dtype支持的数据类型为`int8_t`、`uint8_t`、`hifloat8_t`、`fp8_e5m2_t`、`fp8_e4m3fn_t`、`int16_t`、`uint16_t`、`half`、`bfloat16_t`、`int32_t`、`uint32_t`、`float`。 | ||
| 61 | + | ||
| 62 | +### 函数原型典型示例 | ||
| 63 | + | ||
| 64 | +```cpp | ||
| 65 | +__aicore__ inline void asc_copy_gm2l1_nd2nz_sync(__cbuf__ <dtype>* dst, | ||
| 66 | + __gm__ <dtype>* src, | ||
| 67 | + uint64_t loop1_src_stride, | ||
| 68 | + uint8_t l2_cache_ctl, | ||
| 69 | + uint16_t n_value, | ||
| 70 | + uint32_t d_value, | ||
| 71 | + uint64_t loop4_src_stride, | ||
| 72 | + bool smallc0_en) | ||
| 73 | +``` | ||
| 74 | + | ||
| 75 | +## 参数说明 | ||
| 76 | + | ||
| 77 | +**表1** 参数说明 | ||
| 78 | + | ||
| 79 | +| 参数名 | 输入/输出 | 含义 | | ||
| 80 | +|---|---|---| | ||
| 81 | +| dst | 输出 | 目的操作数,存储位置为L1 Buffer。起始地址需要按照32字节对齐。 | | ||
| 82 | +| src | 输入 | 源操作数,存储位置为GM。起始地址需要按照1字节对齐。 | | ||
| 83 | +| loop1_src_stride | 输入 | 源矩阵相邻行起始地址之间的偏移,单位为字节。取值范围:[0, $2^{40}-1$]。 | | ||
| 84 | +| l2_cache_ctl | 输入 | 配置输入的GM数据在L2 Cache中的管理策略。取值需为已定义的策略(0/1/2/4之一),其他值触发L2 Cache策略异常。取值说明见[表2](#l2_cache_ctl_values)。 | | ||
| 85 | +| n_value | 输入 | 源矩阵中ND矩阵的行数,单位为元素,取值范围:[1, 65535]。 | | ||
| 86 | +| d_value | 输入 | 源矩阵中ND矩阵的列数,单位为元素,取值范围:[1, $2^{21}-1$]。搬运过程中,当$d\_value \times \mathrm{sizeof}(\mathrm{dtype})$不满足32字节对齐时,硬件在目的矩阵中自动补0至32字节对齐。 | | ||
| 87 | +| loop4_src_stride | 输入 | 源矩阵相邻ND矩阵起始地址间的偏移,单位为字节。取值范围:[0, $2^{40}-1$]。<br> • 源矩阵ND矩阵个数为1时,此参数无意义,设置为0即可。<br> • 源矩阵ND矩阵个数大于1时,当`loop4_src_stride = 0`时,表示重复搬出源矩阵的第一个ND矩阵。 | | ||
| 88 | +| smallc0_en | 输入 | SmallC0模式开关,仅当$d\_value \le 4$时可开启,否则导致搬运异常。<br> • `false`:不开启SmallC0模式,按标准Nz格式的C0(32字节)排布搬运;<br> • `true`:开启SmallC0模式,搬运过程中搬运的数据量不满足$4 \times \mathrm{sizeof}(\mathrm{dtype})$字节对齐时,硬件在目的矩阵中自动补0至$4 \times \mathrm{sizeof}(\mathrm{dtype})$字节对齐。 | | ||
| 89 | + | ||
| 90 | +**表2** `l2_cache_ctl`取值说明 <a id="l2_cache_ctl_values"></a> | ||
| 91 | + | ||
| 92 | +| 取值 | 模式 | 含义 | | ||
| 93 | +|------|------|------| | ||
| 94 | +| 0 | Normal模式 | 启用L2 Cache,并将分配的Cache Line标记为高替换优先级。 | | ||
| 95 | +| 1 | Last模式 | • 启用L2 Cache,并将分配的Cache Line标记为低替换优先级。<br>• **Last模式暂不支持。**| | ||
| 96 | +| 2 | Persistent模式 | • 启用L2 Cache。已存入L2 Cache中的数据可能被替换,若需确保特定GM的数据始终保留在L2 Cache中,可采用驻留模式。<br>• 被标记为驻留模式的Cache Line只能被其他同样标记为驻留模式的Cache Line替换。<br>• **Persistent模式暂不支持。**| | ||
| 97 | +| 4 | Disable模式 | 不启用L2 Cache,每次都直接从GM中读取,并保持已有Cache Line的状态不变。 | | ||
| 98 | + | ||
| 99 | +ND到Nz的格式转换如[图2](#nd2nz_conversion)所示。 | ||
| 100 | + | ||
| 101 | +**图2** ND2Nz转换示意图<a id="nd2nz_conversion"></a> | ||
| 102 | + | ||
| 103 | + | ||
| 104 | + | ||
| 105 | +## 返回值说明 | ||
| 106 | + | ||
| 107 | +无 | ||
| 108 | + | ||
| 109 | +## 流水类型 | ||
| 110 | + | ||
| 111 | +PIPE_MTE2 | ||
| 112 | + | ||
| 113 | +## 约束说明 | ||
| 114 | + | ||
| 115 | +### 通用约束 | ||
| 116 | + | ||
| 117 | +- 本接口非AIC调用直接返回。 | ||
| 118 | +- `dst`起始地址需要按照32字节对齐(L1 Buffer对齐要求),否则会导致搬运异常。 | ||
| 119 | +- `src`起始地址需要按照1字节对齐(GM对齐要求),否则会导致搬运异常。 | ||
| 120 | +- 如果本指令与其他指令存在目的地址重叠,需要插入同步指令([asc_sync_notify](../sync/asc_sync_notify.md)和[asc_sync_wait](../sync/asc_sync_wait.md)),保证多个指令串行化,防止出现异常数据。 | ||
| 121 | +- L1 Buffer容量上限:L1 Buffer总容量512KB,`dst`偏移量与搬运大小之和不可越界,否则触发异常。 | ||
| 122 | + | ||
| 123 | +### ND2Nz搬运约束 | ||
| 124 | + | ||
| 125 | +- 调用本指令前,需要先调用[asc_set_gm2l1_nz_para](../cube_datamove/asc_set_gm2l1_nz_para.md)接口配置ND2Nz搬运的目的Nz矩阵步长与ND矩阵搬运个数。 | ||
| 126 | +- `loop1_src_stride`取值范围为[0, $2^{40}-1$],超出取值范围的值会被截断,导致搬运结果不符合预期。 | ||
| 127 | +- `n_value`取值范围为[1, 65535],超出取值范围的值会被截断,导致搬运结果不符合预期。 | ||
| 128 | +- `d_value`取值范围为[1, $2^{21}-1$],超出取值范围的值会被截断,导致搬运结果不符合预期。 | ||
| 129 | +- `loop4_src_stride`取值范围为[0, $2^{40}-1$],超出取值范围的值会被截断,导致搬运结果不符合预期。 | ||
| 130 | +- `smallc0_en`设置为`true`时,$d\_value \le 4$,否则导致搬运异常。 | ||
| 131 | + | ||
| 132 | +## 调用示例 | ||
| 133 | + | ||
| 134 | +将代码保存为`examples.asc`后,可通过`bisheng`命令编译运行,其中`--npu-arch`参数需根据实际产品型号指定对应的NPU架构,具体产品与NPU架构的映射关系请参考[`__NPU_ARCH__`](../../../../guide/programming_guide/language_extension/simd_builtin_keywords.md#npu-arch)。 | ||
| 135 | + | ||
| 136 | +<!-- npu="950" id8 --> | ||
| 137 | +以Ascend 950PR/Ascend 950DT产品(对应NPU架构为`dav-3510`)为例,编译运行命令如下: | ||
| 138 | + | ||
| 139 | +```bash | ||
| 140 | +bisheng examples.asc -o main --npu-arch=dav-3510 && ./main | ||
| 141 | +``` | ||
| 142 | +<!-- end id8 --> | ||
| 143 | + | ||
| 144 | +样例单核占用32KB L1 Buffer、16KB L0A Buffer、16KB L0B Buffer和64KB L0C Buffer。样例依次复用`EVENT_ID0`完成MTE2到MTE1、MTE1到M、M到FIX的同步。 | ||
| 145 | + | ||
| 146 | +```cpp | ||
| 147 | +#include <cstdint> | ||
| 148 | +#include <iostream> | ||
| 149 | +#include <vector> | ||
| 150 | +#include "c_api/asc_simd.h" | ||
| 151 | +#include "acl/acl.h" | ||
| 152 | + | ||
| 153 | +namespace { | ||
| 154 | +constexpr uint32_t M = 128; | ||
| 155 | +constexpr uint32_t K = 128; | ||
| 156 | +constexpr uint32_t N = 128; | ||
| 157 | +constexpr uint32_t ELEMENTS = M * N; | ||
| 158 | +constexpr uint32_t CUBE_M = 16; | ||
| 159 | +constexpr uint32_t CUBE_K = 32; | ||
| 160 | + | ||
| 161 | +__global__ __cube__ void AscCopyGm2l1Nd2nzKernel(__gm__ int8_t* a, __gm__ int8_t* b, | ||
| 162 | + __gm__ int32_t* output) | ||
| 163 | +{ | ||
| 164 | + asc_init(); | ||
| 165 | + __cbuf__ int8_t a_l1[M * K], b_l1[N * K]; | ||
| 166 | + __ca__ int8_t a_l0[M * K]; | ||
| 167 | + __cb__ int8_t b_l0[K * N]; | ||
| 168 | + __cc__ int32_t c_l0[ELEMENTS]; | ||
| 169 | + | ||
| 170 | + // 将两个128 x 128的ND矩阵从GM搬入L1并转换为Nz格式。 | ||
| 171 | + asc_set_gm2l1_nz_para(1, 1, 128, 0); | ||
| 172 | + asc_copy_gm2l1_nd2nz_sync(a_l1, a, K, 0, M, K, 0, false); | ||
| 173 | + asc_set_gm2l1_nz_para(1, 1, 128, 0); | ||
| 174 | + asc_copy_gm2l1_nd2nz_sync(b_l1, b, K, 0, N, K, 0, false); | ||
| 175 | + asc_sync_notify(PIPE_MTE2, PIPE_MTE1, EVENT_ID0); | ||
| 176 | + asc_sync_wait(PIPE_MTE2, PIPE_MTE1, EVENT_ID0); | ||
| 177 | + | ||
| 178 | + // 将Nz矩阵分别搬入L0A和L0B,供矩阵乘计算使用。 | ||
| 179 | + asc_copy_l12l0a(a_l0, a_l1, 0, 0, M / CUBE_M, K / CUBE_K, | ||
| 180 | + M / CUBE_M, M / CUBE_M); | ||
| 181 | + asc_copy_l12l0b(b_l0, b_l1, 0, 0, N / CUBE_M, K / CUBE_K, | ||
| 182 | + N / CUBE_M, N / CUBE_M); | ||
| 183 | + asc_sync_notify(PIPE_MTE1, PIPE_M, EVENT_ID0); | ||
| 184 | + asc_sync_wait(PIPE_MTE1, PIPE_M, EVENT_ID0); | ||
| 185 | + | ||
| 186 | + // 计算128 x 128矩阵乘,并将结果从L0C搬回GM。 | ||
| 187 | + asc_mmad(c_l0, a_l0, b_l0, M, K, N, 0, true, false, true); | ||
| 188 | + asc_sync_notify(PIPE_M, PIPE_FIX, EVENT_ID0); | ||
| 189 | + asc_sync_wait(PIPE_M, PIPE_FIX, EVENT_ID0); | ||
| 190 | + | ||
| 191 | + asc_set_l0c_copy_nz_para(1, 0, 0); | ||
| 192 | + asc_copy_l0c2gm(output, c_l0, N, M, N, M, 0, 0, 0, | ||
| 193 | + static_cast<uint64_t>(QuantMode_t::NoQuant), 0, false, true, | ||
| 194 | + static_cast<uint64_t>(QuantMode_post::NoConv), 0, false, 0, false, false, false, false); | ||
| 195 | + asc_sync_pipe(PIPE_FIX); | ||
| 196 | +} | ||
| 197 | + | ||
| 198 | +template <typename T> | ||
| 199 | +void PrintRow(const char* label, const std::vector<T>& data) | ||
| 200 | +{ | ||
| 201 | + std::cout << label << ':'; | ||
| 202 | + for (uint32_t i = 0; i < 8; ++i) { | ||
| 203 | + std::cout << ' ' << +data[i]; | ||
| 204 | + } | ||
| 205 | + std::cout << " ..." << std::endl; | ||
| 206 | +} | ||
| 207 | +} // namespace | ||
| 208 | + | ||
| 209 | +int main() | ||
| 210 | +{ | ||
| 211 | + // 构造输入和CPU侧参考结果。 | ||
| 212 | + std::vector<int8_t> a(M * K), b(N * K); | ||
| 213 | + std::vector<int32_t> output(ELEMENTS), golden(ELEMENTS); | ||
| 214 | + for (uint32_t row = 0; row < M; ++row) { | ||
| 215 | + for (uint32_t k = 0; k < K; ++k) { | ||
| 216 | + a[row * K + k] = static_cast<int8_t>(static_cast<int32_t>((row + 2 * k) % 5) - 2); | ||
| 217 | + } | ||
| 218 | + } | ||
| 219 | + for (uint32_t col = 0; col < N; ++col) { | ||
| 220 | + for (uint32_t k = 0; k < K; ++k) { | ||
| 221 | + b[col * K + k] = static_cast<int8_t>(static_cast<int32_t>((3 * col + k) % 5) - 2); | ||
| 222 | + } | ||
| 223 | + } | ||
| 224 | + for (uint32_t row = 0; row < M; ++row) { | ||
| 225 | + for (uint32_t col = 0; col < N; ++col) { | ||
| 226 | + for (uint32_t k = 0; k < K; ++k) { | ||
| 227 | + golden[row * N + col] += a[row * K + k] * b[col * K + k]; | ||
| 228 | + } | ||
| 229 | + } | ||
| 230 | + } | ||
| 231 | + | ||
| 232 | + // 分配Device内存、启动Kernel并校验结果。 | ||
| 233 | + aclInit(nullptr); | ||
| 234 | + aclrtSetDevice(0); | ||
| 235 | + int8_t *a_device = nullptr, *b_device = nullptr; | ||
| 236 | + int32_t* output_device = nullptr; | ||
| 237 | + aclrtMalloc(reinterpret_cast<void**>(&a_device), a.size(), ACL_MEM_MALLOC_HUGE_FIRST); | ||
| 238 | + aclrtMalloc(reinterpret_cast<void**>(&b_device), b.size(), ACL_MEM_MALLOC_HUGE_FIRST); | ||
| 239 | + aclrtMalloc(reinterpret_cast<void**>(&output_device), output.size() * sizeof(int32_t), | ||
| 240 | + ACL_MEM_MALLOC_HUGE_FIRST); | ||
| 241 | + aclrtMemcpy(a_device, a.size(), a.data(), a.size(), ACL_MEMCPY_HOST_TO_DEVICE); | ||
| 242 | + aclrtMemcpy(b_device, b.size(), b.data(), b.size(), ACL_MEMCPY_HOST_TO_DEVICE); | ||
| 243 | + AscCopyGm2l1Nd2nzKernel<<<1, 0>>>(a_device, b_device, output_device); | ||
| 244 | + aclrtSynchronizeDevice(); | ||
| 245 | + aclrtMemcpy(output.data(), output.size() * sizeof(int32_t), output_device, | ||
| 246 | + output.size() * sizeof(int32_t), ACL_MEMCPY_DEVICE_TO_HOST); | ||
| 247 | + | ||
| 248 | + PrintRow("Input A row 0", a); | ||
| 249 | + PrintRow("Input B row 0", b); | ||
| 250 | + PrintRow("Output row 0", output); | ||
| 251 | + PrintRow("Golden row 0", golden); | ||
| 252 | + const bool passed = output == golden; | ||
| 253 | + std::cout << (passed ? "[Success] asc_copy_gm2l1_nd2nz preserved the MMAD operands/result." | ||
| 254 | + : "[Failed] asc_copy_gm2l1_nd2nz result mismatch.") << std::endl; | ||
| 255 | + | ||
| 256 | + aclrtFree(a_device); | ||
| 257 | + aclrtFree(b_device); | ||
| 258 | + aclrtFree(output_device); | ||
| 259 | + aclrtResetDevice(0); | ||
| 260 | + aclFinalize(); | ||
| 261 | + return passed ? 0 : 1; | ||
| 262 | +} | ||
| 263 | +``` | ||
Adocs/zh/api/SIMD-API/c_api/deprecated_interface/asc_copy_gm2l1_sync_2d_arch_3510_deprecated.md+268-0
| @@ -0,0 +1,268 @@ | |||
| 1 | +# asc_copy_gm2l1_sync_2d_arch_3510(废弃) | ||
| 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="910" id4 --> | ||
| 15 | +- Atlas 训练系列产品:不支持 | ||
| 16 | +<!-- end id4 --> | ||
| 17 | +<!-- npu="310p" id5 --> | ||
| 18 | +- Atlas 推理系列产品AI Core:不支持 | ||
| 19 | +<!-- end id5 --> | ||
| 20 | +<!-- npu="310p" id6 --> | ||
| 21 | +- Atlas 推理系列产品Vector Core:不支持 | ||
| 22 | +<!-- end id6 --> | ||
| 23 | +<!-- npu="310b" id7 --> | ||
| 24 | +- Atlas 200I/500 A2 推理产品:不支持 | ||
| 25 | +<!-- end id7 --> | ||
| 26 | + | ||
| 27 | +## 功能说明 | ||
| 28 | + | ||
| 29 | +头文件路径为:`"c_api/composite/cube_datamove_composite.h"`。 | ||
| 30 | + | ||
| 31 | +**`asc_copy_gm2l1_sync`接口已废弃,请使用[对应的非同步接口](../cube_datamove/asc_copy_gm2l1/asc_copy_gm2l1_2d_arch_3510.md)和同步接口[asc_sync](../sync/asc_sync.md)替代。** | ||
| 32 | + | ||
| 33 | +将数据从Global Memory搬运到L1 Buffer。以512字节的分形为单位,从GM中按行列方向的起始位置、步长切分提取多个分形矩阵搬运到L1 Buffer,搬运过程中不支持分形格式转换,用于矩阵计算所需的2D格式数据加载。 | ||
| 34 | + | ||
| 35 | +本接口仅在AIC上执行有效。 | ||
| 36 | + | ||
| 37 | +## 函数原型 | ||
| 38 | + | ||
| 39 | +### 模板原型(占位符形式) | ||
| 40 | + | ||
| 41 | +```cpp | ||
| 42 | +__aicore__ inline void asc_copy_gm2l1_sync(__cbuf__ <dtype>* dst, | ||
| 43 | + __gm__ <dtype>* src, | ||
| 44 | + uint32_t m_start_position, | ||
| 45 | + uint32_t k_start_position, | ||
| 46 | + uint16_t dst_stride, | ||
| 47 | + uint16_t m_step, | ||
| 48 | + uint16_t k_step, | ||
| 49 | + uint8_t decomp_mode, | ||
| 50 | + uint8_t l2_cache_ctl) | ||
| 51 | +``` | ||
| 52 | + | ||
| 53 | +### dtype支持的数据类型 | ||
| 54 | + | ||
| 55 | +dtype支持的数据类型为`int8_t`、`uint8_t`、`fp4x2_e2m1_t`、`fp4x2_e1m2_t`、`hifloat8_t`、`fp8_e5m2_t`、`fp8_e4m3fn_t`、`int16_t`、`uint16_t`、`half`、`bfloat16_t`、`int32_t`、`uint32_t`、`float`、`void`。 | ||
| 56 | + | ||
| 57 | +## 参数说明 | ||
| 58 | + | ||
| 59 | +**表1** 参数说明 | ||
| 60 | + | ||
| 61 | +| 参数名 | 输入/输出 | 描述 | | ||
| 62 | +|---|---|---| | ||
| 63 | +| dst | 输出 | 目的操作数,存储位置为L1 Buffer。目的地址需32字节对齐。 | | ||
| 64 | +| src | 输入 | 源操作数,存储位置为GM。源地址需1字节对齐。 | | ||
| 65 | +| m_start_position | 输入 | 源矩阵中首个分形在行方向的起始位置,单位为16个元素。取值范围:$[0, 2^{32}-1]$。 | | ||
| 66 | +| k_start_position | 输入 | 源矩阵中首个分形在列方向的起始位置,单位32字节。取值范围:$[0, 2^{32}-1]$。 | | ||
| 67 | +| dst_stride | 输入 | 目的矩阵列方向前一个分形起始地址与后一个分形起始地址的间隔,单位512字节。取值范围:[0, 4095]。 | | ||
| 68 | +| m_step | 输入 | 源矩阵行方向分形步长,即搬运的分形行数,单位为16个元素。取值范围:[1, 4095]。 | | ||
| 69 | +| k_step | 输入 | 源矩阵列方向分形步长,即搬运的分形列数,单位32字节。取值范围:[1, 4095]。 | | ||
| 70 | +| decomp_mode | 输入 | 预留参数,当前须设置为0。 | | ||
| 71 | +| l2_cache_ctl | 输入 | 配置数据在L2 Cache中的管理策略。取值说明请参见[表2](#table2)。 | | ||
| 72 | + | ||
| 73 | +**表2** l2_cache_ctl取值说明 <a id="table2"></a> | ||
| 74 | + | ||
| 75 | +| 取值 | 模式 | 含义 | | ||
| 76 | +|------|------|------| | ||
| 77 | +| 0 | Normal模式 | 启用L2 Cache,并将分配的Cache Line标记为高替换优先级。 | | ||
| 78 | +| 1 | Last模式 | • 启用L2 Cache,并将分配的Cache Line标记为低替换优先级。<br>• **Last模式暂不支持。**| | ||
| 79 | +| 2 | Persistent模式 | • 启用L2 Cache。已存入L2 Cache中的数据可能被替换,若需确保特定GM的数据始终保留在L2 Cache中,可采用驻留模式。<br>• 被标记为驻留模式的Cache Line只能被其他同样标记为驻留模式的Cache Line替换。<br>• **Persistent模式暂不支持。**| | ||
| 80 | +| 4 | Disable模式 | 不启用L2 Cache,每次都直接从GM中读取,并保持已有Cache Line的状态不变。 | | ||
| 81 | + | ||
| 82 | +## 返回值说明 | ||
| 83 | + | ||
| 84 | +无 | ||
| 85 | + | ||
| 86 | +## 流水类型 | ||
| 87 | + | ||
| 88 | +PIPE_MTE2 | ||
| 89 | + | ||
| 90 | +## 约束说明 | ||
| 91 | + | ||
| 92 | +### 通用约束 | ||
| 93 | + | ||
| 94 | +- 本接口非AIC调用直接返回。 | ||
| 95 | +- dst起始地址需32字节对齐(L1 Buffer对齐要求),否则会导致搬运异常。 | ||
| 96 | +- src起始地址需1字节对齐(Global Memory对齐要求),否则会导致搬运异常。 | ||
| 97 | +- 如果本指令与其他指令存在目的地址重叠,需要插入同步指令([asc_sync_notify](../sync/asc_sync_notify.md)和[asc_sync_wait](../sync/asc_sync_wait.md)),保证多个指令串行化,防止出现异常数据。 | ||
| 98 | +- L1 Buffer容量上限:L1 Buffer总容量512KB,dst偏移量与搬运大小之和不可越界,否则触发异常。 | ||
| 99 | + | ||
| 100 | +### 2D矩阵搬运模式约束 | ||
| 101 | + | ||
| 102 | +- m_step或k_step为0时不执行搬运,本接口被视为NOP(空操作)。 | ||
| 103 | +- 接口以512字节的完整分形为最小搬运粒度,不支持仅搬运分形内的部分元素,且不支持填充功能。 | ||
| 104 | +- dst_stride取值范围为[0, 4095],超出取值范围的值会被截断,导致搬运结果不符合预期。 | ||
| 105 | +- m_step取值范围为[1, 4095],超出取值范围的值会被截断,导致搬运结果不符合预期。 | ||
| 106 | +- k_step取值范围为[1, 4095],超出取值范围的值会被截断,导致搬运结果不符合预期。 | ||
| 107 | + | ||
| 108 | +## 调用示例 | ||
| 109 | + | ||
| 110 | +将代码保存为`examples.asc`后,可通过`bisheng`命令编译运行,其中`--npu-arch`参数需根据实际产品型号指定对应的NPU架构,具体产品与NPU架构的映射关系请参考[`__NPU_ARCH__`](../../../../guide/programming_guide/language_extension/simd_builtin_keywords.md#npu-arch)。 | ||
| 111 | + | ||
| 112 | +<!-- npu="950" id8 --> | ||
| 113 | +以Ascend 950PR/Ascend 950DT产品(对应NPU架构为`dav-3510`)为例,编译运行命令如下: | ||
| 114 | + | ||
| 115 | +```bash | ||
| 116 | +bisheng examples.asc -o main --npu-arch=dav-3510 && ./main | ||
| 117 | +``` | ||
| 118 | +<!-- end id8 --> | ||
| 119 | + | ||
| 120 | +样例中A、B、C矩阵的shape均为[128,128],数据格式均为Nz。A和B在GM中以Nz格式存储,分别按8个分形列循环调用本接口的2D矩阵搬运重载搬运到L1 Buffer,每次搬运一个分形列。随后A经[asc_copy_l12l0a](../cube_datamove/asc_copy_l12l0a/asc_copy_l12l0a_2d_arch_3510.md)搬运到L0A Buffer,B经[asc_copy_l12l0b_transpose](../cube_datamove/asc_copy_l12l0b/asc_copy_l12l0b_2d_arch_3510.md)搬运到L0B Buffer,调用[asc_mmad](../cube_compute/asc_mmad.md)完成计算。C从L0C Buffer搬出到GM时关闭Nz2ND和Nz2DN,保持Nz格式。样例单核占用64KB L1 Buffer、32KB L0A Buffer、32KB L0B Buffer和64KB L0C Buffer。样例依次复用`EVENT_ID0`完成MTE2到MTE1、MTE1到M、M到FIX的同步。 | ||
| 121 | + | ||
| 122 | +```cpp | ||
| 123 | +#include <cstdint> | ||
| 124 | +#include <iostream> | ||
| 125 | +#include <vector> | ||
| 126 | +#include "c_api/asc_simd.h" | ||
| 127 | +#include "acl/acl.h" | ||
| 128 | + | ||
| 129 | +namespace { | ||
| 130 | +constexpr uint32_t M = 128; | ||
| 131 | +constexpr uint32_t K = 128; | ||
| 132 | +constexpr uint32_t N = 128; | ||
| 133 | +constexpr uint32_t ELEMENTS = M * N; | ||
| 134 | +constexpr uint32_t CUBE = 16; | ||
| 135 | +constexpr uint16_t HALF_ONE = 0x3c00; | ||
| 136 | +constexpr uint16_t HALF_NEG_ONE = 0xbc00; | ||
| 137 | +constexpr uint16_t M_FRACTALS = M / CUBE; | ||
| 138 | +constexpr uint16_t K_FRACTALS = K / CUBE; | ||
| 139 | +constexpr uint16_t N_FRACTALS = N / CUBE; | ||
| 140 | + | ||
| 141 | +__global__ __cube__ void AscCopyGm2l1TwoDimNzKernel( | ||
| 142 | + __gm__ half* a, __gm__ half* b, __gm__ float* output) | ||
| 143 | +{ | ||
| 144 | + asc_init(); | ||
| 145 | + __cbuf__ half a_l1[M * K], b_l1[K * N]; | ||
| 146 | + __ca__ half a_l0[M * K]; | ||
| 147 | + __cb__ half b_l0[K * N]; | ||
| 148 | + __cc__ float c_l0[ELEMENTS]; | ||
| 149 | + | ||
| 150 | + // A、B在GM中已按Nz格式排布,2D搬运过程中不进行格式转换。 | ||
| 151 | + for (uint16_t k_block = 0; k_block < K_FRACTALS; ++k_block) { | ||
| 152 | + const uint32_t offset = k_block * M * CUBE; | ||
| 153 | + asc_copy_gm2l1_sync(a_l1 + offset, a + offset, 0, 0, M_FRACTALS, M_FRACTALS, 1, 0, 0); | ||
| 154 | + } | ||
| 155 | + for (uint16_t n_block = 0; n_block < N_FRACTALS; ++n_block) { | ||
| 156 | + const uint32_t offset = n_block * K * CUBE; | ||
| 157 | + asc_copy_gm2l1_sync(b_l1 + offset, b + offset, 0, 0, K_FRACTALS, K_FRACTALS, 1, 0, 0); | ||
| 158 | + } | ||
| 159 | + asc_sync_notify(PIPE_MTE2, PIPE_MTE1, EVENT_ID0); | ||
| 160 | + asc_sync_wait(PIPE_MTE2, PIPE_MTE1, EVENT_ID0); | ||
| 161 | + | ||
| 162 | + // A从Nz转换为L0A Buffer所需Zz排布,B从Nz转换为L0B Buffer所需Zn排布。 | ||
| 163 | + asc_copy_l12l0a(a_l0, a_l1, 0, 0, M_FRACTALS, K_FRACTALS, M_FRACTALS, M_FRACTALS); | ||
| 164 | + asc_copy_l12l0b_transpose( | ||
| 165 | + b_l0, b_l1, 0, 0, K_FRACTALS, N_FRACTALS, K_FRACTALS, N_FRACTALS); | ||
| 166 | + asc_sync_notify(PIPE_MTE1, PIPE_M, EVENT_ID0); | ||
| 167 | + asc_sync_wait(PIPE_MTE1, PIPE_M, EVENT_ID0); | ||
| 168 | + | ||
| 169 | + asc_mmad(c_l0, a_l0, b_l0, M, K, N, 0, true, false, true); | ||
| 170 | + asc_sync_notify(PIPE_M, PIPE_FIX, EVENT_ID0); | ||
| 171 | + asc_sync_wait(PIPE_M, PIPE_FIX, EVENT_ID0); | ||
| 172 | + | ||
| 173 | + // 关闭Nz2ND和Nz2DN,保持L0C Buffer中的Nz排布直接搬出至GM。 | ||
| 174 | + asc_copy_l0c2gm(output, c_l0, N, M, M * CUBE, M, 0, 0, 0, | ||
| 175 | + static_cast<uint64_t>(QuantMode_t::NoQuant), 0, false, false, | ||
| 176 | + static_cast<uint64_t>(QuantMode_post::NoConv), 0, false, 0, false, false, false, false); | ||
| 177 | + asc_sync_pipe(PIPE_ALL); | ||
| 178 | +} | ||
| 179 | + | ||
| 180 | +uint16_t ToHalfBits(int32_t value) | ||
| 181 | +{ | ||
| 182 | + return value > 0 ? HALF_ONE : (value < 0 ? HALF_NEG_ONE : 0); | ||
| 183 | +} | ||
| 184 | + | ||
| 185 | +size_t NzIndex(uint32_t row, uint32_t col, uint32_t rows) | ||
| 186 | +{ | ||
| 187 | + return static_cast<size_t>(col / CUBE) * rows * CUBE + row * CUBE + col % CUBE; | ||
| 188 | +} | ||
| 189 | + | ||
| 190 | +void PrintNzBlock(const char* label, const std::vector<float>& data) | ||
| 191 | +{ | ||
| 192 | + std::cout << label << ':'; | ||
| 193 | + for (uint32_t i = 0; i < 8; ++i) { | ||
| 194 | + std::cout << ' ' << data[i]; | ||
| 195 | + } | ||
| 196 | + std::cout << " ..." << std::endl; | ||
| 197 | +} | ||
| 198 | +} // namespace | ||
| 199 | + | ||
| 200 | +int main() | ||
| 201 | +{ | ||
| 202 | + std::vector<uint16_t> a(ELEMENTS), b(ELEMENTS); | ||
| 203 | + std::vector<float> output(ELEMENTS), golden(ELEMENTS); | ||
| 204 | + for (uint32_t row = 0; row < M; ++row) { | ||
| 205 | + for (uint32_t k = 0; k < K; ++k) { | ||
| 206 | + const int32_t value = static_cast<int32_t>((row + 2 * k) % 3) - 1; | ||
| 207 | + a[NzIndex(row, k, M)] = ToHalfBits(value); | ||
| 208 | + } | ||
| 209 | + } | ||
| 210 | + for (uint32_t k = 0; k < K; ++k) { | ||
| 211 | + for (uint32_t col = 0; col < N; ++col) { | ||
| 212 | + const int32_t value = static_cast<int32_t>((2 * k + col) % 3) - 1; | ||
| 213 | + b[NzIndex(k, col, K)] = ToHalfBits(value); | ||
| 214 | + } | ||
| 215 | + } | ||
| 216 | + for (uint32_t row = 0; row < M; ++row) { | ||
| 217 | + for (uint32_t col = 0; col < N; ++col) { | ||
| 218 | + int32_t sum = 0; | ||
| 219 | + for (uint32_t k = 0; k < K; ++k) { | ||
| 220 | + const int32_t a_value = static_cast<int32_t>((row + 2 * k) % 3) - 1; | ||
| 221 | + const int32_t b_value = static_cast<int32_t>((2 * k + col) % 3) - 1; | ||
| 222 | + sum += a_value * b_value; | ||
| 223 | + } | ||
| 224 | + golden[NzIndex(row, col, M)] = static_cast<float>(sum); | ||
| 225 | + } | ||
| 226 | + } | ||
| 227 | + | ||
| 228 | + aclInit(nullptr); | ||
| 229 | + aclrtSetDevice(0); | ||
| 230 | + half *a_device = nullptr, *b_device = nullptr; | ||
| 231 | + float* output_device = nullptr; | ||
| 232 | + aclrtMalloc(reinterpret_cast<void**>(&a_device), a.size() * sizeof(uint16_t), ACL_MEM_MALLOC_HUGE_FIRST); | ||
| 233 | + aclrtMalloc(reinterpret_cast<void**>(&b_device), b.size() * sizeof(uint16_t), ACL_MEM_MALLOC_HUGE_FIRST); | ||
| 234 | + aclrtMalloc(reinterpret_cast<void**>(&output_device), output.size() * sizeof(float), ACL_MEM_MALLOC_HUGE_FIRST); | ||
| 235 | + aclrtMemcpy(a_device, a.size() * sizeof(uint16_t), a.data(), a.size() * sizeof(uint16_t), | ||
| 236 | + ACL_MEMCPY_HOST_TO_DEVICE); | ||
| 237 | + aclrtMemcpy(b_device, b.size() * sizeof(uint16_t), b.data(), b.size() * sizeof(uint16_t), | ||
| 238 | + ACL_MEMCPY_HOST_TO_DEVICE); | ||
| 239 | + | ||
| 240 | + AscCopyGm2l1TwoDimNzKernel<<<1, 0>>>(a_device, b_device, output_device); | ||
| 241 | + aclrtSynchronizeDevice(); | ||
| 242 | + aclrtMemcpy(output.data(), output.size() * sizeof(float), output_device, | ||
| 243 | + output.size() * sizeof(float), ACL_MEMCPY_DEVICE_TO_HOST); | ||
| 244 | + | ||
| 245 | + PrintNzBlock("Output Nz first block", output); | ||
| 246 | + PrintNzBlock("Golden Nz first block", golden); | ||
| 247 | + bool passed = true; | ||
| 248 | + for (size_t i = 0; i < output.size(); ++i) { | ||
| 249 | + if (output[i] != golden[i]) { | ||
| 250 | + std::cerr << "Mismatch at Nz offset " << i << ": output=" << output[i] | ||
| 251 | + << ", golden=" << golden[i] << std::endl; | ||
| 252 | + passed = false; | ||
| 253 | + break; | ||
| 254 | + } | ||
| 255 | + } | ||
| 256 | + | ||
| 257 | + aclrtFree(output_device); | ||
| 258 | + aclrtFree(b_device); | ||
| 259 | + aclrtFree(a_device); | ||
| 260 | + aclrtResetDevice(0); | ||
| 261 | + aclFinalize(); | ||
| 262 | + if (!passed) { | ||
| 263 | + return 1; | ||
| 264 | + } | ||
| 265 | + std::cout << "[Success] asc_copy_gm2l1 2D Nz matrix multiplication passed." << std::endl; | ||
| 266 | + return 0; | ||
| 267 | +} | ||
| 268 | +``` | ||
Mdocs/zh/api/SIMD-API/c_api/vector_datamove/asc_copy_gm2ub_align/asc_copy_gm2ub_align_arch_2201.md+0-14File content is under review, please try again later
Mdocs/zh/api/SIMD-API/c_api/vector_datamove/asc_copy_ub2gm/asc_copy_ub2gm_arch_2201.md+0-6File content is under review, please try again later
Mdocs/zh/api/SIMD-API/c_api/vector_datamove/asc_copy_ub2gm_align/asc_copy_ub2gm_align_arch_2201.md+0-17File content is under review, please try again later
Mdocs/zh/api/SIMD-API/c_api/vector_datamove/asc_copy_ub2ub.md+0-6File content is under review, please try again later
调用示例中没有出现废弃接口 建议把废弃接口的调用示例删掉