cann-workbench 0.0.0-stage → 0.0.2-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +183 -2
- package/THIRD_PARTY_NOTICES.md +85 -0
- package/cordis.patch.yml +3 -0
- package/doctor/LICENSE +202 -0
- package/doctor/NOTICE +12 -0
- package/doctor/README.md +18 -0
- package/lib/client.js +94437 -0
- package/lib/index.d.ts +722 -0
- package/lib/index.js +33711 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +171 -4
- package/skills/asc-tools/tool-ops-tune/INSTALL.md +52 -0
- package/skills/asc-tools/tool-ops-tune/LICENSE +38 -0
- package/skills/asc-tools/tool-ops-tune/README.md +167 -0
- package/skills/asc-tools/tool-ops-tune/SKILL.md +93 -0
- package/skills/asc-tools/tool-ops-tune/agent/AGENTS.md +195 -0
- package/skills/asc-tools/tool-ops-tune/agent/agents/perf-implementer.md +68 -0
- package/skills/asc-tools/tool-ops-tune/agent/agents/perf-reviewer.md +86 -0
- package/skills/asc-tools/tool-ops-tune/agent/workflows/task-prompts.md +362 -0
- package/skills/asc-tools/tool-ops-tune/agent/workflows/troubleshooting.md +43 -0
- package/skills/asc-tools/tool-ops-tune/docs/figures/opstune-architecture.png +0 -0
- package/skills/asc-tools/tool-ops-tune/docs/figures/opstune-architecture.svg +253 -0
- package/skills/asc-tools/tool-ops-tune/docs/ops-tune-design.md +404 -0
- package/skills/asc-tools/tool-ops-tune/docs//347/224/250/344/276/213/346/236/204/345/273/272.md +730 -0
- package/skills/asc-tools/tool-ops-tune/docs//347/237/245/350/257/206/345/272/223/350/247/204/350/214/203.md +103 -0
- package/skills/asc-tools/tool-ops-tune/evals/evals.json +242 -0
- package/skills/asc-tools/tool-ops-tune/ops-collect/SKILL.md +146 -0
- package/skills/asc-tools/tool-ops-tune/ops-collect/references/tool-routing.md +86 -0
- package/skills/asc-tools/tool-ops-tune/ops-collect/scripts/collect_board.sh +458 -0
- package/skills/asc-tools/tool-ops-tune/ops-collect/scripts/collect_cases.py +368 -0
- package/skills/asc-tools/tool-ops-tune/ops-collect/scripts/collect_sim.sh +134 -0
- package/skills/asc-tools/tool-ops-tune/ops-collect/scripts/csv_to_db.py +314 -0
- package/skills/asc-tools/tool-ops-tune/ops-collect/scripts/db_bench.py +545 -0
- package/skills/asc-tools/tool-ops-tune/ops-collect/scripts/facts_bridge.py +1102 -0
- package/skills/asc-tools/tool-ops-tune/ops-collect/scripts/isolation_test.py +452 -0
- package/skills/asc-tools/tool-ops-tune/ops-collect/scripts/jsonl_to_cases.py +163 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/SKILL.md +76 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/broadcast/advanced_tiling.md +92 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/broadcast/broadcast_design.md +160 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/broadcast/code/broadcast_add_kernel.cpp +126 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/broadcast/code/broadcast_add_tiling.cpp +144 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/broadcast/code/broadcast_tiling_common.h +401 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/broadcast/code/onedim_add_kernel.cpp +107 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/broadcast/code/onedim_add_tiling.cpp +64 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/broadcast/datacopypad_design.md +46 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/broadcast/guide.md +14 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/broadcast/nddma_design.md +53 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/broadcast/onedim_design.md +114 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/broadcast/ub_broadcast_design.md +67 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/common/datacopy_optimization_design.md +351 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/common/index.md +9 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/common/tail_block_design.md +268 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/common/timing_harness/index.md +38 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/common/timing_harness/timing_harness_aclrt_event.cpp +199 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/common/timing_harness/timing_harness_torch_event.py +130 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/common/ub_resident_design.md +342 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/guide.md +69 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/index.md +4 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/templates/dav3510/transpose_base.template +81 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/templates/dav3510/transpose_big_dim.template +217 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/templates/dav3510/transpose_cut_one_axis.template +336 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/templates/dav3510/transpose_cut_two_axis.template +781 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/templates/dav3510/transpose_n_last.template +340 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/templates/dav3510/transpose_small_shape.template +321 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/templates/dav3510/transpose_tensor_move.template +102 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/templates/dav3510/transpose_transdata_5hd.template +480 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/templates/dav3510/transpose_transdata_5hd_021axis.template +533 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/templates/dav3510/transpose_with_gather.template +688 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/templates/transpose_tiling_data.template +192 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/transpose_big_dim.md +220 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/transpose_cut_one_axis.md +175 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/transpose_cut_two_axis.md +177 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/transpose_fusion_design.md +398 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/transpose_gather.md +191 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/transpose_n_last.md +276 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/transpose_small_shape.md +315 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/transpose_tensor_move.md +203 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/transpose_tiling_data.md +176 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/transpose_vconv_021.md +206 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/conversion/transpose_vconv_5hd.md +179 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/elementwise/double_buffer_design.md +288 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/elementwise/guide.md +46 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/elementwise/index.md +10 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/elementwise/templates/add_custom/CMakeLists.txt +131 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/elementwise/templates/add_custom/README.md +55 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/elementwise/templates/add_custom/op_extension/add_custom_torch.cpp +80 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/elementwise/templates/add_custom/op_extension/ops.h +23 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/elementwise/templates/add_custom/op_extension/register.cpp +30 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/elementwise/templates/add_custom/op_host/add_custom.asc +149 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/elementwise/templates/add_custom/op_host/data_utils.h +97 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/elementwise/templates/add_custom/op_kernel/add_custom_kernel.asc +136 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/elementwise/templates/add_custom/op_kernel/add_custom_tiling.h +31 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/elementwise/templates/add_custom/run.sh +87 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/elementwise/templates/add_custom/scripts/gen_data.py +70 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/elementwise/templates/add_custom/scripts/golden.py +34 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/elementwise/templates/add_custom/scripts/test_torch.py +99 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/elementwise/templates/add_custom/scripts/verify_result.py +56 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/elementwise/templates/usage_guide.md +61 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/elementwise/vector_efficiency_design.md +203 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/fa/fa_mixed_kernel_design.md +174 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/fa/fa_roofline_design.md +141 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/fa/guide.md +87 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/knowledge_gaps.json +56 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/matmul/best-practices-guide.md +14 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/matmul/fullload_design.md +344 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/matmul/guide.md +52 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/matmul/mte2_preload_design.md +320 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/matmul/pingpong_design.md +254 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/matmul/scale_coalescing_design.md +282 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/matmul/streamk_design.md +374 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/matmul/swat_design.md +423 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/matmul/templates/matmul_basic_blaze.template +165 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/matmul/templates/usage_guide.md +29 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/mc2/best-practices-guide.md +43 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/mc2/guide.md +42 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/mc2/local_matmul_design.md +130 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/mc2/pipeline_balancing_design.md +502 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/reduce/guide.md +178 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/reduce/templates/dav310/kernel_utils.template +75 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/reduce/templates/dav310/softmax_v2_ar_full_load.template +429 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/reduce/templates/dav310/softmax_v2_ar_recompute.template +485 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/reduce/templates/dav310/softmax_v2_ar_small_r.template +348 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/reduce/templates/dav310/softmax_v2_ara_full_load.template +574 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/reduce/templates/dav310/softmax_v2_ara_online.template +324 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/reduce/templates/dav310/softmax_v2_ara_recompute.template +436 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/reduce/templates/dav310/softmax_v2_base.template +950 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/reduce/templates/fused_attention_online_softmax_design.md +428 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/reduce/templates/softmax_v2_ar_full_load.md +137 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/reduce/templates/softmax_v2_ar_recompute.md +135 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/reduce/templates/softmax_v2_ar_small_r.md +122 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/reduce/templates/softmax_v2_ara_full_load.md +144 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/reduce/templates/softmax_v2_ara_online.md +185 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/reduce/templates/softmax_v2_ara_recompute.md +163 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/reduce/templates/softmax_v2_tiling.template +460 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/reduce/templates/softmax_v2_tiling_data.template +278 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/reduce/templates/state_resident_design.md +337 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/reduce/templates/usage_guide.md +253 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/scalar/coding_principles.md +476 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/scalar/conv_scalar.md +163 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/scalar/guide.md +30 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/simt/guide.md +91 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/simt/optimization-guide.md +110 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/sort/guide.md +83 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/references/sort/radix_sort.md +354 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/scripts/family_asset_audit.py +68 -0
- package/skills/asc-tools/tool-ops-tune/ops-family/scripts/tiling_candidates.py +419 -0
- package/skills/asc-tools/tool-ops-tune/ops-mechanism/SKILL.md +23 -0
- package/skills/asc-tools/tool-ops-tune/ops-mechanism/cases/ascendc/case_groupedmatmul_pipeline.md +23 -0
- package/skills/asc-tools/tool-ops-tune/ops-mechanism/cases/ascendc/case_triton_atomic_revert.md +19 -0
- package/skills/asc-tools/tool-ops-tune/ops-mechanism/cases/mc2/case_mc2_fusion.md +19 -0
- package/skills/asc-tools/tool-ops-tune/ops-mechanism/references/optimize/api-usage.md +70 -0
- package/skills/asc-tools/tool-ops-tune/ops-mechanism/references/optimize/ascendc-regbase-vf.md +45 -0
- package/skills/asc-tools/tool-ops-tune/ops-mechanism/references/optimize/ascendc-tiling.md +51 -0
- package/skills/asc-tools/tool-ops-tune/ops-mechanism/references/optimize/data-copy.md +67 -0
- package/skills/asc-tools/tool-ops-tune/ops-mechanism/references/optimize/index.md +45 -0
- package/skills/asc-tools/tool-ops-tune/ops-mechanism/references/optimize/mc2-balancing.md +77 -0
- package/skills/asc-tools/tool-ops-tune/ops-mechanism/references/optimize/mc2.md +103 -0
- package/skills/asc-tools/tool-ops-tune/ops-mechanism/references/optimize/memory-hierarchy.md +40 -0
- package/skills/asc-tools/tool-ops-tune/ops-mechanism/references/optimize/pipeline.md +95 -0
- package/skills/asc-tools/tool-ops-tune/ops-mechanism/scripts/case_backfill.py +170 -0
- package/skills/asc-tools/tool-ops-tune/ops-mechanism/scripts/log_gap.py +145 -0
- package/skills/asc-tools/tool-ops-tune/ops-mechanism/scripts/mc2_search.py +367 -0
- package/skills/asc-tools/tool-ops-tune/ops-report/SKILL.md +77 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/evals/run_evals.py +963 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/evals/smoke/install-hooks.sh +65 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/evals/smoke/run_smoke.sh +535 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/fixtures/core_tail_a5.csv +25 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/fixtures/few_cores_a5.csv +5 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/fixtures/mte2_bound_a2.csv +17 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/fixtures/multi_kernel_mix_a5.csv +7 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/fixtures/no_bound_a5.csv +9 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/fixtures/serial_no_overlap_a2.csv +9 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/fixtures/vec_bound_a5.csv +9 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/references/io-contracts.md +94 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/references/rule-schema.md +130 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/references/scope-schema.md +61 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/references/soc-spec.yaml +140 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/rules/L0-instruction.yaml +67 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/rules/L1-single-core.yaml +316 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/rules/L2-inter-core.yaml +173 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/rules/L3-inter-card.yaml +156 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/scripts/batch_pipeline.py +466 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/scripts/calibrate.py +249 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/scripts/delta_compare.py +278 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/scripts/render_html.py +304 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/scripts/snapshot.py +200 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/scripts/trace_bubble.py +331 -0
- package/skills/asc-tools/tool-ops-tune/ops-verdict/scripts/verdict.py +1094 -0
- package/skills/asc-tools/tool-ops-tune/scripts/diff_audit.py +281 -0
- package/skills/asc-tools/tool-precision-debug/LICENSE +38 -0
- package/skills/asc-tools/tool-precision-debug/README.md +190 -0
- package/skills/asc-tools/tool-precision-debug/scripts/install.sh +475 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/LICENSE +38 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/SKILL.md +136 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/evals/evals.json +932 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/diagnosis/baseline.md +69 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/diagnosis/checkpoint-design.md +82 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/diagnosis/dumptensor.md +83 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/diagnosis/hypothesis-experiment.md +114 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/diagnosis/index.md +20 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/diagnosis/localization.md +85 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/diagnosis/numerical-modeling.md +94 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/diagnosis/operator-modeling.md +116 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/diagnosis/progressive-error-analysis.md +86 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/diagnosis/reporting.md +140 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/diagnosis/reproducibility.md +121 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/diagnosis/semantic-bisection.md +72 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/diagnosis/sensitive-points.md +146 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/cases/fp16-promotion-boundary.md +46 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/cases/fused-rmsnorm-gelu-residual.md +162 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/cases/index.md +16 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/cases/integer-float-collision.md +44 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/cases/partial-statistics-merge.md +30 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/cases/softplus-v2-grad-family.md +156 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/cases/sync-dataflow-handshake.md +89 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/cases/tail-valid-region-state.md +30 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/cases/thnn-fused-gru-bias-reduction.md +73 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/index.md +34 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/mechanisms/accumulation-order.md +108 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/mechanisms/algorithm-parameter-contract.md +118 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/mechanisms/buffer-lifetime-alias.md +133 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/mechanisms/cast-rounding.md +76 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/mechanisms/complex-operator-boundary.md +48 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/mechanisms/data-movement-alignment.md +104 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/mechanisms/golden-host-contract.md +84 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/mechanisms/index-address-ownership.md +57 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/mechanisms/index.md +32 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/mechanisms/multicore-ownership.md +117 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/mechanisms/pipeline-sync-visibility.md +146 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/mechanisms/precision-mode-approximation.md +90 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/mechanisms/shape-boundary-contract.md +57 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/mechanisms/special-values.md +122 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/mechanisms/tiling-tail-state.md +146 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/operators/broadcast-transpose.md +64 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/operators/convolution.md +60 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/operators/dynamic-quant.md +47 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/operators/index.md +18 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/operators/matmul-mmad.md +131 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/operators/normalization.md +145 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/operators/reduction.md +167 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/operators/softplus-v2-grad.md +58 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/patterns/operators/sort-merge.md +65 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/tools/index.md +18 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/tools/kernel-debug-data.md +133 -0
- package/skills/asc-tools/tool-precision-debug/skills/tool-precision-debug/references/tools/msobjdump.md +150 -0
- package/skills/cann-doctor/SKILL.md +15 -0
- package/skills/catalog.json +79 -0
- package/skills/mattpocock/GLOSSARY.md +30 -0
- package/skills/mattpocock/LICENSE +21 -0
- package/skills/mattpocock/README.md +258 -0
- package/skills/mattpocock/SCOPE.md +35 -0
- package/skills/mattpocock/docs/agents/triage-labels.md +15 -0
- package/skills/mattpocock/docs/engineering/ask-matt.md +91 -0
- package/skills/mattpocock/docs/engineering/code-review.md +101 -0
- package/skills/mattpocock/docs/engineering/codebase-design.md +88 -0
- package/skills/mattpocock/docs/engineering/diagnosing-bugs.md +94 -0
- package/skills/mattpocock/docs/engineering/domain-modeling.md +86 -0
- package/skills/mattpocock/docs/engineering/grill-with-docs.md +82 -0
- package/skills/mattpocock/docs/engineering/implement-spec.md +86 -0
- package/skills/mattpocock/docs/engineering/implement.md +97 -0
- package/skills/mattpocock/docs/engineering/improve-codebase-architecture.md +113 -0
- package/skills/mattpocock/docs/engineering/pr.md +79 -0
- package/skills/mattpocock/docs/engineering/prototype.md +67 -0
- package/skills/mattpocock/docs/engineering/research.md +73 -0
- package/skills/mattpocock/docs/engineering/resolving-merge-conflicts.md +53 -0
- package/skills/mattpocock/docs/engineering/retro.md +81 -0
- package/skills/mattpocock/docs/engineering/setup-matt-pocock-skills.md +94 -0
- package/skills/mattpocock/docs/engineering/tdd.md +94 -0
- package/skills/mattpocock/docs/engineering/to-spec.md +81 -0
- package/skills/mattpocock/docs/engineering/to-tickets.md +99 -0
- package/skills/mattpocock/docs/engineering/triage.md +109 -0
- package/skills/mattpocock/docs/engineering/wayfinder.md +103 -0
- package/skills/mattpocock/docs/engineering/wizard.md +96 -0
- package/skills/mattpocock/docs/productivity/grill-me.md +76 -0
- package/skills/mattpocock/docs/productivity/grilling.md +87 -0
- package/skills/mattpocock/docs/productivity/handoff.md +76 -0
- package/skills/mattpocock/docs/productivity/teach.md +97 -0
- package/skills/mattpocock/docs/productivity/to-questionnaire.md +78 -0
- package/skills/mattpocock/docs/productivity/wait-what.md +36 -0
- package/skills/mattpocock/docs/productivity/writing-for-agents.md +70 -0
- package/skills/mattpocock/scripts/link-skills.sh +62 -0
- package/skills/mattpocock/scripts/list-skills.sh +7 -0
- package/skills/mattpocock/scripts/sync-plugin-version.mjs +41 -0
- package/skills/mattpocock/skills/deprecated/README.md +3 -0
- package/skills/mattpocock/skills/engineering/README.md +34 -0
- package/skills/mattpocock/skills/engineering/ask-matt/PHASE-BOUNDARIES.md +55 -0
- package/skills/mattpocock/skills/engineering/ask-matt/SKILL.md +97 -0
- package/skills/mattpocock/skills/engineering/ask-matt/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/engineering/code-review/SKILL.md +89 -0
- package/skills/mattpocock/skills/engineering/code-review/agents/openai.yaml +3 -0
- package/skills/mattpocock/skills/engineering/codebase-design/DEEPENING.md +37 -0
- package/skills/mattpocock/skills/engineering/codebase-design/DESIGN-IT-TWICE.md +44 -0
- package/skills/mattpocock/skills/engineering/codebase-design/SKILL.md +114 -0
- package/skills/mattpocock/skills/engineering/codebase-design/agents/openai.yaml +3 -0
- package/skills/mattpocock/skills/engineering/diagnosing-bugs/SKILL.md +138 -0
- package/skills/mattpocock/skills/engineering/diagnosing-bugs/agents/openai.yaml +3 -0
- package/skills/mattpocock/skills/engineering/diagnosing-bugs/scripts/hitl-loop.template.sh +44 -0
- package/skills/mattpocock/skills/engineering/domain-modeling/ADR-FORMAT.md +47 -0
- package/skills/mattpocock/skills/engineering/domain-modeling/GLOSSARY-FORMAT.md +60 -0
- package/skills/mattpocock/skills/engineering/domain-modeling/SKILL.md +74 -0
- package/skills/mattpocock/skills/engineering/domain-modeling/agents/openai.yaml +3 -0
- package/skills/mattpocock/skills/engineering/grill-with-docs/SKILL.md +7 -0
- package/skills/mattpocock/skills/engineering/grill-with-docs/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/engineering/implement/SKILL.md +17 -0
- package/skills/mattpocock/skills/engineering/implement/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/engineering/implement-spec/SKILL.md +42 -0
- package/skills/mattpocock/skills/engineering/implement-spec/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/engineering/improve-codebase-architecture/HTML-REPORT.md +123 -0
- package/skills/mattpocock/skills/engineering/improve-codebase-architecture/SKILL.md +71 -0
- package/skills/mattpocock/skills/engineering/improve-codebase-architecture/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/engineering/pr/CREDITS.md +3 -0
- package/skills/mattpocock/skills/engineering/pr/SKILL.md +170 -0
- package/skills/mattpocock/skills/engineering/pr/agents/openai.yaml +3 -0
- package/skills/mattpocock/skills/engineering/prototype/LOGIC.md +67 -0
- package/skills/mattpocock/skills/engineering/prototype/SKILL.md +26 -0
- package/skills/mattpocock/skills/engineering/prototype/UI.md +112 -0
- package/skills/mattpocock/skills/engineering/prototype/agents/openai.yaml +3 -0
- package/skills/mattpocock/skills/engineering/research/SKILL.md +12 -0
- package/skills/mattpocock/skills/engineering/research/agents/openai.yaml +3 -0
- package/skills/mattpocock/skills/engineering/retro/SKILL.md +44 -0
- package/skills/mattpocock/skills/engineering/retro/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/engineering/setup-matt-pocock-skills/SKILL.md +120 -0
- package/skills/mattpocock/skills/engineering/setup-matt-pocock-skills/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/engineering/setup-matt-pocock-skills/domain.md +51 -0
- package/skills/mattpocock/skills/engineering/setup-matt-pocock-skills/issue-tracker-github.md +50 -0
- package/skills/mattpocock/skills/engineering/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
- package/skills/mattpocock/skills/engineering/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
- package/skills/mattpocock/skills/engineering/setup-matt-pocock-skills/triage-labels.md +15 -0
- package/skills/mattpocock/skills/engineering/tdd/SKILL.md +38 -0
- package/skills/mattpocock/skills/engineering/tdd/agents/openai.yaml +3 -0
- package/skills/mattpocock/skills/engineering/tdd/mocking.md +59 -0
- package/skills/mattpocock/skills/engineering/tdd/tests.md +77 -0
- package/skills/mattpocock/skills/engineering/to-spec/SKILL.md +75 -0
- package/skills/mattpocock/skills/engineering/to-spec/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/engineering/to-tickets/SKILL.md +105 -0
- package/skills/mattpocock/skills/engineering/to-tickets/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/engineering/triage/AGENT-BRIEF.md +207 -0
- package/skills/mattpocock/skills/engineering/triage/OUT-OF-SCOPE.md +105 -0
- package/skills/mattpocock/skills/engineering/triage/SKILL.md +112 -0
- package/skills/mattpocock/skills/engineering/triage/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/engineering/wayfinder/SKILL.md +128 -0
- package/skills/mattpocock/skills/engineering/wayfinder/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/engineering/wizard/SKILL.md +44 -0
- package/skills/mattpocock/skills/engineering/wizard/agents/openai.yaml +3 -0
- package/skills/mattpocock/skills/engineering/wizard/template.sh +223 -0
- package/skills/mattpocock/skills/in-progress/README.md +17 -0
- package/skills/mattpocock/skills/in-progress/chief-of-staff/SKILL.md +75 -0
- package/skills/mattpocock/skills/in-progress/chief-of-staff/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/in-progress/claude-handoff/SKILL.md +18 -0
- package/skills/mattpocock/skills/in-progress/claude-handoff/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/in-progress/loop-me/SKILL.md +32 -0
- package/skills/mattpocock/skills/in-progress/loop-me/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/in-progress/setup-ts-deep-modules/SKILL.md +102 -0
- package/skills/mattpocock/skills/in-progress/setup-ts-deep-modules/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/in-progress/setup-ts-deep-modules/dependency-cruiser.config.cjs +95 -0
- package/skills/mattpocock/skills/in-progress/software-factory/EXAMPLE-TASKS.md +80 -0
- package/skills/mattpocock/skills/in-progress/software-factory/GIT-HOSTS.md +84 -0
- package/skills/mattpocock/skills/in-progress/software-factory/OBSERVABILITY-PLATFORMS.md +75 -0
- package/skills/mattpocock/skills/in-progress/software-factory/RUNNERS.md +94 -0
- package/skills/mattpocock/skills/in-progress/software-factory/SKILL.md +98 -0
- package/skills/mattpocock/skills/in-progress/software-factory/TICKET-TRACKERS.md +85 -0
- package/skills/mattpocock/skills/in-progress/writing-beats/SKILL.md +67 -0
- package/skills/mattpocock/skills/in-progress/writing-beats/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/in-progress/writing-fragments/SKILL.md +79 -0
- package/skills/mattpocock/skills/in-progress/writing-fragments/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/in-progress/writing-shape/SKILL.md +79 -0
- package/skills/mattpocock/skills/in-progress/writing-shape/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/misc/README.md +8 -0
- package/skills/mattpocock/skills/misc/git-guardrails-claude-code/SKILL.md +95 -0
- package/skills/mattpocock/skills/misc/git-guardrails-claude-code/agents/openai.yaml +3 -0
- package/skills/mattpocock/skills/misc/git-guardrails-claude-code/scripts/block-dangerous-git.sh +25 -0
- package/skills/mattpocock/skills/misc/migrate-to-shoehorn/SKILL.md +118 -0
- package/skills/mattpocock/skills/misc/migrate-to-shoehorn/agents/openai.yaml +3 -0
- package/skills/mattpocock/skills/misc/scaffold-exercises/SKILL.md +106 -0
- package/skills/mattpocock/skills/misc/scaffold-exercises/agents/openai.yaml +3 -0
- package/skills/mattpocock/skills/misc/setup-pre-commit/SKILL.md +91 -0
- package/skills/mattpocock/skills/misc/setup-pre-commit/agents/openai.yaml +3 -0
- package/skills/mattpocock/skills/productivity/README.md +20 -0
- package/skills/mattpocock/skills/productivity/grill-me/SKILL.md +7 -0
- package/skills/mattpocock/skills/productivity/grill-me/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/productivity/grilling/SKILL.md +30 -0
- package/skills/mattpocock/skills/productivity/grilling/agents/openai.yaml +3 -0
- package/skills/mattpocock/skills/productivity/handoff/SKILL.md +16 -0
- package/skills/mattpocock/skills/productivity/handoff/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/productivity/teach/GLOSSARY-FORMAT.md +35 -0
- package/skills/mattpocock/skills/productivity/teach/LEARNING-RECORD-FORMAT.md +46 -0
- package/skills/mattpocock/skills/productivity/teach/MISSION-FORMAT.md +31 -0
- package/skills/mattpocock/skills/productivity/teach/RESOURCES-FORMAT.md +32 -0
- package/skills/mattpocock/skills/productivity/teach/SKILL.md +140 -0
- package/skills/mattpocock/skills/productivity/teach/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/productivity/to-questionnaire/SKILL.md +54 -0
- package/skills/mattpocock/skills/productivity/to-questionnaire/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/productivity/wait-what/SKILL.md +7 -0
- package/skills/mattpocock/skills/productivity/wait-what/agents/openai.yaml +5 -0
- package/skills/mattpocock/skills/productivity/writing-for-agents/SKILL-MECHANICS.md +22 -0
- package/skills/mattpocock/skills/productivity/writing-for-agents/SKILL.md +81 -0
- package/skills/mattpocock/skills/productivity/writing-for-agents/agents/openai.yaml +3 -0
- package/skills/task-agents/operator-development/Agent.md +71 -0
- package/skills/task-agents/operator-development/skills.json +120 -0
- package/skills/task-agents/operator-development/stages.schema.json +532 -0
- package/skills/task-agents/performance-optimization/Agent.md +78 -0
- package/skills/task-agents/performance-optimization/skills.json +64 -0
- package/skills/task-agents/response-protocol.md +35 -0
- package/skills/task-agents/sidebar-contracts.schema.json +4168 -0
- package/skills/task-agents/sidebar-selection.schema.json +971 -0
- package/skills/task-agents/visuals/components.json +283 -0
- package/skills/task-agents/visuals/contracts.schema.json +3628 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Huawei Technologies Co., Ltd.
|
|
3
|
+
* This program is free software, you can redistribute it and/or modify it under the terms and conditions of
|
|
4
|
+
* CANN Open Software License Agreement Version 2.0 (the "License").
|
|
5
|
+
* Please refer to the License for details. You may not use this file except in compliance with the License.
|
|
6
|
+
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
|
|
7
|
+
* INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
|
|
8
|
+
* See LICENSE in the root of the software repository for the full text of the License.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/*!
|
|
12
|
+
* \file transpose_n_last.h
|
|
13
|
+
* \brief transpose_n_last
|
|
14
|
+
*/
|
|
15
|
+
#ifndef TRANSPOSE_N_LAST_H
|
|
16
|
+
#define TRANSPOSE_N_LAST_H
|
|
17
|
+
|
|
18
|
+
#include "transpose_base.h"
|
|
19
|
+
|
|
20
|
+
namespace Transpose {
|
|
21
|
+
using namespace AscendC;
|
|
22
|
+
|
|
23
|
+
template <typename T>
|
|
24
|
+
class TransposeNLast : public TransposeBase<T> {
|
|
25
|
+
public:
|
|
26
|
+
__aicore__ inline TransposeNLast(){};
|
|
27
|
+
__aicore__ inline void Init(GM_ADDR x, GM_ADDR y, const TransposeOpTilingData* tilingData, TPipe* pipe);
|
|
28
|
+
__aicore__ inline void Process();
|
|
29
|
+
|
|
30
|
+
private:
|
|
31
|
+
__aicore__ inline void ParseTilingData();
|
|
32
|
+
__aicore__ inline void GetBlockLoopNum();
|
|
33
|
+
__aicore__ inline void GetLoopParams(int64_t n);
|
|
34
|
+
__aicore__ inline int64_t GetDstAddressOffset(int64_t loopIdx, int64_t permSize, const int64_t mixedBase[],
|
|
35
|
+
const int64_t loopNum[]);
|
|
36
|
+
__aicore__ inline void ProcessPerCore();
|
|
37
|
+
__aicore__ inline void CopyIn(int64_t loopIdx, int64_t inputBlockLen, int64_t inCutLoopSize, int64_t inUbFactor,
|
|
38
|
+
int64_t inTailFactor, int64_t permSize);
|
|
39
|
+
__aicore__ inline void CopyOut(int64_t loopIdx, int64_t loopSize[], int64_t loopSrcStride[],
|
|
40
|
+
int64_t loopDstStride[], int64_t permSize, const int64_t mixedBase[],
|
|
41
|
+
const int64_t loopNum[]);
|
|
42
|
+
|
|
43
|
+
private:
|
|
44
|
+
int64_t blockIdx_;
|
|
45
|
+
|
|
46
|
+
// buffer
|
|
47
|
+
TQueBind<QuePosition::VECIN, QuePosition::VECOUT, 1> vecQue_;
|
|
48
|
+
GlobalTensor<T> inputGM_;
|
|
49
|
+
GlobalTensor<T> outputGM_;
|
|
50
|
+
|
|
51
|
+
// tiling params
|
|
52
|
+
const TransposeOpTilingData* tiling_;
|
|
53
|
+
int64_t reducedInputShape_[TRANSPOSE_MAX_AXIS_NUM] = {0, 0, 0, 0, 0, 0, 0, 0};
|
|
54
|
+
int64_t reducedOutputShape_[TRANSPOSE_MAX_AXIS_NUM] = {0, 0, 0, 0, 0, 0, 0, 0};
|
|
55
|
+
int64_t inUbInputShapeMain_[TRANSPOSE_MAX_AXIS_NUM] = {0, 0, 0, 0, 0, 0, 0, 0};
|
|
56
|
+
int64_t inUbOutputShapeMain_[TRANSPOSE_MAX_AXIS_NUM] = {0, 0, 0, 0, 0, 0, 0, 0};
|
|
57
|
+
int64_t inUbInputShapeTail_[TRANSPOSE_MAX_AXIS_NUM] = {0, 0, 0, 0, 0, 0, 0, 0};
|
|
58
|
+
int64_t inUbOutputShapeTail_[TRANSPOSE_MAX_AXIS_NUM] = {0, 0, 0, 0, 0, 0, 0, 0};
|
|
59
|
+
int64_t outputBlockLenMain_ = 0;
|
|
60
|
+
int64_t outputBlockLenTail_ = 0;
|
|
61
|
+
|
|
62
|
+
// core params
|
|
63
|
+
int64_t blkProcessNum_ = 0;
|
|
64
|
+
int64_t blkProcessIdxStart_ = 0;
|
|
65
|
+
int64_t blkProcessIdxEnd_ = 0;
|
|
66
|
+
|
|
67
|
+
// addressOffset params
|
|
68
|
+
int64_t dstAddressOffsetMixedBase_[TRANSPOSE_MAX_AXIS_NUM] = {0, 0, 0, 0, 0, 0, 0, 0};
|
|
69
|
+
int64_t dstLoopNumArray_[TRANSPOSE_MAX_AXIS_NUM] = {0, 0, 0, 0, 0, 0, 0, 0};
|
|
70
|
+
|
|
71
|
+
// dataCopy params
|
|
72
|
+
int64_t loopSizeMain_[TRANSPOSE_MAX_AXIS_NUM] = {1, 1, 1, 1, 1, 1, 1, 1};
|
|
73
|
+
int64_t loopSrcStrideMain_[TRANSPOSE_MAX_AXIS_NUM] = {0, 0, 0, 0, 0, 0, 0, 0};
|
|
74
|
+
int64_t loopDstStrideMain_[TRANSPOSE_MAX_AXIS_NUM] = {0, 0, 0, 0, 0, 0, 0, 0};
|
|
75
|
+
int64_t loopSizeTail_[TRANSPOSE_MAX_AXIS_NUM] = {1, 1, 1, 1, 1, 1, 1, 1};
|
|
76
|
+
int64_t loopSrcStrideTail_[TRANSPOSE_MAX_AXIS_NUM] = {0, 0, 0, 0, 0, 0, 0, 0};
|
|
77
|
+
int64_t loopDstStrideTail_[TRANSPOSE_MAX_AXIS_NUM] = {0, 0, 0, 0, 0, 0, 0, 0};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
template <typename T>
|
|
81
|
+
__aicore__ inline void TransposeNLast<T>::Init(GM_ADDR x, GM_ADDR y, const TransposeOpTilingData* tilingData,
|
|
82
|
+
TPipe* pipe)
|
|
83
|
+
{
|
|
84
|
+
blockIdx_ = GetBlockIdx();
|
|
85
|
+
tiling_ = tilingData;
|
|
86
|
+
ParseTilingData();
|
|
87
|
+
inputGM_.SetGlobalBuffer((__gm__ T*)x);
|
|
88
|
+
outputGM_.SetGlobalBuffer((__gm__ T*)y);
|
|
89
|
+
pipe->InitBuffer(vecQue_, BUFFER_NUM, tiling_->ubSize / BUFFER_NUM);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
template <typename T>
|
|
93
|
+
__aicore__ inline void TransposeNLast<T>::Process()
|
|
94
|
+
{
|
|
95
|
+
if (!ParseMultiCoreRange(blockIdx_, tiling_->realCoreNum, tiling_->blkFactor, tiling_->blkTailFactor,
|
|
96
|
+
blkProcessNum_, blkProcessIdxStart_, blkProcessIdxEnd_)) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
ProcessPerCore();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
template <typename T>
|
|
103
|
+
__aicore__ inline void TransposeNLast<T>::ParseTilingData()
|
|
104
|
+
{
|
|
105
|
+
// input in ub shape main and tail
|
|
106
|
+
for (int64_t i = 0; i < tiling_->permSize; i++) {
|
|
107
|
+
reducedInputShape_[i] = tiling_->inputShape[i];
|
|
108
|
+
if (i > tiling_->inCutIndex) {
|
|
109
|
+
inUbInputShapeMain_[i] = reducedInputShape_[i];
|
|
110
|
+
inUbInputShapeTail_[i] = reducedInputShape_[i];
|
|
111
|
+
} else {
|
|
112
|
+
inUbInputShapeMain_[i] = 1;
|
|
113
|
+
inUbInputShapeTail_[i] = 1;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
inUbInputShapeMain_[tiling_->inCutIndex] = tiling_->inUbFactor;
|
|
117
|
+
inUbInputShapeTail_[tiling_->inCutIndex] = tiling_->inTailFactor;
|
|
118
|
+
|
|
119
|
+
// output in ub shape main and tail
|
|
120
|
+
for (int64_t i = 0; i < tiling_->permSize; i++) {
|
|
121
|
+
reducedOutputShape_[i] = reducedInputShape_[tiling_->perm[i]];
|
|
122
|
+
inUbOutputShapeMain_[i] = inUbInputShapeMain_[tiling_->perm[i]];
|
|
123
|
+
inUbOutputShapeTail_[i] = inUbInputShapeTail_[tiling_->perm[i]];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
outputBlockLenMain_ = inUbOutputShapeMain_[tiling_->permSize - 1];
|
|
127
|
+
outputBlockLenTail_ = inUbOutputShapeTail_[tiling_->permSize - 1];
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
template <typename T>
|
|
131
|
+
__aicore__ inline void TransposeNLast<T>::GetBlockLoopNum()
|
|
132
|
+
{
|
|
133
|
+
const int64_t permSize = tiling_->permSize;
|
|
134
|
+
int64_t dstLoopNumArrayTmp[TRANSPOSE_MAX_AXIS_NUM];
|
|
135
|
+
int64_t rightProducts[TRANSPOSE_MAX_AXIS_NUM + 1];
|
|
136
|
+
rightProducts[permSize] = 1;
|
|
137
|
+
|
|
138
|
+
for (int64_t i = permSize - 1; i >= 0; i--) {
|
|
139
|
+
rightProducts[i] = rightProducts[i + 1] * reducedOutputShape_[i];
|
|
140
|
+
}
|
|
141
|
+
for (int64_t i = 0; i < permSize; i++) {
|
|
142
|
+
dstAddressOffsetMixedBase_[i] = Ops::Base::CeilDiv(reducedInputShape_[i], inUbInputShapeMain_[i]);
|
|
143
|
+
dstLoopNumArrayTmp[i] = inUbOutputShapeMain_[i] * rightProducts[i + 1];
|
|
144
|
+
}
|
|
145
|
+
for (int64_t i = 0; i < permSize; i++) {
|
|
146
|
+
dstLoopNumArray_[tiling_->perm[i]] = dstLoopNumArrayTmp[i];
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
template <typename T>
|
|
151
|
+
__aicore__ inline void TransposeNLast<T>::GetLoopParams(int64_t n)
|
|
152
|
+
{
|
|
153
|
+
const int64_t permSize = tiling_->permSize;
|
|
154
|
+
const int64_t reverseIdx = permSize - 1 - n;
|
|
155
|
+
// main and tail loopSize
|
|
156
|
+
loopSizeMain_[n] = inUbInputShapeMain_[reverseIdx];
|
|
157
|
+
loopSizeTail_[n] = inUbInputShapeTail_[reverseIdx];
|
|
158
|
+
// main and tail last axis aligned to ub block size
|
|
159
|
+
int64_t alignedStrideMain = Ops::Base::CeilAlign(static_cast<int64_t>(loopSizeMain_[0] * sizeof(T)),
|
|
160
|
+
BLOCK_SIZE_BYTE) /
|
|
161
|
+
sizeof(T);
|
|
162
|
+
int64_t alignedStrideTail = Ops::Base::CeilAlign(static_cast<int64_t>(loopSizeTail_[0] * sizeof(T)),
|
|
163
|
+
BLOCK_SIZE_BYTE) /
|
|
164
|
+
sizeof(T);
|
|
165
|
+
// main loopSrcStride and loopDstStride
|
|
166
|
+
if (loopSizeMain_[n] != 1) {
|
|
167
|
+
loopSrcStrideMain_[n] = alignedStrideMain;
|
|
168
|
+
if (n == 0) {
|
|
169
|
+
loopSrcStrideMain_[n] = 1;
|
|
170
|
+
}
|
|
171
|
+
for (int64_t i = 1; i < n; i++) {
|
|
172
|
+
loopSrcStrideMain_[n] *= inUbInputShapeMain_[permSize - 1 - i];
|
|
173
|
+
}
|
|
174
|
+
loopDstStrideMain_[n] = 1;
|
|
175
|
+
for (int64_t i = permSize - 1; i >= 0; i--) {
|
|
176
|
+
if (tiling_->perm[i] != reverseIdx) {
|
|
177
|
+
loopDstStrideMain_[n] *= reducedOutputShape_[i];
|
|
178
|
+
} else {
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
// tail loopSrcStride and loopDstStride
|
|
184
|
+
if (tiling_->inTailFactor != 0 && loopSizeTail_[n] != 1) {
|
|
185
|
+
loopSrcStrideTail_[n] = alignedStrideTail;
|
|
186
|
+
for (int64_t i = 1; i < n; i++) {
|
|
187
|
+
loopSrcStrideTail_[n] *= inUbInputShapeTail_[permSize - 1 - i];
|
|
188
|
+
}
|
|
189
|
+
loopDstStrideTail_[n] = 1;
|
|
190
|
+
for (int64_t i = permSize - 1; i >= 0; i--) {
|
|
191
|
+
if (tiling_->perm[i] != reverseIdx) {
|
|
192
|
+
loopDstStrideTail_[n] *= reducedOutputShape_[i];
|
|
193
|
+
} else {
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
template <typename T>
|
|
201
|
+
__aicore__ inline int64_t TransposeNLast<T>::GetDstAddressOffset(int64_t loopIdx, int64_t permSize,
|
|
202
|
+
const int64_t mixedBase[], const int64_t loopNum[])
|
|
203
|
+
{
|
|
204
|
+
// Fuse DecimalToMixed + accumulation: no intermediate array, no zero-init overhead (P9)
|
|
205
|
+
int64_t dstAddressOffset = 0;
|
|
206
|
+
if (loopIdx != 0) {
|
|
207
|
+
int64_t num = loopIdx;
|
|
208
|
+
for (int64_t i = permSize - 1; i >= 0 && num != 0; i--) {
|
|
209
|
+
dstAddressOffset += (num % mixedBase[i]) * loopNum[i];
|
|
210
|
+
num /= mixedBase[i];
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return dstAddressOffset;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
template <typename T>
|
|
217
|
+
__aicore__ inline void TransposeNLast<T>::CopyIn(int64_t loopIdx, int64_t inputBlockLen, int64_t inCutLoopSize,
|
|
218
|
+
int64_t inUbFactor, int64_t inTailFactor, int64_t permSize)
|
|
219
|
+
{
|
|
220
|
+
int64_t inputBlockLenMain = inputBlockLen * inUbFactor;
|
|
221
|
+
int64_t inputBlockLenTail = inputBlockLen * inTailFactor;
|
|
222
|
+
int64_t srcAddressOffset = loopIdx * inputBlockLenMain;
|
|
223
|
+
if (inTailFactor != 0) {
|
|
224
|
+
srcAddressOffset = (loopIdx - loopIdx / inCutLoopSize) * inputBlockLenMain +
|
|
225
|
+
loopIdx / inCutLoopSize * inputBlockLenTail;
|
|
226
|
+
}
|
|
227
|
+
int64_t blockLen = inputBlockLenMain;
|
|
228
|
+
int64_t lastAxisLen = inUbInputShapeMain_[permSize - 1];
|
|
229
|
+
if (inTailFactor != 0 && (loopIdx + 1) % inCutLoopSize == 0) {
|
|
230
|
+
blockLen = inputBlockLenTail;
|
|
231
|
+
lastAxisLen = inUbInputShapeTail_[permSize - 1];
|
|
232
|
+
}
|
|
233
|
+
LocalTensor<T> bindLocalIn = vecQue_.AllocTensor<T>();
|
|
234
|
+
DataCopyExtParams copyInParams{1, 0, 0, 0, 0};
|
|
235
|
+
DataCopyPadExtParams<T> padParams{false, 0, 0, 0};
|
|
236
|
+
|
|
237
|
+
copyInParams.blockLen = blockLen * sizeof(T);
|
|
238
|
+
copyInParams.blockCount = 1;
|
|
239
|
+
if ((lastAxisLen * sizeof(T)) % BLOCK_SIZE_BYTE != 0) {
|
|
240
|
+
copyInParams.blockLen = lastAxisLen * sizeof(T);
|
|
241
|
+
copyInParams.blockCount = blockLen / lastAxisLen;
|
|
242
|
+
}
|
|
243
|
+
DataCopyPad(bindLocalIn, inputGM_[srcAddressOffset], copyInParams, padParams);
|
|
244
|
+
vecQue_.EnQue(bindLocalIn);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
template <typename T>
|
|
248
|
+
__aicore__ inline void TransposeNLast<T>::CopyOut(int64_t loopIdx, int64_t loopSize[], int64_t loopSrcStride[],
|
|
249
|
+
int64_t loopDstStride[], int64_t permSize, const int64_t mixedBase[],
|
|
250
|
+
const int64_t loopNum[])
|
|
251
|
+
{
|
|
252
|
+
int64_t dstAddressOffset = GetDstAddressOffset(loopIdx, permSize, mixedBase, loopNum);
|
|
253
|
+
|
|
254
|
+
// P4: cache array elements into locals to avoid alias-induced reload after DataCopyPad stores
|
|
255
|
+
const int64_t ls4 = loopSize[4], ls5 = loopSize[5], ls6 = loopSize[6], ls7 = loopSize[7];
|
|
256
|
+
const int64_t lss4 = loopSrcStride[4], lss5 = loopSrcStride[5];
|
|
257
|
+
const int64_t lss6 = loopSrcStride[6], lss7 = loopSrcStride[7];
|
|
258
|
+
const int64_t lds4 = loopDstStride[4], lds5 = loopDstStride[5];
|
|
259
|
+
const int64_t lds6 = loopDstStride[6], lds7 = loopDstStride[7];
|
|
260
|
+
|
|
261
|
+
DataCopyExtParams copyOutParams{1, 0, 0, 0, 0};
|
|
262
|
+
copyOutParams.blockLen = loopSize[0] * sizeof(T);
|
|
263
|
+
copyOutParams.blockCount = loopSize[1];
|
|
264
|
+
copyOutParams.srcStride = 0;
|
|
265
|
+
copyOutParams.dstStride = copyOutParams.blockCount == 1 ? 0 : (loopDstStride[1] - loopSize[0]) * sizeof(T);
|
|
266
|
+
|
|
267
|
+
LoopModeParams loopParams;
|
|
268
|
+
loopParams.loop1Size = loopSize[2];
|
|
269
|
+
loopParams.loop1SrcStride = loopSrcStride[2] * sizeof(T);
|
|
270
|
+
loopParams.loop1DstStride = loopDstStride[2] * sizeof(T);
|
|
271
|
+
loopParams.loop2Size = loopSize[3];
|
|
272
|
+
loopParams.loop2SrcStride = loopSrcStride[3] * sizeof(T);
|
|
273
|
+
loopParams.loop2DstStride = loopDstStride[3] * sizeof(T);
|
|
274
|
+
|
|
275
|
+
LocalTensor<T> bindLocalOut = vecQue_.DeQue<T>();
|
|
276
|
+
// Move SetLoopModePara outside the loop: loopParams is constant across all iterations
|
|
277
|
+
SetLoopModePara(loopParams, DataCopyMVType::UB_TO_OUT);
|
|
278
|
+
for (int64_t loop7Idx = 0; loop7Idx < ls7; loop7Idx++) {
|
|
279
|
+
for (int64_t loop6Idx = 0; loop6Idx < ls6; loop6Idx++) {
|
|
280
|
+
for (int64_t loop5Idx = 0; loop5Idx < ls5; loop5Idx++) {
|
|
281
|
+
for (int64_t loop4Idx = 0; loop4Idx < ls4; loop4Idx++) {
|
|
282
|
+
DataCopyPad(outputGM_[dstAddressOffset + loop7Idx * lds7 + loop6Idx * lds6 + loop5Idx * lds5 +
|
|
283
|
+
loop4Idx * lds4],
|
|
284
|
+
bindLocalOut[loop7Idx * lss7 + loop6Idx * lss6 + loop5Idx * lss5 + loop4Idx * lss4],
|
|
285
|
+
copyOutParams);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
ResetLoopModePara(DataCopyMVType::UB_TO_OUT);
|
|
291
|
+
vecQue_.FreeTensor(bindLocalOut);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
template <typename T>
|
|
295
|
+
__aicore__ inline void TransposeNLast<T>::ProcessPerCore()
|
|
296
|
+
{
|
|
297
|
+
// P6: cache tiling pointer fields into local variables to avoid repeated double-Load
|
|
298
|
+
const int64_t permSize = tiling_->permSize;
|
|
299
|
+
const int64_t inUbFactor = tiling_->inUbFactor;
|
|
300
|
+
const int64_t inTailFactor = tiling_->inTailFactor;
|
|
301
|
+
const int64_t inCutIndex = tiling_->inCutIndex;
|
|
302
|
+
|
|
303
|
+
for (int64_t i = 0; i < permSize; i++) {
|
|
304
|
+
GetLoopParams(i);
|
|
305
|
+
}
|
|
306
|
+
GetBlockLoopNum();
|
|
307
|
+
int64_t inputBlockLen = 1;
|
|
308
|
+
for (int64_t i = permSize - 1; i > inCutIndex; i--) {
|
|
309
|
+
inputBlockLen *= reducedInputShape_[i];
|
|
310
|
+
}
|
|
311
|
+
int64_t inCutLoopSize = Ops::Base::CeilDiv(reducedInputShape_[inCutIndex], inUbFactor);
|
|
312
|
+
|
|
313
|
+
// P4: cache member variables used only in this function
|
|
314
|
+
const int64_t loopStart = blkProcessIdxStart_;
|
|
315
|
+
const int64_t loopEnd = blkProcessIdxEnd_;
|
|
316
|
+
|
|
317
|
+
// P1: cache member arrays to stack to break alias pollution from struct dynamic indexing
|
|
318
|
+
int64_t localMixedBase[TRANSPOSE_MAX_AXIS_NUM];
|
|
319
|
+
int64_t localLoopNum[TRANSPOSE_MAX_AXIS_NUM];
|
|
320
|
+
for (int64_t i = 0; i < permSize; i++) {
|
|
321
|
+
localMixedBase[i] = dstAddressOffsetMixedBase_[i];
|
|
322
|
+
localLoopNum[i] = dstLoopNumArray_[i];
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// P2: main/tail loop separation to eliminate per-iteration branch in hot path
|
|
326
|
+
for (int64_t loopIdx = loopStart; loopIdx < loopEnd; loopIdx++) {
|
|
327
|
+
if (inTailFactor != 0 && (loopIdx + 1) % inCutLoopSize == 0) {
|
|
328
|
+
CopyIn(loopIdx, inputBlockLen, inCutLoopSize, inUbFactor, inTailFactor, permSize);
|
|
329
|
+
CopyOut(loopIdx, loopSizeTail_, loopSrcStrideTail_, loopDstStrideTail_, permSize, localMixedBase,
|
|
330
|
+
localLoopNum);
|
|
331
|
+
} else {
|
|
332
|
+
CopyIn(loopIdx, inputBlockLen, inCutLoopSize, inUbFactor, inTailFactor, permSize);
|
|
333
|
+
CopyOut(loopIdx, loopSizeMain_, loopSrcStrideMain_, loopDstStrideMain_, permSize, localMixedBase,
|
|
334
|
+
localLoopNum);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
} // namespace Transpose
|
|
339
|
+
|
|
340
|
+
#endif // TRANSPOSE_N_LAST_H
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Huawei Technologies Co., Ltd.
|
|
3
|
+
* This program is free software, you can redistribute it and/or modify it under the terms and conditions of
|
|
4
|
+
* CANN Open Software License Agreement Version 2.0 (the "License").
|
|
5
|
+
* Please refer to the License for details. You may not use this file except in compliance with the License.
|
|
6
|
+
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
|
|
7
|
+
* INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
|
|
8
|
+
* See LICENSE in the root of the software repository for the full text of the License.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/*!
|
|
12
|
+
* \file transpose_small_shape.h
|
|
13
|
+
* \brief transpose_small_shape
|
|
14
|
+
*/
|
|
15
|
+
#ifndef TRANSPOSE_SMALL_SHAPE_H
|
|
16
|
+
#define TRANSPOSE_SMALL_SHAPE_H
|
|
17
|
+
|
|
18
|
+
#include "transpose_base.h"
|
|
19
|
+
#include "simt_api/asc_simt.h"
|
|
20
|
+
|
|
21
|
+
#ifdef __DAV_FPGA__
|
|
22
|
+
constexpr int32_t THREAD_DIM = 512;
|
|
23
|
+
constexpr int32_t HALF_THREAD_DIM = 512;
|
|
24
|
+
constexpr int32_t QUARTER_THREAD_DIM = 512;
|
|
25
|
+
constexpr int32_t AN_EIGHTH_THREAD_DIM = 256;
|
|
26
|
+
#else
|
|
27
|
+
constexpr int32_t THREAD_DIM = 2048;
|
|
28
|
+
constexpr int32_t HALF_THREAD_DIM = 1024;
|
|
29
|
+
constexpr int32_t QUARTER_THREAD_DIM = 512;
|
|
30
|
+
constexpr int32_t AN_EIGHTH_THREAD_DIM = 256;
|
|
31
|
+
#endif
|
|
32
|
+
|
|
33
|
+
namespace Transpose {
|
|
34
|
+
using namespace AscendC;
|
|
35
|
+
|
|
36
|
+
template <typename T>
|
|
37
|
+
class TransposeSmallShape : public TransposeBase<T> {
|
|
38
|
+
public:
|
|
39
|
+
__aicore__ inline TransposeSmallShape(){};
|
|
40
|
+
__aicore__ inline void Init(GM_ADDR x, GM_ADDR y, const TransposeOpTilingData* tilingData);
|
|
41
|
+
__aicore__ inline void Process();
|
|
42
|
+
|
|
43
|
+
private:
|
|
44
|
+
GlobalTensor<T> inputGM_;
|
|
45
|
+
GlobalTensor<T> outputGM_;
|
|
46
|
+
int32_t blockIdx_;
|
|
47
|
+
const TransposeOpTilingData* tilingData_;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
template <typename T>
|
|
51
|
+
__aicore__ inline void TransposeSmallShape<T>::Init(GM_ADDR x, GM_ADDR y, const TransposeOpTilingData* tilingData)
|
|
52
|
+
{
|
|
53
|
+
blockIdx_ = GetBlockIdx();
|
|
54
|
+
tilingData_ = tilingData;
|
|
55
|
+
inputGM_.SetGlobalBuffer((__gm__ T*)x);
|
|
56
|
+
outputGM_.SetGlobalBuffer((__gm__ T*)y);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
template <typename T>
|
|
60
|
+
__simt_vf__ LAUNCH_BOUND(THREAD_DIM) __aicore__
|
|
61
|
+
void SimtComputeDimTwo(__gm__ T* inputGM, __gm__ volatile T* outputGM, uint32_t coreFactor, uint32_t coreOffset,
|
|
62
|
+
uint32_t outputShape0, uint32_t outputShape1, uint32_t m0, uint32_t m1, uint32_t s0,
|
|
63
|
+
uint32_t s1)
|
|
64
|
+
{
|
|
65
|
+
for (uint32_t idx = static_cast<uint32_t>(threadIdx.x); idx < coreFactor;
|
|
66
|
+
idx += static_cast<uint32_t>(blockDim.x)) {
|
|
67
|
+
uint32_t yIdx = coreOffset + idx;
|
|
68
|
+
uint32_t inputIndex0 = yIdx - Simt::UintDiv(yIdx, m0, s0) * outputShape0;
|
|
69
|
+
yIdx = Simt::UintDiv(yIdx, m0, s0);
|
|
70
|
+
uint32_t inputIndex1 = yIdx - Simt::UintDiv(yIdx, m1, s1) * outputShape1;
|
|
71
|
+
uint32_t xIdx = inputIndex0 * outputShape1 + inputIndex1;
|
|
72
|
+
outputGM[coreOffset + idx] = inputGM[xIdx];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
template <typename T>
|
|
77
|
+
__simt_vf__ LAUNCH_BOUND(THREAD_DIM) __aicore__
|
|
78
|
+
void SimtComputeDimThree(__gm__ T* inputGM, __gm__ volatile T* outputGM, uint32_t coreFactor, uint32_t coreOffset,
|
|
79
|
+
uint32_t outputShape0, uint32_t outputShape1, uint32_t outputShape2, uint32_t dstStride0,
|
|
80
|
+
uint32_t dstStride1, uint32_t dstStride2, uint32_t m0, uint32_t m1, uint32_t m2,
|
|
81
|
+
uint32_t s0, uint32_t s1, uint32_t s2)
|
|
82
|
+
{
|
|
83
|
+
for (uint32_t idx = static_cast<uint32_t>(threadIdx.x); idx < coreFactor;
|
|
84
|
+
idx += static_cast<uint32_t>(blockDim.x)) {
|
|
85
|
+
uint32_t yIdx = coreOffset + idx;
|
|
86
|
+
uint32_t inputIndex0 = yIdx - Simt::UintDiv(yIdx, m0, s0) * outputShape0;
|
|
87
|
+
yIdx = Simt::UintDiv(yIdx, m0, s0);
|
|
88
|
+
uint32_t inputIndex1 = yIdx - Simt::UintDiv(yIdx, m1, s1) * outputShape1;
|
|
89
|
+
yIdx = Simt::UintDiv(yIdx, m1, s1);
|
|
90
|
+
uint32_t inputIndex2 = yIdx - Simt::UintDiv(yIdx, m2, s2) * outputShape2;
|
|
91
|
+
uint32_t xIdx = inputIndex0 * dstStride0 + inputIndex1 * dstStride1 + inputIndex2 * dstStride2;
|
|
92
|
+
outputGM[coreOffset + idx] = inputGM[xIdx];
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
template <typename T>
|
|
97
|
+
__simt_vf__ LAUNCH_BOUND(THREAD_DIM) __aicore__
|
|
98
|
+
void SimtComputeDimFour(__gm__ T* inputGM, __gm__ volatile T* outputGM, uint32_t coreFactor, uint32_t coreOffset,
|
|
99
|
+
uint32_t outputShape0, uint32_t outputShape1, uint32_t outputShape2, uint32_t outputShape3,
|
|
100
|
+
uint32_t dstStride0, uint32_t dstStride1, uint32_t dstStride2, uint32_t dstStride3,
|
|
101
|
+
uint32_t m0, uint32_t m1, uint32_t m2, uint32_t m3, uint32_t s0, uint32_t s1, uint32_t s2,
|
|
102
|
+
uint32_t s3)
|
|
103
|
+
{
|
|
104
|
+
for (uint32_t idx = static_cast<uint32_t>(threadIdx.x); idx < coreFactor;
|
|
105
|
+
idx += static_cast<uint32_t>(blockDim.x)) {
|
|
106
|
+
uint32_t yIdx = coreOffset + idx;
|
|
107
|
+
uint32_t inputIndex0 = yIdx - Simt::UintDiv(yIdx, m0, s0) * outputShape0;
|
|
108
|
+
yIdx = Simt::UintDiv(yIdx, m0, s0);
|
|
109
|
+
uint32_t inputIndex1 = yIdx - Simt::UintDiv(yIdx, m1, s1) * outputShape1;
|
|
110
|
+
yIdx = Simt::UintDiv(yIdx, m1, s1);
|
|
111
|
+
uint32_t inputIndex2 = yIdx - Simt::UintDiv(yIdx, m2, s2) * outputShape2;
|
|
112
|
+
yIdx = Simt::UintDiv(yIdx, m2, s2);
|
|
113
|
+
uint32_t inputIndex3 = yIdx - Simt::UintDiv(yIdx, m3, s3) * outputShape3;
|
|
114
|
+
uint32_t xIdx = inputIndex0 * dstStride0 + inputIndex1 * dstStride1 + inputIndex2 * dstStride2 +
|
|
115
|
+
inputIndex3 * dstStride3;
|
|
116
|
+
outputGM[coreOffset + idx] = inputGM[xIdx];
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
template <typename T>
|
|
121
|
+
__simt_vf__ LAUNCH_BOUND(THREAD_DIM) __aicore__
|
|
122
|
+
void SimtComputeDimFive(__gm__ T* inputGM, __gm__ volatile T* outputGM, uint32_t coreFactor, uint32_t coreOffset,
|
|
123
|
+
uint32_t outputShape0, uint32_t outputShape1, uint32_t outputShape2, uint32_t outputShape3,
|
|
124
|
+
uint32_t outputShape4, uint32_t dstStride0, uint32_t dstStride1, uint32_t dstStride2,
|
|
125
|
+
uint32_t dstStride3, uint32_t dstStride4, uint32_t m0, uint32_t m1, uint32_t m2,
|
|
126
|
+
uint32_t m3, uint32_t m4, uint32_t s0, uint32_t s1, uint32_t s2, uint32_t s3, uint32_t s4)
|
|
127
|
+
{
|
|
128
|
+
for (uint32_t idx = static_cast<uint32_t>(threadIdx.x); idx < coreFactor;
|
|
129
|
+
idx += static_cast<uint32_t>(blockDim.x)) {
|
|
130
|
+
uint32_t yIdx = coreOffset + idx;
|
|
131
|
+
uint32_t inputIndex0 = yIdx - Simt::UintDiv(yIdx, m0, s0) * outputShape0;
|
|
132
|
+
yIdx = Simt::UintDiv(yIdx, m0, s0);
|
|
133
|
+
uint32_t inputIndex1 = yIdx - Simt::UintDiv(yIdx, m1, s1) * outputShape1;
|
|
134
|
+
yIdx = Simt::UintDiv(yIdx, m1, s1);
|
|
135
|
+
uint32_t inputIndex2 = yIdx - Simt::UintDiv(yIdx, m2, s2) * outputShape2;
|
|
136
|
+
yIdx = Simt::UintDiv(yIdx, m2, s2);
|
|
137
|
+
uint32_t inputIndex3 = yIdx - Simt::UintDiv(yIdx, m3, s3) * outputShape3;
|
|
138
|
+
yIdx = Simt::UintDiv(yIdx, m3, s3);
|
|
139
|
+
uint32_t inputIndex4 = yIdx - Simt::UintDiv(yIdx, m4, s4) * outputShape4;
|
|
140
|
+
uint32_t xIdx = inputIndex0 * dstStride0 + inputIndex1 * dstStride1 + inputIndex2 * dstStride2 +
|
|
141
|
+
inputIndex3 * dstStride3 + inputIndex4 * dstStride4;
|
|
142
|
+
outputGM[coreOffset + idx] = inputGM[xIdx];
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
template <typename T>
|
|
147
|
+
__simt_vf__ LAUNCH_BOUND(THREAD_DIM) __aicore__
|
|
148
|
+
void SimtComputeDimSix(__gm__ T* inputGM, __gm__ volatile T* outputGM, uint32_t coreFactor, uint32_t coreOffset,
|
|
149
|
+
uint32_t outputShape0, uint32_t outputShape1, uint32_t outputShape2, uint32_t outputShape3,
|
|
150
|
+
uint32_t outputShape4, uint32_t outputShape5, uint32_t dstStride0, uint32_t dstStride1,
|
|
151
|
+
uint32_t dstStride2, uint32_t dstStride3, uint32_t dstStride4, uint32_t dstStride5,
|
|
152
|
+
uint32_t m0, uint32_t m1, uint32_t m2, uint32_t m3, uint32_t m4, uint32_t m5, uint32_t s0,
|
|
153
|
+
uint32_t s1, uint32_t s2, uint32_t s3, uint32_t s4, uint32_t s5)
|
|
154
|
+
{
|
|
155
|
+
for (uint32_t idx = static_cast<uint32_t>(threadIdx.x); idx < coreFactor;
|
|
156
|
+
idx += static_cast<uint32_t>(blockDim.x)) {
|
|
157
|
+
uint32_t yIdx = coreOffset + idx;
|
|
158
|
+
uint32_t inputIndex0 = yIdx - Simt::UintDiv(yIdx, m0, s0) * outputShape0;
|
|
159
|
+
yIdx = Simt::UintDiv(yIdx, m0, s0);
|
|
160
|
+
uint32_t inputIndex1 = yIdx - Simt::UintDiv(yIdx, m1, s1) * outputShape1;
|
|
161
|
+
yIdx = Simt::UintDiv(yIdx, m1, s1);
|
|
162
|
+
uint32_t inputIndex2 = yIdx - Simt::UintDiv(yIdx, m2, s2) * outputShape2;
|
|
163
|
+
yIdx = Simt::UintDiv(yIdx, m2, s2);
|
|
164
|
+
uint32_t inputIndex3 = yIdx - Simt::UintDiv(yIdx, m3, s3) * outputShape3;
|
|
165
|
+
yIdx = Simt::UintDiv(yIdx, m3, s3);
|
|
166
|
+
uint32_t inputIndex4 = yIdx - Simt::UintDiv(yIdx, m4, s4) * outputShape4;
|
|
167
|
+
yIdx = Simt::UintDiv(yIdx, m4, s4);
|
|
168
|
+
uint32_t inputIndex5 = yIdx - Simt::UintDiv(yIdx, m5, s5) * outputShape5;
|
|
169
|
+
uint32_t xIdx = inputIndex0 * dstStride0 + inputIndex1 * dstStride1 + inputIndex2 * dstStride2 +
|
|
170
|
+
inputIndex3 * dstStride3 + inputIndex4 * dstStride4 + inputIndex5 * dstStride5;
|
|
171
|
+
outputGM[coreOffset + idx] = inputGM[xIdx];
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
template <typename T>
|
|
176
|
+
__simt_vf__ LAUNCH_BOUND(THREAD_DIM) __aicore__
|
|
177
|
+
void SimtComputeDimSeven(__gm__ T* inputGM, __gm__ volatile T* outputGM, uint32_t coreFactor, uint32_t coreOffset,
|
|
178
|
+
uint32_t outputShape0, uint32_t outputShape1, uint32_t outputShape2, uint32_t outputShape3,
|
|
179
|
+
uint32_t outputShape4, uint32_t outputShape5, uint32_t outputShape6, uint32_t dstStride0,
|
|
180
|
+
uint32_t dstStride1, uint32_t dstStride2, uint32_t dstStride3, uint32_t dstStride4,
|
|
181
|
+
uint32_t dstStride5, uint32_t dstStride6, uint32_t m0, uint32_t m1, uint32_t m2,
|
|
182
|
+
uint32_t m3, uint32_t m4, uint32_t m5, uint32_t m6, uint32_t s0, uint32_t s1, uint32_t s2,
|
|
183
|
+
uint32_t s3, uint32_t s4, uint32_t s5, uint32_t s6)
|
|
184
|
+
{
|
|
185
|
+
for (uint32_t idx = static_cast<uint32_t>(threadIdx.x); idx < coreFactor;
|
|
186
|
+
idx += static_cast<uint32_t>(blockDim.x)) {
|
|
187
|
+
uint32_t yIdx = coreOffset + idx;
|
|
188
|
+
uint32_t inputIndex0 = yIdx - Simt::UintDiv(yIdx, m0, s0) * outputShape0;
|
|
189
|
+
yIdx = Simt::UintDiv(yIdx, m0, s0);
|
|
190
|
+
uint32_t inputIndex1 = yIdx - Simt::UintDiv(yIdx, m1, s1) * outputShape1;
|
|
191
|
+
yIdx = Simt::UintDiv(yIdx, m1, s1);
|
|
192
|
+
uint32_t inputIndex2 = yIdx - Simt::UintDiv(yIdx, m2, s2) * outputShape2;
|
|
193
|
+
yIdx = Simt::UintDiv(yIdx, m2, s2);
|
|
194
|
+
uint32_t inputIndex3 = yIdx - Simt::UintDiv(yIdx, m3, s3) * outputShape3;
|
|
195
|
+
yIdx = Simt::UintDiv(yIdx, m3, s3);
|
|
196
|
+
uint32_t inputIndex4 = yIdx - Simt::UintDiv(yIdx, m4, s4) * outputShape4;
|
|
197
|
+
yIdx = Simt::UintDiv(yIdx, m4, s4);
|
|
198
|
+
uint32_t inputIndex5 = yIdx - Simt::UintDiv(yIdx, m5, s5) * outputShape5;
|
|
199
|
+
yIdx = Simt::UintDiv(yIdx, m5, s5);
|
|
200
|
+
uint32_t inputIndex6 = yIdx - Simt::UintDiv(yIdx, m6, s6) * outputShape6;
|
|
201
|
+
uint32_t xIdx = inputIndex0 * dstStride0 + inputIndex1 * dstStride1 + inputIndex2 * dstStride2 +
|
|
202
|
+
inputIndex3 * dstStride3 + inputIndex4 * dstStride4 + inputIndex5 * dstStride5 +
|
|
203
|
+
inputIndex6 * dstStride6;
|
|
204
|
+
outputGM[coreOffset + idx] = inputGM[xIdx];
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
template <typename T>
|
|
209
|
+
__simt_vf__ LAUNCH_BOUND(THREAD_DIM) __aicore__
|
|
210
|
+
void SimtComputeDimEight(__gm__ T* inputGM, __gm__ volatile T* outputGM, uint32_t coreFactor, uint32_t coreOffset,
|
|
211
|
+
uint32_t outputShape0, uint32_t outputShape1, uint32_t outputShape2, uint32_t outputShape3,
|
|
212
|
+
uint32_t outputShape4, uint32_t outputShape5, uint32_t outputShape6, uint32_t outputShape7,
|
|
213
|
+
uint32_t dstStride0, uint32_t dstStride1, uint32_t dstStride2, uint32_t dstStride3,
|
|
214
|
+
uint32_t dstStride4, uint32_t dstStride5, uint32_t dstStride6, uint32_t dstStride7,
|
|
215
|
+
uint32_t m0, uint32_t m1, uint32_t m2, uint32_t m3, uint32_t m4, uint32_t m5, uint32_t m6,
|
|
216
|
+
uint32_t m7, uint32_t s0, uint32_t s1, uint32_t s2, uint32_t s3, uint32_t s4, uint32_t s5,
|
|
217
|
+
uint32_t s6, uint32_t s7)
|
|
218
|
+
{
|
|
219
|
+
for (uint32_t idx = static_cast<uint32_t>(threadIdx.x); idx < coreFactor;
|
|
220
|
+
idx += static_cast<uint32_t>(blockDim.x)) {
|
|
221
|
+
uint32_t yIdx = coreOffset + idx;
|
|
222
|
+
uint32_t inputIndex0 = yIdx - Simt::UintDiv(yIdx, m0, s0) * outputShape0;
|
|
223
|
+
yIdx = Simt::UintDiv(yIdx, m0, s0);
|
|
224
|
+
uint32_t inputIndex1 = yIdx - Simt::UintDiv(yIdx, m1, s1) * outputShape1;
|
|
225
|
+
yIdx = Simt::UintDiv(yIdx, m1, s1);
|
|
226
|
+
uint32_t inputIndex2 = yIdx - Simt::UintDiv(yIdx, m2, s2) * outputShape2;
|
|
227
|
+
yIdx = Simt::UintDiv(yIdx, m2, s2);
|
|
228
|
+
uint32_t inputIndex3 = yIdx - Simt::UintDiv(yIdx, m3, s3) * outputShape3;
|
|
229
|
+
yIdx = Simt::UintDiv(yIdx, m3, s3);
|
|
230
|
+
uint32_t inputIndex4 = yIdx - Simt::UintDiv(yIdx, m4, s4) * outputShape4;
|
|
231
|
+
yIdx = Simt::UintDiv(yIdx, m4, s4);
|
|
232
|
+
uint32_t inputIndex5 = yIdx - Simt::UintDiv(yIdx, m5, s5) * outputShape5;
|
|
233
|
+
yIdx = Simt::UintDiv(yIdx, m5, s5);
|
|
234
|
+
uint32_t inputIndex6 = yIdx - Simt::UintDiv(yIdx, m6, s6) * outputShape6;
|
|
235
|
+
yIdx = Simt::UintDiv(yIdx, m6, s6);
|
|
236
|
+
uint32_t inputIndex7 = yIdx - Simt::UintDiv(yIdx, m7, s7) * outputShape7;
|
|
237
|
+
uint32_t xIdx = inputIndex0 * dstStride0 + inputIndex1 * dstStride1 + inputIndex2 * dstStride2 +
|
|
238
|
+
inputIndex3 * dstStride3 + inputIndex4 * dstStride4 + inputIndex5 * dstStride5 +
|
|
239
|
+
inputIndex6 * dstStride6 + inputIndex7 * dstStride7;
|
|
240
|
+
outputGM[coreOffset + idx] = inputGM[xIdx];
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
template <typename T>
|
|
245
|
+
__aicore__ inline void TransposeSmallShape<T>::Process()
|
|
246
|
+
{
|
|
247
|
+
if (blockIdx_ >= tilingData_->realCoreNum) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
uint32_t blkProcessNum = tilingData_->blkFactor;
|
|
251
|
+
uint32_t blkStartOffset = blockIdx_ * tilingData_->blkFactor;
|
|
252
|
+
if (blockIdx_ == tilingData_->realCoreNum - 1 && tilingData_->blkTailFactor != 0) {
|
|
253
|
+
blkProcessNum = tilingData_->blkTailFactor;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
uint32_t permSize = tilingData_->permSize;
|
|
257
|
+
uint32_t outputShape[8] = {0, 0, 0, 0, 0, 0, 0, 0};
|
|
258
|
+
uint32_t dstStride[8] = {1, 1, 1, 1, 1, 1, 1, 1};
|
|
259
|
+
uint32_t dstStrideTmp[8] = {1, 1, 1, 1, 1, 1, 1, 1};
|
|
260
|
+
|
|
261
|
+
for (uint32_t i = 1; i < permSize; i++) {
|
|
262
|
+
dstStrideTmp[i] = tilingData_->inputShape[permSize - i] * dstStrideTmp[i - 1];
|
|
263
|
+
}
|
|
264
|
+
for (uint32_t i = 0; i < permSize; i++) {
|
|
265
|
+
outputShape[i] = tilingData_->outputShape[permSize - 1 - i];
|
|
266
|
+
dstStride[i] = dstStrideTmp[permSize - 1 - tilingData_->perm[permSize - 1 - i]];
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
uint32_t shift[8];
|
|
270
|
+
uint32_t m[8];
|
|
271
|
+
for (uint32_t i = 0; i < permSize; i++) {
|
|
272
|
+
GetUintDivMagicAndShift(m[i], shift[i], outputShape[i]);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
if (permSize == DIM_TWO) {
|
|
276
|
+
asc_vf_call<SimtComputeDimTwo<T>>(dim3(THREAD_DIM), (__gm__ T*)(inputGM_.GetPhyAddr()),
|
|
277
|
+
(__gm__ volatile T*)(outputGM_.GetPhyAddr()), blkProcessNum, blkStartOffset,
|
|
278
|
+
outputShape[0], outputShape[1], m[0], m[1], shift[0], shift[1]);
|
|
279
|
+
} else if (permSize == DIM_THREE) {
|
|
280
|
+
asc_vf_call<SimtComputeDimThree<T>>(dim3(THREAD_DIM), (__gm__ T*)(inputGM_.GetPhyAddr()),
|
|
281
|
+
(__gm__ volatile T*)(outputGM_.GetPhyAddr()), blkProcessNum, blkStartOffset,
|
|
282
|
+
outputShape[0], outputShape[1], outputShape[2], dstStride[0], dstStride[1],
|
|
283
|
+
dstStride[2], m[0], m[1], m[2], shift[0], shift[1], shift[2]);
|
|
284
|
+
} else if (permSize == DIM_FOUR) {
|
|
285
|
+
asc_vf_call<SimtComputeDimFour<T>>(
|
|
286
|
+
dim3(THREAD_DIM), (__gm__ T*)(inputGM_.GetPhyAddr()), (__gm__ volatile T*)(outputGM_.GetPhyAddr()),
|
|
287
|
+
blkProcessNum, blkStartOffset, outputShape[0], outputShape[1], outputShape[2], outputShape[3], dstStride[0],
|
|
288
|
+
dstStride[1], dstStride[2], dstStride[3], m[0], m[1], m[2], m[3], shift[0], shift[1], shift[2], shift[3]);
|
|
289
|
+
} else if (permSize == DIM_FIVE) {
|
|
290
|
+
asc_vf_call<SimtComputeDimFive<T>>(
|
|
291
|
+
dim3(THREAD_DIM), (__gm__ T*)(inputGM_.GetPhyAddr()), (__gm__ volatile T*)(outputGM_.GetPhyAddr()),
|
|
292
|
+
blkProcessNum, blkStartOffset, outputShape[0], outputShape[1], outputShape[2], outputShape[3],
|
|
293
|
+
outputShape[4], dstStride[0], dstStride[1], dstStride[2], dstStride[3], dstStride[4], m[0], m[1], m[2],
|
|
294
|
+
m[3], m[4], shift[0], shift[1], shift[2], shift[3], shift[4]);
|
|
295
|
+
} else if (permSize == DIM_SIX) {
|
|
296
|
+
asc_vf_call<SimtComputeDimSix<T>>(dim3(THREAD_DIM), (__gm__ T*)(inputGM_.GetPhyAddr()),
|
|
297
|
+
(__gm__ volatile T*)(outputGM_.GetPhyAddr()), blkProcessNum, blkStartOffset,
|
|
298
|
+
outputShape[0], outputShape[1], outputShape[2], outputShape[3],
|
|
299
|
+
outputShape[4], outputShape[5], dstStride[0], dstStride[1], dstStride[2],
|
|
300
|
+
dstStride[3], dstStride[4], dstStride[5], m[0], m[1], m[2], m[3], m[4], m[5],
|
|
301
|
+
shift[0], shift[1], shift[2], shift[3], shift[4], shift[5]);
|
|
302
|
+
} else if (permSize == DIM_SEVEN) {
|
|
303
|
+
asc_vf_call<SimtComputeDimSeven<T>>(
|
|
304
|
+
dim3(THREAD_DIM), (__gm__ T*)(inputGM_.GetPhyAddr()), (__gm__ volatile T*)(outputGM_.GetPhyAddr()),
|
|
305
|
+
blkProcessNum, blkStartOffset, outputShape[0], outputShape[1], outputShape[2], outputShape[3],
|
|
306
|
+
outputShape[4], outputShape[5], outputShape[6], dstStride[0], dstStride[1], dstStride[2], dstStride[3],
|
|
307
|
+
dstStride[4], dstStride[5], dstStride[6], m[0], m[1], m[2], m[3], m[4], m[5], m[6], shift[0], shift[1],
|
|
308
|
+
shift[2], shift[3], shift[4], shift[5], shift[6]);
|
|
309
|
+
} else if (permSize == DIM_EIGHT) {
|
|
310
|
+
asc_vf_call<SimtComputeDimEight<T>>(
|
|
311
|
+
dim3(THREAD_DIM), (__gm__ T*)(inputGM_.GetPhyAddr()), (__gm__ volatile T*)(outputGM_.GetPhyAddr()),
|
|
312
|
+
blkProcessNum, blkStartOffset, outputShape[0], outputShape[1], outputShape[2], outputShape[3],
|
|
313
|
+
outputShape[4], outputShape[5], outputShape[6], outputShape[7], dstStride[0], dstStride[1], dstStride[2],
|
|
314
|
+
dstStride[3], dstStride[4], dstStride[5], dstStride[6], dstStride[7], m[0], m[1], m[2], m[3], m[4], m[5],
|
|
315
|
+
m[6], m[7], shift[0], shift[1], shift[2], shift[3], shift[4], shift[5], shift[6], shift[7]);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
} // namespace Transpose
|
|
320
|
+
|
|
321
|
+
#endif // TRANSPOSE_SMALL_SHAPE_H
|