Merged
Add presmoke runner and validation reports #2900
zhugexun_sjtuAdd on Jun 3
Add presmoke runner and validation reports #2900
Merged
Merged fromxun_zhuge/asc-devkitpresmoke_optintocann/asc-devkitmaster
Total: 308 files changed+25065-7
| @@ -1,12 +1,12 @@ | |||
| 1 | -setuptools | 1 | +setuptools>=75,<80 |
| 2 | attrs | 2 | attrs |
| 3 | decorator | 3 | decorator |
| 4 | psutil | 4 | psutil |
| 5 | scipy | 5 | scipy |
| 6 | absl-py | 6 | absl-py |
| 7 | -ml-dtypes | 7 | +ml-dtypes>=0.5.1,<1.0.0 |
| 8 | tornado | 8 | tornado |
| 9 | -numpy>=2.2,<2.3 | 9 | +numpy>=1.26.0,<2.2.0 |
| 10 | pybind11>=2.13.6,<3.0.0 | 10 | pybind11>=2.13.6,<3.0.0 |
| 11 | PyYAML | 11 | PyYAML |
| 12 | ruamel.yaml | 12 | ruamel.yaml |
| @@ -19,7 +19,16 @@ onnx==1.16.0 | |||
| 19 | protobuf==3.20.3 | 19 | protobuf==3.20.3 |
| 20 | expecttest | 20 | expecttest |
| 21 | tqdm | 21 | tqdm |
| 22 | +en_dtypes==0.0.4 | ||
| 23 | +tensorflow-cpu==2.19.1; platform_machine == "x86_64" | ||
| 24 | +tensorflow==2.19.1; platform_machine == "aarch64" | ||
| 25 | + | ||
| 26 | +torch @ https://download.pytorch.org/whl/cpu/torch-2.7.1%2Bcpu-cp311-cp311-manylinux_2_28_x86_64.whl ; python_version == "3.11" and platform_machine == "x86_64" | ||
| 27 | +torch @ https://download.pytorch.org/whl/cpu/torch-2.7.1%2Bcpu-cp311-cp311-manylinux_2_28_aarch64.whl ; python_version == "3.11" and platform_machine == "aarch64" | ||
| 22 | torch @ https://download.pytorch.org/whl/cpu/torch-2.7.1%2Bcpu-cp312-cp312-manylinux_2_28_x86_64.whl ; python_version == "3.12" and platform_machine == "x86_64" | 28 | torch @ https://download.pytorch.org/whl/cpu/torch-2.7.1%2Bcpu-cp312-cp312-manylinux_2_28_x86_64.whl ; python_version == "3.12" and platform_machine == "x86_64" |
| 23 | -torch_npu @ https://gitcode.com/Ascend/pytorch/releases/download/v26.0.0-pytorch2.7.1/torch_npu-2.7.1.post4-cp312-cp312-manylinux_2_28_x86_64.whl ; python_version == "3.12" and platform_machine == "x86_64" | ||
| 24 | torch @ https://download.pytorch.org/whl/cpu/torch-2.7.1%2Bcpu-cp312-cp312-manylinux_2_28_aarch64.whl ; python_version == "3.12" and platform_machine == "aarch64" | 29 | torch @ https://download.pytorch.org/whl/cpu/torch-2.7.1%2Bcpu-cp312-cp312-manylinux_2_28_aarch64.whl ; python_version == "3.12" and platform_machine == "aarch64" |
| 30 | + | ||
| 31 | +torch_npu @ https://gitcode.com/Ascend/pytorch/releases/download/v26.0.0-pytorch2.7.1/torch_npu-2.7.1.post4-cp311-cp311-manylinux_2_28_x86_64.whl ; python_version == "3.11" and platform_machine == "x86_64" | ||
| 32 | +torch_npu @ https://gitcode.com/Ascend/pytorch/releases/download/v26.0.0-pytorch2.7.1/torch_npu-2.7.1.post4-cp311-cp311-manylinux_2_28_aarch64.whl ; python_version == "3.11" and platform_machine == "aarch64" | ||
| 33 | +torch_npu @ https://gitcode.com/Ascend/pytorch/releases/download/v26.0.0-pytorch2.7.1/torch_npu-2.7.1.post4-cp312-cp312-manylinux_2_28_x86_64.whl ; python_version == "3.12" and platform_machine == "x86_64" | ||
| 25 | torch_npu @ https://gitcode.com/Ascend/pytorch/releases/download/v26.0.0-pytorch2.7.1/torch_npu-2.7.1.post4-cp312-cp312-manylinux_2_28_aarch64.whl ; python_version == "3.12" and platform_machine == "aarch64" | 34 | torch_npu @ https://gitcode.com/Ascend/pytorch/releases/download/v26.0.0-pytorch2.7.1/torch_npu-2.7.1.post4-cp312-cp312-manylinux_2_28_aarch64.whl ; python_version == "3.12" and platform_machine == "aarch64" |
| @@ -6,8 +6,11 @@ output | |||
| 6 | __pycache__/ | 6 | __pycache__/ |
| 7 | /examples/**/build/ | 7 | /examples/**/build/ |
| 8 | AGENTS.md | 8 | AGENTS.md |
| 9 | +CLAUDE.md | ||
| 9 | oat_reports/ | 10 | oat_reports/ |
| 11 | +presmoke_reports/ | ||
| 10 | log/ | 12 | log/ |
| 13 | +.DS_Store | ||
| 11 | third_party/ | 14 | third_party/ |
| 12 | openssl-device-src/ | 15 | openssl-device-src/ |
| 13 | openssl-host-src/ | 16 | openssl-host-src/ |
Mexamples/01_simd_cpp_api/02_features/00_compilation/custom_op/framework/onnx_plugin/CMakeLists.txt+4-1
| @@ -11,7 +11,10 @@ | |||
| 11 | 11 | ||
| 12 | aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} plugin_srcs) | 12 | aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} plugin_srcs) |
| 13 | 13 | ||
| 14 | -set(NLOHMANN_JSON_URL "https://gitcode.com/cann-src-third-party/json/releases/download/v3.11.3/include.zip") | 14 | +set(NLOHMANN_JSON_URL |
| 15 | + "https://gitcode.com/cann-src-third-party/json/releases/download/v3.11.3/include.zip" | ||
| 16 | + CACHE STRING "URL or file:// path to nlohmann/json include.zip" | ||
| 17 | +) | ||
| 15 | set(NLOHMANN_JSON_DIR "${CMAKE_CURRENT_BINARY_DIR}/third_party/json") | 18 | set(NLOHMANN_JSON_DIR "${CMAKE_CURRENT_BINARY_DIR}/third_party/json") |
| 16 | set(NLOHMANN_JSON_ARCHIVE "${NLOHMANN_JSON_DIR}/include.zip") | 19 | set(NLOHMANN_JSON_ARCHIVE "${NLOHMANN_JSON_DIR}/include.zip") |
| 17 | set(NLOHMANN_JSON_HEADER "${NLOHMANN_JSON_DIR}/include/nlohmann/json.hpp") | 20 | set(NLOHMANN_JSON_HEADER "${NLOHMANN_JSON_DIR}/include/nlohmann/json.hpp") |
| @@ -14,11 +14,20 @@ project(parallel_ops_package_proj) | |||
| 14 | include(ExternalProject) | 14 | include(ExternalProject) |
| 15 | 15 | ||
| 16 | set(INSTALL_TARGET "package") | 16 | set(INSTALL_TARGET "package") |
| 17 | +set(NLOHMANN_JSON_URL | ||
| 18 | + "https://gitcode.com/cann-src-third-party/json/releases/download/v3.11.3/include.zip" | ||
| 19 | + CACHE STRING "URL or file:// path to nlohmann/json include.zip" | ||
| 20 | +) | ||
| 17 | 21 | ||
| 18 | set(ADD_CUSTOM_ASCEND_COMPUTE_UNIT ascend910 ascend310p ascend310b ascend910b ascend950) | 22 | set(ADD_CUSTOM_ASCEND_COMPUTE_UNIT ascend910 ascend310p ascend310b ascend910b ascend950) |
| 19 | set(LEAKY_RELU_ASCEND_COMPUTE_UNIT ascend910b) | 23 | set(LEAKY_RELU_ASCEND_COMPUTE_UNIT ascend910b) |
| 20 | 24 | ||
| 21 | function(add_parallel_vendor_project target_name source_dir vendor_name compute_units) | 25 | function(add_parallel_vendor_project target_name source_dir vendor_name compute_units) |
| 26 | + set(extra_cmake_args) | ||
| 27 | + if("${target_name}" STREQUAL "leaky_relu_custom") | ||
| 28 | + list(APPEND extra_cmake_args "-DNLOHMANN_JSON_URL=${NLOHMANN_JSON_URL}") | ||
| 29 | + endif() | ||
| 30 | + | ||
| 22 | ExternalProject_Add(${target_name} | 31 | ExternalProject_Add(${target_name} |
| 23 | SOURCE_DIR ${source_dir} | 32 | SOURCE_DIR ${source_dir} |
| 24 | CMAKE_CACHE_ARGS | 33 | CMAKE_CACHE_ARGS |
| @@ -26,6 +35,7 @@ function(add_parallel_vendor_project target_name source_dir vendor_name compute_ | |||
| 26 | CMAKE_ARGS | 35 | CMAKE_ARGS |
| 27 | -Dvendor_name=${vendor_name} | 36 | -Dvendor_name=${vendor_name} |
| 28 | -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${target_name} | 37 | -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${target_name} |
| 38 | + ${extra_cmake_args} | ||
| 29 | BUILD_COMMAND | 39 | BUILD_COMMAND |
| 30 | ${CMAKE_COMMAND} --build <BINARY_DIR> --target binary | 40 | ${CMAKE_COMMAND} --build <BINARY_DIR> --target binary |
| 31 | COMMAND | 41 | COMMAND |
| @@ -11,7 +11,10 @@ | |||
| 11 | 11 | ||
| 12 | aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} plugin_srcs) | 12 | aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} plugin_srcs) |
| 13 | 13 | ||
| 14 | -set(NLOHMANN_JSON_URL "https://gitcode.com/cann-src-third-party/json/releases/download/v3.11.3/include.zip") | 14 | +set(NLOHMANN_JSON_URL |
| 15 | + "https://gitcode.com/cann-src-third-party/json/releases/download/v3.11.3/include.zip" | ||
| 16 | + CACHE STRING "URL or file:// path to nlohmann/json include.zip" | ||
| 17 | +) | ||
| 15 | set(NLOHMANN_JSON_DIR "${CMAKE_CURRENT_BINARY_DIR}/third_party/json") | 18 | set(NLOHMANN_JSON_DIR "${CMAKE_CURRENT_BINARY_DIR}/third_party/json") |
| 16 | set(NLOHMANN_JSON_ARCHIVE "${NLOHMANN_JSON_DIR}/include.zip") | 19 | set(NLOHMANN_JSON_ARCHIVE "${NLOHMANN_JSON_DIR}/include.zip") |
| 17 | set(NLOHMANN_JSON_HEADER "${NLOHMANN_JSON_DIR}/include/nlohmann/json.hpp") | 20 | set(NLOHMANN_JSON_HEADER "${NLOHMANN_JSON_DIR}/include/nlohmann/json.hpp") |
| @@ -40,7 +40,7 @@ | |||
| 40 | - 安装onnx | 40 | - 安装onnx |
| 41 | 41 | ||
| 42 | ```bash | 42 | ```bash |
| 43 | - pip3 install onnx==1.12.0 | 43 | + pip3 install onnx==1.16.0 |
| 44 | ``` | 44 | ``` |
| 45 | 45 | ||
| 46 | - 配置环境变量 | 46 | - 配置环境变量 |
| @@ -17,6 +17,7 @@ DIR_LIST=( | |||
| 17 | "/usr/local/Ascend/cann/asc/|./monitor_snapshot_2.txt" | 17 | "/usr/local/Ascend/cann/asc/|./monitor_snapshot_2.txt" |
| 18 | ) | 18 | ) |
| 19 | RESULT_CHECK="./result_check.txt" | 19 | RESULT_CHECK="./result_check.txt" |
| 20 | +rm -f "$RESULT_CHECK" | ||
| 20 | 21 | ||
| 21 | # 遍历监控每个目录 | 22 | # 遍历监控每个目录 |
| 22 | for item in "${DIR_LIST[@]}"; do | 23 | for item in "${DIR_LIST[@]}"; do |
| @@ -0,0 +1,185 @@ | |||
| 1 | +# Presmoke Watch Entry | ||
| 2 | + | ||
| 3 | +`scripts/run_presmoke.sh` is the CI and manual watch entry. It runs one full 910B or 950 presmoke round, writes archiveable reports, and can retry timeout cases on other cards. | ||
| 4 | + | ||
| 5 | +For direct Python CLI experiments, use `PYTHONPATH=scripts PRESMOKE_PROJECT_ROOT=$PWD python3 -m presmoke ...`. | ||
| 6 | + | ||
| 7 | +Before a full watch run, the orchestrator removes all entries under the active CANN `opp/vendors` directory. This keeps custom-op package installation deterministic across rounds. Runs with `--filter`, `--dry-run`, or `--suggestions-only` do not clean `opp/vendors`. | ||
| 8 | + | ||
| 9 | +## Quick Start | ||
| 10 | + | ||
| 11 | +Run with defaults. This is the shortest command and is intended to be compatible with the old `run_presmoke.sh` caller contract: | ||
| 12 | + | ||
| 13 | +```bash | ||
| 14 | +bash scripts/run_presmoke.sh | ||
| 15 | +``` | ||
| 16 | + | ||
| 17 | +Default behavior: | ||
| 18 | + | ||
| 19 | +- `ARCH=dav-2201`, for 910B. | ||
| 20 | +- `MODES=npu`. | ||
| 21 | +- `PRIMARY_CARD=0`. | ||
| 22 | +- `SCHEDULE=fixed`. | ||
| 23 | +- `JOBS=auto`. | ||
| 24 | +- `NPU_SLOTS=1`. | ||
| 25 | +- `TIMEOUT=120`, applied only to NPU run commands. | ||
| 26 | +- Success prints `execute samples success`; failure prints `execute samples failed` and exits non-zero. | ||
| 27 | + | ||
| 28 | +## Common Commands | ||
| 29 | + | ||
| 30 | +Check which cases would run without executing them: | ||
| 31 | + | ||
| 32 | +```bash | ||
| 33 | +bash scripts/run_presmoke.sh --dry-run | ||
| 34 | +``` | ||
| 35 | + | ||
| 36 | +Run 910B on a specific card: | ||
| 37 | + | ||
| 38 | +```bash | ||
| 39 | +PRIMARY_CARD=7 bash scripts/run_presmoke.sh | ||
| 40 | +``` | ||
| 41 | + | ||
| 42 | +Run 950: | ||
| 43 | + | ||
| 44 | +```bash | ||
| 45 | +ARCH=dav-3510 PRIMARY_CARD=0 bash scripts/run_presmoke.sh | ||
| 46 | +``` | ||
| 47 | + | ||
| 48 | +Run one case: | ||
| 49 | + | ||
| 50 | +```bash | ||
| 51 | +bash scripts/run_presmoke.sh \ | ||
| 52 | + --filter 01_simd_cpp_api/02_features/03_basic_api/01_matrix_compute/mmad_unitflag | ||
| 53 | +``` | ||
| 54 | + | ||
| 55 | +Write reports to a specific directory: | ||
| 56 | + | ||
| 57 | +```bash | ||
| 58 | +OUT_ROOT=/tmp/presmoke_910b_card7 \ | ||
| 59 | +PRIMARY_CARD=7 \ | ||
| 60 | +bash scripts/run_presmoke.sh | ||
| 61 | +``` | ||
| 62 | + | ||
| 63 | +Run CPU mode explicitly. CPU mode is not the default: | ||
| 64 | + | ||
| 65 | +```bash | ||
| 66 | +MODES=cpu bash scripts/run_presmoke.sh | ||
| 67 | +``` | ||
| 68 | + | ||
| 69 | +Increase CPU run timeout for slow CPU-mode cases: | ||
| 70 | + | ||
| 71 | +```bash | ||
| 72 | +MODES=cpu CPU_RUN_TIMEOUT=1800 bash scripts/run_presmoke.sh | ||
| 73 | +``` | ||
| 74 | + | ||
| 75 | +## CI Commands | ||
| 76 | + | ||
| 77 | +910B: | ||
| 78 | + | ||
| 79 | +```bash | ||
| 80 | +PROJECT_ROOT=/path/to/asc-devkit \ | ||
| 81 | +ARCH=dav-2201 \ | ||
| 82 | +PRIMARY_CARD=7 \ | ||
| 83 | +RETRY_CARDS="0 1 2 3 4 5 6" \ | ||
| 84 | +bash scripts/run_presmoke.sh | ||
| 85 | +``` | ||
| 86 | + | ||
| 87 | +950: | ||
| 88 | + | ||
| 89 | +```bash | ||
| 90 | +PROJECT_ROOT=/path/to/asc-devkit \ | ||
| 91 | +ARCH=dav-3510 \ | ||
| 92 | +PRIMARY_CARD=0 \ | ||
| 93 | +bash scripts/run_presmoke.sh | ||
| 94 | +``` | ||
| 95 | + | ||
| 96 | +950 dry-run: | ||
| 97 | + | ||
| 98 | +```bash | ||
| 99 | +ARCH=dav-3510 PRIMARY_CARD=0 bash scripts/run_presmoke.sh --dry-run | ||
| 100 | +``` | ||
| 101 | + | ||
| 102 | +910B dry-run: | ||
| 103 | + | ||
| 104 | +```bash | ||
| 105 | +ARCH=dav-2201 PRIMARY_CARD=7 bash scripts/run_presmoke.sh --dry-run | ||
| 106 | +``` | ||
| 107 | + | ||
| 108 | +## Parameters | ||
| 109 | + | ||
| 110 | +| Variable | Default | Meaning | | ||
| 111 | +|---|---|---| | ||
| 112 | +| `PROJECT_ROOT` | script parent repo | asc-devkit checkout to run. | | ||
| 113 | +| `ASCEND_HOME_DIR` | `/usr/local/Ascend/ascend-toolkit/latest` | CANN toolkit root containing `set_env.sh`. | | ||
| 114 | +| `ARCH` | `dav-2201` | Target arch. Use `dav-2201` for 910B and `dav-3510` for 950. | | ||
| 115 | +| `PRIMARY_CARD` | `0` | Main NPU card id used for the full run. | | ||
| 116 | +| `RETRY_CARDS` | empty | Space-separated card ids for retrying timeout cases. | | ||
| 117 | +| `JOBS` | `auto` | Parallel build workers. NPU mode uses a conservative CPU-count ladder; CPU-only mode uses `ceil(CPU(s) / 4)`, capped at 64. | | ||
| 118 | +| `NPU_SLOTS` | `1` | NPU queue concurrency. Keep `1` for watch runs. | | ||
| 119 | +| `CPU_RUN_SLOTS` | `auto` | CPU-only run workers. `auto` uses host `CPU(s)` from `lscpu`. Ignored by NPU mode. | | ||
| 120 | +| `MAKE_JOBS` | `auto` | Per-case `make -j` limit. `auto` uses `CPU(s) / resolved JOBS`; explicit `make -j` commands are capped by the presmoke wrapper. | | ||
| 121 | +| `TIMEOUT` | `120` | Timeout in seconds for NPU run commands. Build and verify commands do not use this timeout. | | ||
| 122 | +| `CPU_RUN_TIMEOUT` | `300` | Timeout in seconds for CPU run commands. Increase this when CPU-only validation is slower than expected. | | ||
| 123 | +| `SCHEDULE` | `fixed` | Case submit order. Watch runs should use `fixed`. | | ||
| 124 | +| `SCHEDULE_FILE` | built-in | Optional fixed order override. | | ||
| 125 | +| `OUT_ROOT` | `presmoke_reports/presmoke_<arch>_<timestamp>` | Output directory for CI archive. | | ||
| 126 | +| `RUNNER_MODE` | `case-runner` | Default runner implementation. | | ||
| 127 | +| `MODES` | `npu` | Presmoke modes. | | ||
| 128 | +| `MODE` | unset | Alias used only when `MODES` is unset. For example, `MODE=cpu`. | | ||
| 129 | + | ||
| 130 | +CPU debug mode is opt-in. Use `MODES=cpu` or `MODE=cpu`; the default watch path remains `npu`. CPU mode does not use the NPU fixed schedule unless `SCHEDULE_FILE` is explicitly provided. | ||
| 131 | + | ||
| 132 | +For CPU mode, the default parallelism is computed from the host CPU count instead of hard-coded for specific machines. For example, a 192-CPU host resolves to `JOBS=48`, `MAKE_JOBS=4`, and `CPU_RUN_SLOTS=192`; an 88-CPU host resolves to `JOBS=22`, `MAKE_JOBS=4`, and `CPU_RUN_SLOTS=88`. | ||
| 133 | + | ||
| 134 | +## Reports | ||
| 135 | + | ||
| 136 | +The orchestrator writes: | ||
| 137 | + | ||
| 138 | +- `status.txt`: high-level progress and final location. | ||
| 139 | +- `full_card<N>/meta.txt`: env, card, elapsed time, and `npu-smi` snapshots. | ||
| 140 | +- `full_card<N>/stdout.log` and `stderr.log`: raw wrapper logs. | ||
| 141 | +- `full_card<N>/results/report.json`: machine-readable presmoke report. | ||
| 142 | +- `full_card<N>/results/report.md`: detailed Markdown report. | ||
| 143 | +- `full_card<N>/results/logs/<case>__<mode>.log`: full per-case command log. | ||
| 144 | +- `full_card<N>/results/logs/stages/<case>__<mode>__<stage>.log`: per-stage command logs for build, run, and verify. | ||
| 145 | +- `FINAL_REPORT.md`: concise summary with failures and retry results. | ||
| 146 | +- `ALL_CASE_TIMINGS.tsv`: per-case timing, NPU wait, step details, and executed commands. | ||
| 147 | +- `FAILURES.tsv`: failed or skipped primary results plus retry outcome. | ||
| 148 | + | ||
| 149 | +## Fixed Schedule | ||
| 150 | + | ||
| 151 | +The default fixed schedules are: | ||
| 152 | + | ||
| 153 | +- `scripts/presmoke/schedules/dav-2201_npu.txt` | ||
| 154 | +- `scripts/presmoke/schedules/dav-3510_npu.txt` | ||
| 155 | + | ||
| 156 | +They preserve the required custom-op ordering: | ||
| 157 | + | ||
| 158 | +- `custom_op_static_lib` runs before `custom_op`. | ||
| 159 | +- `parallel_ops_package` runs after `custom_op_static_lib`. | ||
| 160 | +- `aclnn`, `aclop`, `onnx`, `tensorflow`, and `tiling_sink` run after `custom_op`. | ||
| 161 | + | ||
| 162 | +New cases not listed in a schedule file are appended to the end, then the custom-op dependency order is enforced again. | ||
| 163 | + | ||
| 164 | +To regenerate a fixed schedule from a previous run: | ||
| 165 | + | ||
| 166 | +```bash | ||
| 167 | +PYTHONPATH=scripts PRESMOKE_PROJECT_ROOT=$PWD python3 -m presmoke \ | ||
| 168 | + --runner-mode case-runner \ | ||
| 169 | + --arch dav-2201 \ | ||
| 170 | + --modes npu \ | ||
| 171 | + --jobs auto \ | ||
| 172 | + --schedule npu-idle-min \ | ||
| 173 | + --schedule-report presmoke_reports/latest/full_card7/results/report.json \ | ||
| 174 | + --export-schedule scripts/presmoke/schedules/dav-2201_npu.txt \ | ||
| 175 | + --dry-run \ | ||
| 176 | + --report-format json \ | ||
| 177 | + --results /tmp/presmoke_schedule_export | ||
| 178 | +``` | ||
| 179 | + | ||
| 180 | +## Notes | ||
| 181 | + | ||
| 182 | +- Do not run multiple orchestrators in the same checkout at the same time. A lock under `.presmoke_locks` protects against accidental overlap. | ||
| 183 | +- The full watch entry cleans the active CANN `opp/vendors` directory. Make sure the CI user has permission to remove and reinstall custom-op vendor packages. | ||
| 184 | +- TensorFlow cases that require TensorFlow 2.6.5 are intentionally skipped by the case manifest. | ||
| 185 | +- Timeout retry is for timeout cases only. Non-timeout failures are reported and left for diagnosis. | ||
| @@ -0,0 +1,14 @@ | |||
| 1 | +#!/usr/bin/python3 | ||
| 2 | +# coding=utf-8 | ||
| 3 | + | ||
| 4 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 5 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 6 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 7 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 8 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 9 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 10 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 11 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 12 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 13 | + | ||
| 14 | +"""Presmoke watcher v2.""" | ||
| @@ -0,0 +1,18 @@ | |||
| 1 | +#!/usr/bin/python3 | ||
| 2 | +# coding=utf-8 | ||
| 3 | + | ||
| 4 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 5 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 6 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 7 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 8 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 9 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 10 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 11 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 12 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 13 | + | ||
| 14 | +from presmoke.cli import main | ||
| 15 | + | ||
| 16 | + | ||
| 17 | +if __name__ == "__main__": | ||
| 18 | + raise SystemExit(main()) | ||
| @@ -0,0 +1,50 @@ | |||
| 1 | +#!/usr/bin/python3 | ||
| 2 | +# coding=utf-8 | ||
| 3 | + | ||
| 4 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 5 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 6 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 7 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 8 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 9 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 10 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 11 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 12 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 13 | + | ||
| 14 | +from __future__ import annotations | ||
| 15 | + | ||
| 16 | +import os | ||
| 17 | +import re | ||
| 18 | +import shutil | ||
| 19 | +import subprocess | ||
| 20 | +from typing import Optional | ||
| 21 | + | ||
| 22 | + | ||
| 23 | +def detect_arch(explicit: Optional[str] = None) -> Optional[str]: | ||
| 24 | + if explicit: | ||
| 25 | + return explicit | ||
| 26 | + env_arch = os.environ.get("PRESMOKE_ARCH") | ||
| 27 | + if env_arch: | ||
| 28 | + return env_arch | ||
| 29 | + npu_smi = shutil.which("npu-smi") | ||
| 30 | + if not npu_smi: | ||
| 31 | + return None | ||
| 32 | + try: | ||
| 33 | + proc = subprocess.run( | ||
| 34 | + [npu_smi, "info"], | ||
| 35 | + stdout=subprocess.PIPE, | ||
| 36 | + stderr=subprocess.STDOUT, | ||
| 37 | + text=True, | ||
| 38 | + timeout=5, | ||
| 39 | + ) | ||
| 40 | + except (OSError, subprocess.TimeoutExpired): | ||
| 41 | + return None | ||
| 42 | + text = proc.stdout.lower() | ||
| 43 | + if "910b" in text or "910" in text or "a2" in text: | ||
| 44 | + return "dav-2201" | ||
| 45 | + if "950" in text or "a3" in text: | ||
| 46 | + return "dav-3510" | ||
| 47 | + found = re.search(r"dav-\d+", text) | ||
| 48 | + if found: | ||
| 49 | + return found.group(0) | ||
| 50 | + return None | ||
| @@ -0,0 +1,253 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +presmoke_project_root() { | ||
| 13 | + local root="${PRESMOKE_PROJECT_ROOT:-}" | ||
| 14 | + if [[ -z "$root" ]]; then | ||
| 15 | + root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" | ||
| 16 | + fi | ||
| 17 | + printf '%s\n' "$root" | ||
| 18 | +} | ||
| 19 | + | ||
| 20 | +presmoke_case_root() { | ||
| 21 | + local rel="$1" | ||
| 22 | + local root | ||
| 23 | + root="$(presmoke_project_root)" | ||
| 24 | + printf '%s/examples/%s\n' "$root" "$rel" | ||
| 25 | +} | ||
| 26 | + | ||
| 27 | +presmoke_arch() { | ||
| 28 | + printf '%s\n' "${PRESMOKE_ARCH:-dav-2201}" | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +presmoke_mode() { | ||
| 32 | + printf '%s\n' "${PRESMOKE_MODE:-npu}" | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +presmoke_soc_version() { | ||
| 36 | + if [[ -n "${PRESMOKE_SOC_VERSION:-}" ]]; then | ||
| 37 | + printf '%s\n' "$PRESMOKE_SOC_VERSION" | ||
| 38 | + return | ||
| 39 | + fi | ||
| 40 | + case "${1:-$(presmoke_arch)}" in | ||
| 41 | + dav-2201) printf '%s\n' "Ascend910B4" ;; | ||
| 42 | + dav-3510) printf '%s\n' "Ascend950PR_9599" ;; | ||
| 43 | + *) printf '%s\n' "${1:-$(presmoke_arch)}" ;; | ||
| 44 | + esac | ||
| 45 | +} | ||
| 46 | + | ||
| 47 | +presmoke_build_dir() { | ||
| 48 | + local case_dir="$1" | ||
| 49 | + printf '%s/build_%s\n' "$case_dir" "$(presmoke_mode)" | ||
| 50 | +} | ||
| 51 | + | ||
| 52 | +presmoke_case_init() { | ||
| 53 | + if [[ $# -ne 1 || -z "${1:-}" ]]; then | ||
| 54 | + echo "Usage: presmoke_case_init <case_rel>" >&2 | ||
| 55 | + return 2 | ||
| 56 | + fi | ||
| 57 | + | ||
| 58 | + CASE_DIR="$(presmoke_case_root "$1")" | ||
| 59 | + MODE="$(presmoke_mode)" | ||
| 60 | + ARCH="$(presmoke_arch)" | ||
| 61 | + SOC_VERSION="$(presmoke_soc_version "$ARCH")" | ||
| 62 | + RUN_MODE_ARG="" | ||
| 63 | + if [[ "$MODE" != "npu" ]]; then | ||
| 64 | + RUN_MODE_ARG="-DCMAKE_ASC_RUN_MODE=$MODE" | ||
| 65 | + fi | ||
| 66 | + BUILD_DIR="$(presmoke_build_dir "$CASE_DIR")" | ||
| 67 | + export CASE_DIR MODE ARCH SOC_VERSION RUN_MODE_ARG BUILD_DIR | ||
| 68 | +} | ||
| 69 | + | ||
| 70 | +run_in_build_dir() { | ||
| 71 | + (cd "$BUILD_DIR" && "$@") | ||
| 72 | +} | ||
| 73 | + | ||
| 74 | +presmoke_default_clean() { | ||
| 75 | + rm -rf "$BUILD_DIR" | ||
| 76 | +} | ||
| 77 | + | ||
| 78 | +presmoke_case_main() { | ||
| 79 | + local action="${1:-all}" | ||
| 80 | + | ||
| 81 | + if [[ "$action" == "clean" ]]; then | ||
| 82 | + case_clean | ||
| 83 | + return | ||
| 84 | + fi | ||
| 85 | + | ||
| 86 | + if [[ -n "${SKIP_REASON:-}" ]]; then | ||
| 87 | + echo "SKIP: $SKIP_REASON" | ||
| 88 | + return 0 | ||
| 89 | + fi | ||
| 90 | + | ||
| 91 | + case "$action" in | ||
| 92 | + build) case_build ;; | ||
| 93 | + run) case_run ;; | ||
| 94 | + verify) case_verify ;; | ||
| 95 | + all) case_build; case_run; case_verify ;; | ||
| 96 | + *) echo "Usage: $0 {build|run|verify|clean|all}" >&2; return 2 ;; | ||
| 97 | + esac | ||
| 98 | +} | ||
| 99 | + | ||
| 100 | +presmoke_run_command() { | ||
| 101 | + echo "+ $*" >&2 | ||
| 102 | + "$@" | ||
| 103 | +} | ||
| 104 | + | ||
| 105 | +presmoke_with_lock() { | ||
| 106 | + local name="$1" | ||
| 107 | + shift | ||
| 108 | + local root lock_parent lock_dir lock_pid | ||
| 109 | + root="$(presmoke_project_root)" | ||
| 110 | + lock_parent="${PRESMOKE_LOCK_DIR:-$root/.presmoke_locks}" | ||
| 111 | + lock_dir="$lock_parent/$name.lock" | ||
| 112 | + mkdir -p "$lock_parent" | ||
| 113 | + | ||
| 114 | + while ! mkdir "$lock_dir" 2>/dev/null; do | ||
| 115 | + if [[ -f "$lock_dir/pid" ]]; then | ||
| 116 | + lock_pid="$(cat "$lock_dir/pid" 2>/dev/null || true)" | ||
| 117 | + if [[ -n "$lock_pid" ]] && ! kill -0 "$lock_pid" 2>/dev/null; then | ||
| 118 | + rm -rf "$lock_dir" | ||
| 119 | + continue | ||
| 120 | + fi | ||
| 121 | + fi | ||
| 122 | + sleep 1 | ||
| 123 | + done | ||
| 124 | + | ||
| 125 | + echo "$$" > "$lock_dir/pid" | ||
| 126 | + local rc=0 | ||
| 127 | + "$@" || rc=$? | ||
| 128 | + rm -rf "$lock_dir" | ||
| 129 | + return "$rc" | ||
| 130 | +} | ||
| 131 | + | ||
| 132 | +presmoke_opp_path() { | ||
| 133 | + if [[ -n "${ASCEND_OPP_PATH:-}" ]]; then | ||
| 134 | + printf '%s\n' "$ASCEND_OPP_PATH" | ||
| 135 | + return | ||
| 136 | + fi | ||
| 137 | + if [[ -n "${ASCEND_HOME_PATH:-}" && -d "$ASCEND_HOME_PATH/opp" ]]; then | ||
| 138 | + printf '%s\n' "$ASCEND_HOME_PATH/opp" | ||
| 139 | + return | ||
| 140 | + fi | ||
| 141 | + printf '%s\n' "/usr/local/Ascend/cann-9.1.0/opp" | ||
| 142 | +} | ||
| 143 | + | ||
| 144 | +presmoke_custom_op_package_valid() { | ||
| 145 | + local vendor_dir | ||
| 146 | + vendor_dir="$(presmoke_opp_path)/vendors/customize" | ||
| 147 | + [[ -f "$vendor_dir/op_impl/ai_core/tbe/customize_impl/dynamic/add_custom.py" ]] || return 1 | ||
| 148 | + [[ -f "$vendor_dir/op_impl/ai_core/tbe/customize_impl/dynamic/add_custom_tiling_sink.py" ]] || return 1 | ||
| 149 | + [[ -f "$vendor_dir/op_api/include/aclnn_add_custom.h" ]] || return 1 | ||
| 150 | + [[ -f "$vendor_dir/op_api/include/aclnn_add_custom_tiling_sink.h" ]] || return 1 | ||
| 151 | + [[ -f "$vendor_dir/op_api/lib/libcust_opapi.so" ]] || return 1 | ||
| 152 | + [[ -f "$vendor_dir/framework/onnx/libcust_onnx_parsers.so" ]] || return 1 | ||
| 153 | + [[ -f "$vendor_dir/op_impl/ai_core/tbe/op_master_device/lib/libcust_opmaster.so" ]] || return 1 | ||
| 154 | +} | ||
| 155 | + | ||
| 156 | +presmoke_custom_op_dynamic_dirs() { | ||
| 157 | + local opp_path | ||
| 158 | + opp_path="$(presmoke_opp_path)" | ||
| 159 | + printf '%s\n' "$opp_path/vendors/customize/op_impl/ai_core/tbe/customize_impl/dynamic" | ||
| 160 | + printf '%s\n' "$opp_path/vendors/add_custom/op_impl/ai_core/tbe/add_custom_impl/dynamic" | ||
| 161 | +} | ||
| 162 | + | ||
| 163 | +presmoke_repair_custom_op_package_headers() { | ||
| 164 | + local build_dir="$1" | ||
| 165 | + local vendor_dynamic source_dynamic header | ||
| 166 | + source_dynamic="$build_dir/op_kernel/ascendc_kernels/binary/dynamic" | ||
| 167 | + [[ -d "$source_dynamic" ]] || return 0 | ||
| 168 | + | ||
| 169 | + while IFS= read -r vendor_dynamic; do | ||
| 170 | + [[ -d "$vendor_dynamic" ]] || continue | ||
| 171 | + while IFS= read -r header; do | ||
| 172 | + cp "$header" "$vendor_dynamic/" | ||
| 173 | + done < <(find "$source_dynamic" -mindepth 2 -maxdepth 2 -type f \( -name '*.h' -o -name '*.hpp' \) 2>/dev/null) | ||
| 174 | + done < <(presmoke_custom_op_dynamic_dirs) | ||
| 175 | +} | ||
| 176 | + | ||
| 177 | +presmoke_ensure_custom_op_package() { | ||
| 178 | + if [[ "${PRESMOKE_CUSTOM_OP_AUTO_INSTALL:-1}" == "0" ]]; then | ||
| 179 | + echo "PRESMOKE_CUSTOM_OP_AUTO_INSTALL=0; custom_op package auto-install skipped" >&2 | ||
| 180 | + return 0 | ||
| 181 | + fi | ||
| 182 | + presmoke_with_lock "custom_op_package" _presmoke_ensure_custom_op_package_locked | ||
| 183 | +} | ||
| 184 | + | ||
| 185 | +_presmoke_ensure_custom_op_package_locked() { | ||
| 186 | + local root custom_case_dir build_dir state_dir stamp arch mode package | ||
| 187 | + root="$(presmoke_project_root)" | ||
| 188 | + custom_case_dir="$root/examples/01_simd_cpp_api/02_features/00_compilation/custom_op" | ||
| 189 | + if [[ ! -d "$custom_case_dir" ]]; then | ||
| 190 | + echo "custom_op case directory not found: $custom_case_dir" >&2 | ||
| 191 | + return 2 | ||
| 192 | + fi | ||
| 193 | + | ||
| 194 | + arch="$(presmoke_arch)" | ||
| 195 | + mode="$(presmoke_mode)" | ||
| 196 | + build_dir="$(presmoke_build_dir "$custom_case_dir")" | ||
| 197 | + state_dir="${PRESMOKE_STATE_DIR:-$root/.presmoke_state}" | ||
| 198 | + stamp="$state_dir/custom_op_${arch}_${mode}.installed" | ||
| 199 | + mkdir -p "$build_dir" "$state_dir" | ||
| 200 | + | ||
| 201 | + if [[ -f "$stamp" ]]; then | ||
| 202 | + presmoke_repair_custom_op_package_headers "$build_dir" | ||
| 203 | + if presmoke_custom_op_package_valid; then | ||
| 204 | + echo "custom_op package already installed for arch=$arch mode=$mode" >&2 | ||
| 205 | + return 0 | ||
| 206 | + fi | ||
| 207 | + echo "custom_op package stamp exists but installed files are incomplete; reinstalling" >&2 | ||
| 208 | + rm -f "$stamp" | ||
| 209 | + fi | ||
| 210 | + | ||
| 211 | + local cmake_args=(cmake .. "-DCMAKE_ASC_ARCHITECTURES=$arch") | ||
| 212 | + if [[ -n "${NLOHMANN_JSON_URL:-}" ]]; then | ||
| 213 | + cmake_args+=("-DNLOHMANN_JSON_URL=$NLOHMANN_JSON_URL") | ||
| 214 | + fi | ||
| 215 | + if [[ "$mode" != "npu" ]]; then | ||
| 216 | + cmake_args+=("-DCMAKE_ASC_RUN_MODE=$mode") | ||
| 217 | + fi | ||
| 218 | + | ||
| 219 | + (cd "$build_dir" && presmoke_run_command "${cmake_args[@]}") | ||
| 220 | + (cd "$build_dir" && presmoke_run_command make -j binary package) | ||
| 221 | + | ||
| 222 | + local packages=("$build_dir"/custom_opp_*.run) | ||
| 223 | + if [[ ! -f "${packages[0]}" ]]; then | ||
| 224 | + echo "custom_op package was not generated under $build_dir" >&2 | ||
| 225 | + return 1 | ||
| 226 | + fi | ||
| 227 | + package="$(basename "${packages[0]}")" | ||
| 228 | + (cd "$build_dir" && presmoke_run_command "./$package") | ||
| 229 | + presmoke_repair_custom_op_package_headers "$build_dir" | ||
| 230 | + if ! presmoke_custom_op_package_valid; then | ||
| 231 | + echo "custom_op package install finished but required files are still incomplete" >&2 | ||
| 232 | + return 1 | ||
| 233 | + fi | ||
| 234 | + touch "$stamp" | ||
| 235 | +} | ||
| 236 | + | ||
| 237 | +presmoke_cmake() { | ||
| 238 | + local build_dir="$1" | ||
| 239 | + shift | ||
| 240 | + mkdir -p "$build_dir" | ||
| 241 | + ( | ||
| 242 | + cd "$build_dir" | ||
| 243 | + presmoke_run_command cmake "$@" -DCMAKE_ASC_ARCHITECTURES="$(presmoke_arch)" | ||
| 244 | + ) | ||
| 245 | +} | ||
| 246 | + | ||
| 247 | +presmoke_make() { | ||
| 248 | + local build_dir="$1" | ||
| 249 | + ( | ||
| 250 | + cd "$build_dir" | ||
| 251 | + presmoke_run_command make -j | ||
| 252 | + ) | ||
| 253 | +} | ||
| @@ -0,0 +1,179 @@ | |||
| 1 | +#!/usr/bin/python3 | ||
| 2 | +# coding=utf-8 | ||
| 3 | + | ||
| 4 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 5 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 6 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 7 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 8 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 9 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 10 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 11 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 12 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 13 | + | ||
| 14 | +from __future__ import annotations | ||
| 15 | + | ||
| 16 | +import json | ||
| 17 | +from dataclasses import dataclass | ||
| 18 | +from pathlib import Path | ||
| 19 | +from typing import Iterable, List | ||
| 20 | + | ||
| 21 | +from .discover import filter_examples | ||
| 22 | +from .model import Cell, Command, ExampleSpec, RunResult, Suggestion | ||
| 23 | + | ||
| 24 | + | ||
| 25 | +@dataclass | ||
| 26 | +class CaseRunnerContext: | ||
| 27 | + project_root: Path | ||
| 28 | + runners_root: Path | ||
| 29 | + arch: str | ||
| 30 | + modes: List[str] | ||
| 31 | + cells: List[Cell] | ||
| 32 | + suggestions: List[Suggestion] | ||
| 33 | + skipped: List[RunResult] | ||
| 34 | + | ||
| 35 | + | ||
| 36 | +@dataclass(frozen=True) | ||
| 37 | +class RunnerInfo: | ||
| 38 | + rel_path: str | ||
| 39 | + supported_archs: List[str] | ||
| 40 | + supported_modes: List[str] | ||
| 41 | + skip: bool | ||
| 42 | + skip_reason: str | ||
| 43 | + confidence: str | ||
| 44 | + reasons: List[str] | ||
| 45 | + | ||
| 46 | + | ||
| 47 | +def build_case_runner_cells_with_skips( | ||
| 48 | + project_root: Path, | ||
| 49 | + arch: str, | ||
| 50 | + modes: Iterable[str], | ||
| 51 | + includes: Iterable[str], | ||
| 52 | + excludes: Iterable[str], | ||
| 53 | +) -> tuple[List[Cell], List[Suggestion], List[RunResult]]: | ||
| 54 | + runners_root = project_root / "scripts" / "presmoke" / "cases" | ||
| 55 | + manifest = load_manifest(project_root) | ||
| 56 | + runner_dirs = sorted(path.parent for path in runners_root.rglob("run.sh")) | ||
| 57 | + runner_dirs = filter_examples(runner_dirs, includes, excludes) | ||
| 58 | + modes_list = list(modes) | ||
| 59 | + context = CaseRunnerContext( | ||
| 60 | + project_root=project_root, | ||
| 61 | + runners_root=runners_root, | ||
| 62 | + arch=arch, | ||
| 63 | + modes=modes_list, | ||
| 64 | + cells=[], | ||
| 65 | + suggestions=[], | ||
| 66 | + skipped=[], | ||
| 67 | + ) | ||
| 68 | + for runner_dir in runner_dirs: | ||
| 69 | + add_runner_cells(context, runner_dir, manifest) | ||
| 70 | + return context.cells, context.suggestions, context.skipped | ||
| 71 | + | ||
| 72 | + | ||
| 73 | +def add_runner_cells(context: CaseRunnerContext, runner_dir: Path, manifest: dict[str, dict]) -> None: | ||
| 74 | + info = load_runner_info(context, runner_dir, manifest) | ||
| 75 | + if append_skip_result(context, info): | ||
| 76 | + return | ||
| 77 | + append_confidence_suggestion(context, info) | ||
| 78 | + for mode in context.modes: | ||
| 79 | + if not mode_supported(context, info, mode): | ||
| 80 | + continue | ||
| 81 | + context.cells.append(make_runner_cell(context, runner_dir, info, mode)) | ||
| 82 | + | ||
| 83 | + | ||
| 84 | +def load_runner_info(context: CaseRunnerContext, runner_dir: Path, manifest: dict[str, dict]) -> RunnerInfo: | ||
| 85 | + rel_path = runner_dir.relative_to(context.runners_root).as_posix() | ||
| 86 | + info = manifest.get(rel_path, {}) | ||
| 87 | + return RunnerInfo( | ||
| 88 | + rel_path=rel_path, | ||
| 89 | + supported_archs=list(info.get("supported_archs") or [context.arch]), | ||
| 90 | + supported_modes=list(info.get("supported_modes") or context.modes or ["npu"]), | ||
| 91 | + skip=bool(info.get("skip")), | ||
| 92 | + skip_reason=info.get("skip_reason") or "explicit skip", | ||
| 93 | + confidence=info.get("confidence", ""), | ||
| 94 | + reasons=list(info.get("reasons", [])), | ||
| 95 | + ) | ||
| 96 | + | ||
| 97 | + | ||
| 98 | +def append_skip_result(context: CaseRunnerContext, info: RunnerInfo) -> bool: | ||
| 99 | + if not info.skip: | ||
| 100 | + return False | ||
| 101 | + for mode in context.modes: | ||
| 102 | + context.skipped.append( | ||
| 103 | + RunResult(info.rel_path, context.arch, mode, "SKIP", info.skip_reason, duration_s=0, source="case-runner") | ||
| 104 | + ) | ||
| 105 | + context.suggestions.append(Suggestion(info.rel_path, "case-runner", "info", "Explicitly skipped", info.skip_reason)) | ||
| 106 | + return True | ||
| 107 | + | ||
| 108 | + | ||
| 109 | +def append_confidence_suggestion(context: CaseRunnerContext, info: RunnerInfo) -> None: | ||
| 110 | + if info.confidence and info.confidence != "high": | ||
| 111 | + severity = "warn" if info.confidence == "low" else "info" | ||
| 112 | + context.suggestions.append( | ||
| 113 | + Suggestion( | ||
| 114 | + info.rel_path, | ||
| 115 | + "case-runner", | ||
| 116 | + severity, | ||
| 117 | + f"Generated runner confidence is {info.confidence}", | ||
| 118 | + ", ".join(info.reasons), | ||
| 119 | + ) | ||
| 120 | + ) | ||
| 121 | + | ||
| 122 | + | ||
| 123 | +def mode_supported(context: CaseRunnerContext, info: RunnerInfo, mode: str) -> bool: | ||
| 124 | + if context.arch not in info.supported_archs: | ||
| 125 | + context.suggestions.append( | ||
| 126 | + Suggestion( | ||
| 127 | + info.rel_path, | ||
| 128 | + "case-runner", | ||
| 129 | + "info", | ||
| 130 | + f"Excluded on unsupported arch {context.arch}", | ||
| 131 | + f"Supported archs: {', '.join(info.supported_archs)}", | ||
| 132 | + ) | ||
| 133 | + ) | ||
| 134 | + return False | ||
| 135 | + if mode not in info.supported_modes: | ||
| 136 | + context.suggestions.append( | ||
| 137 | + Suggestion( | ||
| 138 | + info.rel_path, | ||
| 139 | + "case-runner", | ||
| 140 | + "info", | ||
| 141 | + f"Excluded on unsupported mode {mode}", | ||
| 142 | + f"Supported modes: {', '.join(info.supported_modes)}", | ||
| 143 | + ) | ||
| 144 | + ) | ||
| 145 | + return False | ||
| 146 | + return True | ||
| 147 | + | ||
| 148 | + | ||
| 149 | +def make_runner_cell(context: CaseRunnerContext, runner_dir: Path, info: RunnerInfo, mode: str) -> Cell: | ||
| 150 | + runner = runner_dir / "run.sh" | ||
| 151 | + command_env = { | ||
| 152 | + "PRESMOKE_PROJECT_ROOT": str(context.project_root), | ||
| 153 | + "PRESMOKE_ARCH": context.arch, | ||
| 154 | + "PRESMOKE_MODE": mode, | ||
| 155 | + } | ||
| 156 | + commands = [ | ||
| 157 | + Command(f"bash {runner} clean", "clean", command_env), | ||
| 158 | + Command(f"bash {runner} build", "build", command_env), | ||
| 159 | + Command(f"bash {runner} run", "run", command_env), | ||
| 160 | + Command(f"bash {runner} verify", "verify", command_env), | ||
| 161 | + ] | ||
| 162 | + spec = ExampleSpec( | ||
| 163 | + path=context.project_root / "examples" / info.rel_path, | ||
| 164 | + rel_path=info.rel_path, | ||
| 165 | + commands=commands, | ||
| 166 | + archs=info.supported_archs, | ||
| 167 | + modes=info.supported_modes, | ||
| 168 | + source="case-runner", | ||
| 169 | + suggestions=[], | ||
| 170 | + ) | ||
| 171 | + return Cell(spec, context.arch, mode, commands, spec.path / f"build_{mode}") | ||
| 172 | + | ||
| 173 | + | ||
| 174 | +def load_manifest(project_root: Path) -> dict[str, dict]: | ||
| 175 | + manifest = project_root / "scripts" / "presmoke" / "reports" / "case_runner_manifest.json" | ||
| 176 | + if not manifest.exists(): | ||
| 177 | + return {} | ||
| 178 | + data = json.loads(manifest.read_text(encoding="utf-8")) | ||
| 179 | + return {item["case"]: item for item in data} | ||
| @@ -0,0 +1,39 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/00_introduction/00_quickstart/hello_world | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +case_run() { | ||
| 26 | + mkdir -p "$BUILD_DIR" | ||
| 27 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +case_verify() { | ||
| 31 | + mkdir -p "$BUILD_DIR" | ||
| 32 | + : | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +case_clean() { | ||
| 36 | + presmoke_default_clean | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,39 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/00_introduction/01_vector/add | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +case_run() { | ||
| 26 | + mkdir -p "$BUILD_DIR" | ||
| 27 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +case_verify() { | ||
| 31 | + mkdir -p "$BUILD_DIR" | ||
| 32 | + : | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +case_clean() { | ||
| 36 | + presmoke_default_clean | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/00_introduction/01_vector/add_tpipe_tque | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/00_introduction/02_matrix/matmul_advanced_api | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/00_introduction/02_matrix/matmul_basic_api | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/00_introduction/02_matrix/matmul_tensor_api | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/00_introduction/03_fusion_operation/gather_adds_simt_simd_hybrid | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/00_introduction/03_fusion_operation/matmul_leakyrelu_advanced_api | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/00_introduction/03_fusion_operation/matmul_leakyrelu_basic_api | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/00_introduction/04_vector_reg/add | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/00_introduction/04_vector_reg/gelu | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,39 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/01_utilities/00_printf/simd_vf_printf | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +case_run() { | ||
| 26 | + mkdir -p "$BUILD_DIR" | ||
| 27 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +case_verify() { | ||
| 31 | + mkdir -p "$BUILD_DIR" | ||
| 32 | + : | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +case_clean() { | ||
| 36 | + presmoke_default_clean | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/01_utilities/00_printf/simple_printf | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/01_utilities/01_assert | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/01_utilities/02_dump/simd_vf_dump | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/01_utilities/02_dump/simple_dump | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,39 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/01_utilities/03_cpudebug | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +case_run() { | ||
| 26 | + mkdir -p "$BUILD_DIR" | ||
| 27 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./cpu_debug) | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +case_verify() { | ||
| 31 | + mkdir -p "$BUILD_DIR" | ||
| 32 | + : | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +case_clean() { | ||
| 36 | + presmoke_default_clean | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,39 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/01_utilities/04_profiling/msprof | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +case_run() { | ||
| 26 | + mkdir -p "$BUILD_DIR" | ||
| 27 | + (cd "$CASE_DIR" && soc_version=$SOC_VERSION bash -lc 'msprof op ./demo') | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +case_verify() { | ||
| 31 | + mkdir -p "$BUILD_DIR" | ||
| 32 | + : | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +case_clean() { | ||
| 36 | + presmoke_default_clean | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +presmoke_case_main "$@" | ||
Ascripts/presmoke/cases/01_simd_cpp_api/01_utilities/04_profiling/torch_library_report_tensor/run.sh+39-0
| @@ -0,0 +1,39 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/01_utilities/04_profiling/torch_library_report_tensor | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +case_run() { | ||
| 26 | + mkdir -p "$BUILD_DIR" | ||
| 27 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'msprof --application="python3 ../torch_library_report_tensor.py" --output="../result"') | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +case_verify() { | ||
| 31 | + mkdir -p "$BUILD_DIR" | ||
| 32 | + : | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +case_clean() { | ||
| 36 | + presmoke_default_clean | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,44 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/01_utilities/05_sanitizer/ms_sanitizer | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$CASE_DIR" && soc_version=$SOC_VERSION bash -lc 'mssanitizer ./demo') | ||
| 24 | + (cd "$CASE_DIR" && soc_version=$SOC_VERSION bash -lc 'mssanitizer ./demo --leak-check=yes') | ||
| 25 | + (cd "$CASE_DIR" && soc_version=$SOC_VERSION bash -lc 'mssanitizer ./demo --check-unused-memory=yes') | ||
| 26 | + (cd "$CASE_DIR" && soc_version=$SOC_VERSION bash -lc 'mssanitizer ./demo --tool=racecheck') | ||
| 27 | + (cd "$CASE_DIR" && soc_version=$SOC_VERSION bash -lc 'mssanitizer ./demo --tool=initcheck') | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +case_run() { | ||
| 31 | + mkdir -p "$BUILD_DIR" | ||
| 32 | + : | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +case_verify() { | ||
| 36 | + mkdir -p "$BUILD_DIR" | ||
| 37 | + : | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +case_clean() { | ||
| 41 | + presmoke_default_clean | ||
| 42 | +} | ||
| 43 | + | ||
| 44 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,39 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/01_utilities/06_clock | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +case_run() { | ||
| 26 | + mkdir -p "$BUILD_DIR" | ||
| 27 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +case_verify() { | ||
| 31 | + mkdir -p "$BUILD_DIR" | ||
| 32 | + : | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +case_clean() { | ||
| 36 | + presmoke_default_clean | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/01_utilities/07_simulator | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$CASE_DIR" && soc_version=$SOC_VERSION bash -lc 'msprof op simulator --soc-version=Ascend910B1 ./demo') | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py ./output/output.bin ./output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/00_compilation/custom_op | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + presmoke_ensure_custom_op_package | ||
| 22 | + : | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +case_run() { | ||
| 26 | + mkdir -p "$BUILD_DIR" | ||
| 27 | + presmoke_ensure_custom_op_package | ||
| 28 | + : | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + : | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,39 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/00_compilation/custom_op_static_lib | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +case_run() { | ||
| 26 | + mkdir -p "$BUILD_DIR" | ||
| 27 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./execute_add_op) | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +case_verify() { | ||
| 31 | + mkdir -p "$BUILD_DIR" | ||
| 32 | + : | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +case_clean() { | ||
| 36 | + presmoke_default_clean | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,48 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/00_compilation/parallel_ops_package | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + local cmake_args=(cmake -S . -B build "-DCMAKE_ASC_ARCHITECTURES=$ARCH") | ||
| 21 | + if [[ -n "${NLOHMANN_JSON_URL:-}" ]]; then | ||
| 22 | + cmake_args+=("-DNLOHMANN_JSON_URL=$NLOHMANN_JSON_URL") | ||
| 23 | + fi | ||
| 24 | + if [[ -n "${RUN_MODE_ARG:-}" ]]; then | ||
| 25 | + cmake_args+=("$RUN_MODE_ARG") | ||
| 26 | + fi | ||
| 27 | + | ||
| 28 | + mkdir -p "$BUILD_DIR" | ||
| 29 | + (cd "$CASE_DIR" && soc_version=$SOC_VERSION presmoke_run_command "${cmake_args[@]}") | ||
| 30 | + (cd "$CASE_DIR" && soc_version=$SOC_VERSION presmoke_run_command cmake --build build -j) | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +case_run() { | ||
| 34 | + mkdir -p "$BUILD_DIR" | ||
| 35 | + (cd "$CASE_DIR" && soc_version=$SOC_VERSION bash -lc './build/add_custom/custom_opp_*.run') | ||
| 36 | + (cd "$CASE_DIR" && soc_version=$SOC_VERSION bash -lc './build/leaky_relu_custom/custom_opp_*.run') | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +case_verify() { | ||
| 40 | + mkdir -p "$BUILD_DIR" | ||
| 41 | + : | ||
| 42 | +} | ||
| 43 | + | ||
| 44 | +case_clean() { | ||
| 45 | + presmoke_default_clean | ||
| 46 | +} | ||
| 47 | + | ||
| 48 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/01_invocation/aclnn_invocation | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + presmoke_ensure_custom_op_package | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./execute_add_op) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + : | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,41 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/01_invocation/aclop_invocation | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + presmoke_ensure_custom_op_package | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'atc --singleop=../add_custom.json --output=. --soc_version=${soc_version}') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 24 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 25 | +} | ||
| 26 | + | ||
| 27 | +case_run() { | ||
| 28 | + mkdir -p "$BUILD_DIR" | ||
| 29 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./execute_add_op) | ||
| 30 | +} | ||
| 31 | + | ||
| 32 | +case_verify() { | ||
| 33 | + mkdir -p "$BUILD_DIR" | ||
| 34 | + : | ||
| 35 | +} | ||
| 36 | + | ||
| 37 | +case_clean() { | ||
| 38 | + presmoke_default_clean | ||
| 39 | +} | ||
| 40 | + | ||
| 41 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,39 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/02_framework/00_pytorch/pybind | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +case_run() { | ||
| 26 | + mkdir -p "$BUILD_DIR" | ||
| 27 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../add_custom_test.py') | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +case_verify() { | ||
| 31 | + mkdir -p "$BUILD_DIR" | ||
| 32 | + : | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +case_clean() { | ||
| 36 | + presmoke_default_clean | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +presmoke_case_main "$@" | ||
Ascripts/presmoke/cases/01_simd_cpp_api/02_features/02_framework/00_pytorch/torch_library/run.sh+39-0
| @@ -0,0 +1,39 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/02_framework/00_pytorch/torch_library | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +case_run() { | ||
| 26 | + mkdir -p "$BUILD_DIR" | ||
| 27 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../add_custom_test.py') | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +case_verify() { | ||
| 31 | + mkdir -p "$BUILD_DIR" | ||
| 32 | + : | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +case_clean() { | ||
| 36 | + presmoke_default_clean | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/02_framework/01_tensorflow/tensorflow_builtin | ||
| 15 | +SKIP_REASON='requires TensorFlow 2.6.5 environment; skipped by presmoke' | ||
| 16 | + | ||
| 17 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 18 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 19 | +presmoke_case_init "$CASE_REL" | ||
| 20 | + | ||
| 21 | +case_build() { | ||
| 22 | + mkdir -p "$BUILD_DIR" | ||
| 23 | + : | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + : | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + : | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/02_framework/01_tensorflow/tensorflow_custom | ||
| 15 | +SKIP_REASON='requires TensorFlow 2.6.5 environment; skipped by presmoke' | ||
| 16 | + | ||
| 17 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 18 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 19 | +presmoke_case_init "$CASE_REL" | ||
| 20 | + | ||
| 21 | +case_build() { | ||
| 22 | + mkdir -p "$BUILD_DIR" | ||
| 23 | + : | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + : | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + : | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,42 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/02_framework/02_onnx/onnx_plugin | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + presmoke_ensure_custom_op_package | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../leaky_relu.py') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'atc --model=./leaky_relu.onnx --framework=5 --soc_version=${soc_version} --output=./leaky_relu_custom --input_shape="X:8,16,1024" --input_format=ND') | ||
| 24 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 25 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 26 | +} | ||
| 27 | + | ||
| 28 | +case_run() { | ||
| 29 | + mkdir -p "$BUILD_DIR" | ||
| 30 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./execute_leaky_relu_op) | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +case_verify() { | ||
| 34 | + mkdir -p "$BUILD_DIR" | ||
| 35 | + : | ||
| 36 | +} | ||
| 37 | + | ||
| 38 | +case_clean() { | ||
| 39 | + presmoke_default_clean | ||
| 40 | +} | ||
| 41 | + | ||
| 42 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/00_data_movement/auxscalar_reg | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + : | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/00_data_movement/broadcast_ub2l0c | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/00_data_movement/copy_in_tensor_api | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && SCENARIO=0 soc_version=$SOC_VERSION bash -lc 'cmake -DSCENARIO_NUM=${SCENARIO} .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && SCENARIO=0 soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && SCENARIO=0 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py ${SCENARIO}') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && SCENARIO=0 soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && SCENARIO=0 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/00_data_movement/copy_out_tensor_api | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && SCENARIO=0 soc_version=$SOC_VERSION bash -lc 'cmake -DSCENARIO_NUM=${SCENARIO} .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && SCENARIO=0 soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && SCENARIO=0 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && SCENARIO=0 soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && SCENARIO=0 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
Ascripts/presmoke/cases/01_simd_cpp_api/02_features/03_basic_api/00_data_movement/copy_ub2ub/run.sh+40-0
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/00_data_movement/copy_ub2ub | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'cmake -DSCENARIO_NUM=$SCENARIO_NUM .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py -scenarioNum=$SCENARIO_NUM') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/00_data_movement/data_copy_gm2l1 | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'cmake -DSCENARIO_NUM=$SCENARIO_NUM .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py -scenarioNum=$SCENARIO_NUM') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin ./output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/00_data_movement/data_copy_gm2ub_nddma | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'cmake -DSCENARIO_NUM=$SCENARIO_NUM .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py -scenarioNum=$SCENARIO_NUM') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/00_data_movement/data_copy_gm2ub_slice | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/00_data_movement/data_copy_l0c2gm | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && SCENARIO=1 soc_version=$SOC_VERSION bash -lc 'cmake -DSCENARIO_NUM=$SCENARIO .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && SCENARIO=1 soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && SCENARIO=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py -scenarioNum=$SCENARIO') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && SCENARIO=1 soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && SCENARIO=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py -scenarioNum=$SCENARIO ./output/output.bin ./output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/00_data_movement/data_copy_pad_gm2ub_ub2gm | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'cmake .. -DSCENARIO_NUM=$SCENARIO_NUM -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py -scenarioNum=$SCENARIO_NUM') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin -scenarioNum=$SCENARIO_NUM') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/00_data_movement/data_copy_ub2l1 | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + : | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/00_data_movement/gather_ld_reg | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'cmake -DSCENARIO_NUM=$SCENARIO_NUM .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py -scenarioNum $SCENARIO_NUM') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + : | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/00_data_movement/ld_st_reg_align | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'cmake -DSCENARIO_NUM=$SCENARIO_NUM .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py -scenarioNum $SCENARIO_NUM') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + : | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/00_data_movement/ld_st_reg_mask | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'cmake -DSCENARIO_NUM=$SCENARIO_NUM .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py -scenarioNum=$SCENARIO_NUM') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + : | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/00_data_movement/ld_st_reg_unalign | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'cmake -DSCENARIO_NUM=$SCENARIO_NUM .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py -scenarioNum=$SCENARIO_NUM') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + : | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
Ascripts/presmoke/cases/01_simd_cpp_api/02_features/03_basic_api/00_data_movement/move_reg/run.sh+40-0
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/00_data_movement/move_reg | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'cmake -DSCENARIO_NUM=$SCENARIO_NUM .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py -scenarioNum=$SCENARIO_NUM') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + : | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/00_data_movement/scatter_st_reg | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + : | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/01_matrix_compute/batch_matmul | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'cmake .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/01_matrix_compute/fixpipe_l0c2gm | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'cmake -DSCENARIO_NUM=$SCENARIO_NUM .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py -scenarioNum=$SCENARIO_NUM') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin ./output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/01_matrix_compute/fixpipe_l0c2l1 | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'cmake -DSCENARIO_NUM=$SCENARIO_NUM .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py -scenarioNum=$SCENARIO_NUM') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin ./output/golden.bin $SCENARIO_NUM') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/01_matrix_compute/fixpipe_l0c2ub | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'cmake -DSCENARIO_NUM=$SCENARIO_NUM .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py -scenarioNum=$SCENARIO_NUM') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin ./output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/01_matrix_compute/load_data_2dmx_l12l0 | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && SCENARIO=1 soc_version=$SOC_VERSION bash -lc 'cmake .. -DSCENARIO_NUM=$SCENARIO -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && SCENARIO=1 soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && SCENARIO=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py -scenarioNum=$SCENARIO') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && SCENARIO=1 soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && SCENARIO=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/01_matrix_compute/load_data_2dv2_l12l0 | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'cmake -DSCENARIO_NUM=$SCENARIO_NUM .. -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py -scenarioNum=$SCENARIO_NUM') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && SCENARIO_NUM=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py -scenarioNum=$SCENARIO_NUM output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 11 | + | ||
| 12 | +set -euo pipefail | ||
| 13 | + | ||
| 14 | +CASE_REL=01_simd_cpp_api/02_features/03_basic_api/01_matrix_compute/load_data_l12l0 | ||
| 15 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 16 | +source "$SCRIPT_DIR/../../../../../_case_entry.sh" | ||
| 17 | +presmoke_case_init "$CASE_REL" | ||
| 18 | + | ||
| 19 | +case_build() { | ||
| 20 | + mkdir -p "$BUILD_DIR" | ||
| 21 | + (cd "$BUILD_DIR" && SCENARIO=1 soc_version=$SOC_VERSION bash -lc 'cmake .. -DSCENARIO_NUM=$SCENARIO -DCMAKE_ASC_ARCHITECTURES="$ARCH" $RUN_MODE_ARG') | ||
| 22 | + (cd "$BUILD_DIR" && SCENARIO=1 soc_version=$SOC_VERSION bash -lc 'make -j') | ||
| 23 | + (cd "$BUILD_DIR" && SCENARIO=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/gen_data.py -scenarioNum=$SCENARIO') | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +case_run() { | ||
| 27 | + mkdir -p "$BUILD_DIR" | ||
| 28 | + (cd "$BUILD_DIR" && SCENARIO=1 soc_version=$SOC_VERSION bash -lc ./demo) | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +case_verify() { | ||
| 32 | + mkdir -p "$BUILD_DIR" | ||
| 33 | + (cd "$BUILD_DIR" && SCENARIO=1 soc_version=$SOC_VERSION bash -lc 'python3 ../scripts/verify_result.py -scenarioNum=$SCENARIO output/output.bin output/golden.bin') | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +case_clean() { | ||
| 37 | + presmoke_default_clean | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +presmoke_case_main "$@" | ||