API Category Index
| API Category | Covered APIs | Core Documentation | Typical Scenarios |
|---|---|---|---|
| Arithmetic Operations | Add, Sub, Mul, Div, Adds, Muls | api-arithmetic.md | Softmax, LayerNorm, broadcast optimization |
| Reduction Operations | ReduceMax, ReduceSum | api-reduce.md, api-reduce-pattern.md | Softmax, LayerNorm, ReduceMean |
| Data Movement | DataCopy, DataCopyPad | api-datacopy.md | Unaligned handling, multi-dimensional movement |
| Transpose / Reorder | TransDataTo5HD, Gather | api-transpose.md | Small-channel transpose, permute |
| Buffer Management | TBuf, TQue | api-buffer.md | Double Buffer, memory planning |
| Precision Conversion | Cast | api-precision.md | FP16/FP32 mixed precision |
| Pipeline Synchronization | EnQue, DeQue, SetFlag | api-pipeline.md | Multi-level pipeline, event synchronization |
| Compare 256B Alignment | Compare | api-restrictions.md | Padding strategy |
| repeatTime Restrictions | repeatTimes ≤ 255 | api-repeat-limits.md | Batch processing |
| API Restrictions | - | api-restrictions.md | Disabled APIs, compile-time restrictions |
| Host Runtime | aclrtSetDevice, aclrtGetDeviceInfo | api-host-runtime.md | Device initialization, core count retrieval |
Scenario Index
| Use Scenario | Related Documentation | Key Techniques |
|---|---|---|
| Softmax/LayerNorm | api-reduce.md, api-reduce-pattern.md, api-arithmetic.md | Scalar operations, broadcast optimization, Buffer reuse |
| Row-by-row processing (AR template) | api-arithmetic.md | Adds/Muls, save UB |
| Transpose / Reorder | api-transpose.md | 2-dimensional transpose performance |
| Multi-row broadcast (ARA template) | api-arithmetic.md | BinaryRepeatParams.src1RepStride=0, batch processing |
| Half-precision addition and subtraction (FP16/BF16 Add/Sub) | api-arithmetic.md, api-precision.md | Default precision promotion (unless the spec explicitly states same magnitude), in-place reuse |
| Unaligned data | api-datacopy.md | DataCopyPad, 32-byte alignment |
| Mixed precision | api-precision.md | FP16 input, FP32 computation |
| Pipeline optimization | api-pipeline.md, api-buffer.md | Double Buffer, event synchronization |
| Performance tuning | api-buffer.md, api-repeat-limits.md | Double Buffer, repeatTimes optimization |
| Encountering API restrictions | api-restrictions.md | Alternative solutions, pitfall-avoidance guide |
Quick Reference
Complete API parameter quick reference table:api-quickref.md
⛔️ API Blacklist
Prohibited in production code:
| API | Reason for Prohibition | Alternative Solution | Documentation |
|---|---|---|---|
GlobalTensor::SetValue() |
Extremely low efficiency | DataCopyPad |
api-datacopy.md |
GlobalTensor::GetValue() |
Extremely low efficiency | DataCopyPad |
api-datacopy.md |
APIs with Usage Restrictions:
| API | Restriction Conditions | Description | Documentation |
|---|---|---|---|
DataCopy(GM↔UB) |
Only when moving dataStrict 32-byte alignmentis allowed for use | Must be used in unaligned scenarios DataCopyPad |
api-datacopy.md |
Only allowed for debugging:
// ✅ 调试:单点验证
AscendC::printf("debug: xGm[0]=%f\n", xGm.GetValue(0));