ucm-toolkit 0.8.0rc1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ucm_toolkit/__init__.py +17 -0
- ucm_toolkit/_resources/LICENSE +21 -0
- ucm_toolkit/_resources/dev-sandbox/.clang-format +35 -0
- ucm_toolkit/_resources/dev-sandbox/.github/workflows/lint-and-build.yml +57 -0
- ucm_toolkit/_resources/dev-sandbox/.github/workflows/push-check.yml +9 -0
- ucm_toolkit/_resources/dev-sandbox/.gitignore +47 -0
- ucm_toolkit/_resources/dev-sandbox/AGENTS.md +71 -0
- ucm_toolkit/_resources/dev-sandbox/CMakeLists.txt +29 -0
- ucm_toolkit/_resources/dev-sandbox/LICENSE +21 -0
- ucm_toolkit/_resources/dev-sandbox/cmake/DetectRuntime.cmake +187 -0
- ucm_toolkit/_resources/dev-sandbox/module/CMakeLists.txt +5 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/CMakeLists.txt +14 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/aio_engine.h +145 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/aio_impl.cc +181 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/aio_impl.h +71 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/aio_main.cc +221 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/block_opener.h +113 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/block_type.h +51 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/error_handle.h +39 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/host_buffer.cc +56 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/host_buffer.h +57 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/host_buffer_ascend.cc +74 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/host_buffer_cuda.cc +73 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/space_layout.h +81 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/CMakeLists.txt +39 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/ascend/copy_buffer_ascend.h +274 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/ascend/copy_case_ascend.cc +201 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/ascend/copy_instance_ascend.h +340 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/ascend/copy_runtime_ascend.cc +29 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/ascend/error_handle_ascend.h +44 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/ascend/ffts_direct_h2d/copy_case_ffts_direct_h2d_ascend.cc +189 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/ascend/ffts_direct_h2d/copy_instance_ffts_direct_h2d_ascend.h +174 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/ascend/ffts_direct_h2d/mapped_host_buffer_ffts_direct_h2d_ascend.h +298 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/ascend/forked_copy_runner_ascend.h +286 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/ascend/h2d_ffts_pipeline/ffts_d2d_dispatcher_ascend.h +212 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/copy_buffer.h +53 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/copy_case.h +103 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/copy_instance.h +93 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/copy_main.cc +125 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/copy_result.h +106 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/copy_runtime.h +33 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/copy_buffer_cuda.h +91 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/copy_case_cuda.cc +227 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/copy_instance_cuda.h +324 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/copy_kernel_cuda.cu +70 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/copy_runtime_cuda.cc +28 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/error_handle_cuda.h +43 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/gdr/copy_buffer_gdr.h +145 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/gdr/copy_case_gdr.cc +133 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/gdr/copy_instance_gdr.h +129 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/gdr/error_handle_gdr.h +61 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/gdr/rdma_channel_gdr.cc +323 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/gdr/rdma_channel_gdr.h +95 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/gdr/submit_executor_gdr.h +148 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/error_handle.h +37 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/simu/copy_buffer_simu.h +98 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/simu/copy_case_simu.cc +60 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/simu/copy_instance_simu.h +93 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/simu/copy_runtime_simu.cc +28 -0
- ucm_toolkit/_resources/dev-sandbox/module/logger/CMakeLists.txt +5 -0
- ucm_toolkit/_resources/dev-sandbox/module/logger/logger.cc +215 -0
- ucm_toolkit/_resources/dev-sandbox/module/logger/logger.h +72 -0
- ucm_toolkit/_resources/dev-sandbox/module/logger/logger_example.cc +53 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/CMakeLists.txt +22 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/ascend/trans_assert_ascend.h +52 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/ascend/trans_case_ascend.cc +213 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/ascend/trans_device_buffer_ascend.h +49 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/ascend/trans_host_buffer_ascend.h +98 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/ascend/trans_runtime_ascend.cc +29 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/ascend/trans_template_ascend.h +300 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/cuda/trans_assert_cuda.h +51 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/cuda/trans_case_cuda.cc +209 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/cuda/trans_device_buffer_cuda.h +49 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/cuda/trans_host_buffer_cuda.h +98 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/cuda/trans_kernel_cuda.cu +71 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/cuda/trans_kernel_cuda.h +32 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/cuda/trans_runtime_cuda.cc +27 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/cuda/trans_template_cuda.h +265 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/simu/trans_assert_simu.h +37 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/simu/trans_buffer_simu.h +91 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/simu/trans_case_simu.cc +78 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/simu/trans_runtime_simu.cc +27 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/simu/trans_template_simu.h +76 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/trans_buffer.h +52 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/trans_case.h +139 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/trans_main.cc +150 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/trans_result.h +101 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/trans_runtime.h +33 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/trans_stopwatch.h +43 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/trans_template.h +79 -0
- ucm_toolkit/_resources/dev-sandbox/readme.md +120 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/CMakeLists.txt +5 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.clang-format +15 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.github/dependabot.yml +8 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.github/issue_template.md +6 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.github/pull_request_template.md +7 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.github/workflows/cifuzz.yml +32 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.github/workflows/doc.yml +42 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.github/workflows/lint.yml +28 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.github/workflows/linux.yml +176 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.github/workflows/macos.yml +58 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.github/workflows/scorecard.yml +65 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.github/workflows/windows.yml +95 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.gitignore +21 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/CMakeLists.txt +535 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/CONTRIBUTING.md +20 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/ChangeLog.md +3050 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/LICENSE +27 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/README.md +485 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/doc/ChangeLog-old.md +3290 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/doc/api.md +679 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/doc/fmt.css +61 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/doc/fmt.js +4 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/doc/get-started.md +222 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/doc/index.md +151 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/doc/perf.svg +1 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/doc/python-license.txt +290 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/doc/syntax.md +886 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/args.h +220 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/base.h +2989 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/chrono.h +2330 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/color.h +637 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/compile.h +539 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/core.h +5 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/format-inl.h +1948 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/format.h +4244 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/os.h +427 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/ostream.h +167 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/printf.h +633 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/ranges.h +850 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/std.h +728 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/xchar.h +369 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/src/fmt.cc +153 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/src/format.cc +46 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/src/os.cc +398 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/Android.mk +15 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/AndroidManifest.xml +1 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/C++.sublime-syntax +2061 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/README +4 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/Vagrantfile +19 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/bazel/.bazelversion +1 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/bazel/BUILD.bazel +22 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/bazel/MODULE.bazel +7 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/bazel/README.md +28 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/bazel/WORKSPACE.bazel +2 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/build.gradle +132 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/check-commits +71 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/cmake/FindSetEnv.cmake +7 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/cmake/JoinPaths.cmake +26 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/cmake/fmt-config.cmake.in +7 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/cmake/fmt.pc.in +11 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/docopt.py +586 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/mkdocs +82 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/mkdocs.yml +48 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/printable.py +224 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/python/mkdocstrings_handlers/cxx/__init__.py +357 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/python/mkdocstrings_handlers/cxx/templates/README +1 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/release.py +209 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/CMakeLists.txt +257 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/add-subdirectory-test/CMakeLists.txt +17 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/add-subdirectory-test/main.cc +5 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/args-test.cc +202 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/assert-test.cc +31 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/base-test.cc +902 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/chrono-test.cc +1023 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/color-test.cc +129 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/compile-error-test/CMakeLists.txt +215 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/compile-fp-test.cc +61 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/compile-test.cc +423 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/cuda-test/CMakeLists.txt +73 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/cuda-test/cpp14.cc +11 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/cuda-test/cuda-cpp14.cu +28 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/detect-stdfs.cc +18 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/enforce-checks-test.cc +65 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/find-package-test/CMakeLists.txt +17 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/find-package-test/main.cc +5 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/format-impl-test.cc +477 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/format-test.cc +2567 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/.gitignore +3 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/CMakeLists.txt +30 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/README.md +25 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/build.sh +90 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/chrono-duration.cc +136 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/chrono-timepoint.cc +32 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/float.cc +39 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/fuzzer-common.h +77 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/main.cc +22 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/named-arg.cc +102 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/one-arg.cc +92 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/two-args.cc +106 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/gtest/.clang-format +3 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/gtest/CMakeLists.txt +32 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/gtest/gmock/gmock.h +11659 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/gtest/gmock-gtest-all.cc +14442 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/gtest/gtest/gtest-spi.h +238 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/gtest/gtest/gtest.h +12399 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/gtest-extra-test.cc +410 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/gtest-extra.cc +80 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/gtest-extra.h +165 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/header-only-test.cc +11 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/mock-allocator.h +77 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/module-test.cc +520 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/no-builtin-types-test.cc +25 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/noexception-test.cc +18 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/os-test.cc +592 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/ostream-test.cc +308 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/perf-sanity.cc +25 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/posix-mock-test.cc +442 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/posix-mock.h +75 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/printf-test.cc +568 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/ranges-odr-test.cc +18 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/ranges-test.cc +799 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/scan-test.cc +184 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/scan.h +669 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/static-export-test/CMakeLists.txt +30 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/static-export-test/library.cc +5 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/static-export-test/main.cc +6 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/std-test.cc +417 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/test-assert.h +39 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/test-main.cc +43 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/unicode-test.cc +48 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/util.cc +48 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/util.h +83 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/xchar-test.cc +421 -0
- ucm_toolkit/_resources/nic_monitor_pro.sh +310 -0
- ucm_toolkit/_resources/posixstore_aio_test.py +198 -0
- ucm_toolkit/_version.py +1 -0
- ucm_toolkit/cli.py +48 -0
- ucm_toolkit/commands/__init__.py +1 -0
- ucm_toolkit/commands/build.py +37 -0
- ucm_toolkit/commands/clean.py +24 -0
- ucm_toolkit/commands/doctor.py +26 -0
- ucm_toolkit/commands/list.py +29 -0
- ucm_toolkit/commands/run.py +24 -0
- ucm_toolkit/errors.py +73 -0
- ucm_toolkit/registry.py +92 -0
- ucm_toolkit/resources.py +31 -0
- ucm_toolkit/runner.py +46 -0
- ucm_toolkit/tools/__init__.py +1 -0
- ucm_toolkit/tools/dev_sandbox/__init__.py +5 -0
- ucm_toolkit/tools/dev_sandbox/adapter.py +285 -0
- ucm_toolkit/tools/metrics_view/__init__.py +5 -0
- ucm_toolkit/tools/metrics_view/adapter.py +47 -0
- ucm_toolkit/tools/metrics_view/configs/connector.json +1003 -0
- ucm_toolkit/tools/metrics_view/configs/metrics_lite.json +183 -0
- ucm_toolkit/tools/metrics_view/configs/store.json +1779 -0
- ucm_toolkit/tools/metrics_view/configs/vllm.json +417 -0
- ucm_toolkit/tools/metrics_view/metrics_cli.py +11 -0
- ucm_toolkit/tools/metrics_view/terminal_view_metrics/__init__.py +1 -0
- ucm_toolkit/tools/metrics_view/terminal_view_metrics/cli.py +338 -0
- ucm_toolkit/tools/metrics_view/terminal_view_metrics/collector.py +100 -0
- ucm_toolkit/tools/metrics_view/terminal_view_metrics/config.py +178 -0
- ucm_toolkit/tools/metrics_view/terminal_view_metrics/parser.py +80 -0
- ucm_toolkit/tools/metrics_view/terminal_view_metrics/promql.py +635 -0
- ucm_toolkit/tools/metrics_view/terminal_view_metrics/query.py +371 -0
- ucm_toolkit/tools/metrics_view/terminal_view_metrics/render.py +116 -0
- ucm_toolkit/tools/metrics_view/terminal_view_metrics/snapshot.py +193 -0
- ucm_toolkit/tools/metrics_view/terminal_view_metrics/storage.py +154 -0
- ucm_toolkit/tools/nic_monitor/__init__.py +5 -0
- ucm_toolkit/tools/nic_monitor/adapter.py +77 -0
- ucm_toolkit/tools/posix_aio/__init__.py +5 -0
- ucm_toolkit/tools/posix_aio/adapter.py +399 -0
- ucm_toolkit/tools/posix_aio/model_profile.py +316 -0
- ucm_toolkit/tools/precheck/__init__.py +7 -0
- ucm_toolkit/tools/precheck/adapter.py +42 -0
- ucm_toolkit/tools/precheck/bandwidth.py +976 -0
- ucm_toolkit/tools/precheck/checks.py +534 -0
- ucm_toolkit/tools/precheck/cli.py +303 -0
- ucm_toolkit/tools/precheck/config.py +218 -0
- ucm_toolkit/tools/precheck/parseutil.py +233 -0
- ucm_toolkit/tools/precheck/precheck.defaults.json +23 -0
- ucm_toolkit/tools/precheck/reporter.py +156 -0
- ucm_toolkit-0.8.0rc1.dist-info/METADATA +26 -0
- ucm_toolkit-0.8.0rc1.dist-info/RECORD +277 -0
- ucm_toolkit-0.8.0rc1.dist-info/WHEEL +5 -0
- ucm_toolkit-0.8.0rc1.dist-info/entry_points.txt +2 -0
- ucm_toolkit-0.8.0rc1.dist-info/top_level.txt +1 -0
ucm_toolkit/__init__.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""UCM toolkit command-line package."""
|
|
2
|
+
|
|
3
|
+
__all__ = ["__version__"]
|
|
4
|
+
|
|
5
|
+
try:
|
|
6
|
+
from ._version import __version__
|
|
7
|
+
except ModuleNotFoundError:
|
|
8
|
+
# Editable installs read the same authority as the native UCM package.
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
__version__ = next(
|
|
12
|
+
line.partition("=")[2]
|
|
13
|
+
for line in (Path(__file__).resolve().parents[2] / "version.ini")
|
|
14
|
+
.read_text()
|
|
15
|
+
.splitlines()
|
|
16
|
+
if line.startswith("UCM_VERSION=")
|
|
17
|
+
)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mag1c.H
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
BasedOnStyle: Google
|
|
2
|
+
IndentWidth: 4
|
|
3
|
+
ColumnLimit: 100
|
|
4
|
+
AccessModifierOffset: -4
|
|
5
|
+
AlwaysBreakTemplateDeclarations: true
|
|
6
|
+
PointerAlignment: Left
|
|
7
|
+
AlignArrayOfStructures: Left
|
|
8
|
+
AllowShortBlocksOnASingleLine: true
|
|
9
|
+
AllowShortCaseLabelsOnASingleLine: true
|
|
10
|
+
AllowShortFunctionsOnASingleLine: All
|
|
11
|
+
AllowShortIfStatementsOnASingleLine: true
|
|
12
|
+
AllowShortLoopsOnASingleLine: true
|
|
13
|
+
IncludeBlocks: Merge
|
|
14
|
+
IncludeCategories:
|
|
15
|
+
- Regex: '<.*>'
|
|
16
|
+
Priority: 2
|
|
17
|
+
- Regex: '.*'
|
|
18
|
+
Priority: 3
|
|
19
|
+
BreakBeforeBraces: Custom
|
|
20
|
+
BraceWrapping:
|
|
21
|
+
AfterClass: false
|
|
22
|
+
AfterControlStatement: false
|
|
23
|
+
AfterEnum: false
|
|
24
|
+
AfterFunction: true
|
|
25
|
+
AfterNamespace: false
|
|
26
|
+
AfterObjCDeclaration: false
|
|
27
|
+
AfterStruct: false
|
|
28
|
+
AfterUnion: false
|
|
29
|
+
AfterExternBlock: false
|
|
30
|
+
BeforeCatch: false
|
|
31
|
+
BeforeElse: false
|
|
32
|
+
IndentBraces: false
|
|
33
|
+
SplitEmptyFunction: true
|
|
34
|
+
SplitEmptyRecord: true
|
|
35
|
+
SplitEmptyNamespace: true
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
name: 'Lint and Build'
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
cpp-linter:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
steps:
|
|
10
|
+
- uses: actions/checkout@v4
|
|
11
|
+
with:
|
|
12
|
+
persist-credentials: false
|
|
13
|
+
- uses: cpp-linter/cpp-linter-action@main
|
|
14
|
+
id: linter
|
|
15
|
+
continue-on-error: true
|
|
16
|
+
env:
|
|
17
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
18
|
+
with:
|
|
19
|
+
style: file
|
|
20
|
+
tidy-checks: '-*'
|
|
21
|
+
ignore: 'vendor'
|
|
22
|
+
files-changed-only: true
|
|
23
|
+
lines-changed-only: diff
|
|
24
|
+
format-review: false
|
|
25
|
+
version: 20
|
|
26
|
+
|
|
27
|
+
- name: Fail fast?!
|
|
28
|
+
if: steps.linter.outputs.checks-failed != 0
|
|
29
|
+
run: |
|
|
30
|
+
echo "some linter checks failed. ${{ steps.linter.outputs.checks-failed }}"
|
|
31
|
+
exit 1
|
|
32
|
+
|
|
33
|
+
cpp_build_on_debug:
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
env:
|
|
36
|
+
BUILD_TYPE: Debug
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/checkout@v4
|
|
39
|
+
|
|
40
|
+
- name: Configure CMake
|
|
41
|
+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
|
42
|
+
|
|
43
|
+
- name: Build
|
|
44
|
+
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j
|
|
45
|
+
|
|
46
|
+
cpp_build_on_release:
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
env:
|
|
49
|
+
BUILD_TYPE: Release
|
|
50
|
+
steps:
|
|
51
|
+
- uses: actions/checkout@v4
|
|
52
|
+
|
|
53
|
+
- name: Configure CMake
|
|
54
|
+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
|
55
|
+
|
|
56
|
+
- name: Build
|
|
57
|
+
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Prerequisites
|
|
2
|
+
*.d
|
|
3
|
+
|
|
4
|
+
# Compiled Object files
|
|
5
|
+
*.slo
|
|
6
|
+
*.lo
|
|
7
|
+
*.o
|
|
8
|
+
*.obj
|
|
9
|
+
|
|
10
|
+
# Precompiled Headers
|
|
11
|
+
*.gch
|
|
12
|
+
*.pch
|
|
13
|
+
|
|
14
|
+
# Linker files
|
|
15
|
+
*.ilk
|
|
16
|
+
|
|
17
|
+
# Debugger Files
|
|
18
|
+
*.pdb
|
|
19
|
+
|
|
20
|
+
# Compiled Dynamic libraries
|
|
21
|
+
*.so
|
|
22
|
+
*.dylib
|
|
23
|
+
*.dll
|
|
24
|
+
|
|
25
|
+
# Fortran module files
|
|
26
|
+
*.mod
|
|
27
|
+
*.smod
|
|
28
|
+
|
|
29
|
+
# Compiled Static libraries
|
|
30
|
+
*.lai
|
|
31
|
+
*.la
|
|
32
|
+
*.a
|
|
33
|
+
*.lib
|
|
34
|
+
|
|
35
|
+
# Executables
|
|
36
|
+
*.exe
|
|
37
|
+
*.out
|
|
38
|
+
*.app
|
|
39
|
+
|
|
40
|
+
# Debug information files
|
|
41
|
+
*.dwo
|
|
42
|
+
|
|
43
|
+
# Development environment files
|
|
44
|
+
*.code-workspace
|
|
45
|
+
.vscode/**
|
|
46
|
+
.git/**
|
|
47
|
+
**/build/**
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
## 项目概述
|
|
4
|
+
|
|
5
|
+
C++17 项目,使用 CMake 构建系统,支持 CUDA、Ascend(华为 NPU)和 CPU 模拟三种运行模式。
|
|
6
|
+
|
|
7
|
+
## 构建命令
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# 配置项目(默认 Release)
|
|
11
|
+
cmake -B build
|
|
12
|
+
|
|
13
|
+
# 配置 Debug 模式
|
|
14
|
+
cmake -B build -DCMAKE_BUILD_TYPE=Debug
|
|
15
|
+
|
|
16
|
+
# 构建
|
|
17
|
+
cmake --build build -j
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 代码格式化
|
|
21
|
+
|
|
22
|
+
- 使用 `.clang-format`(基于 Google 风格的自定义配置)
|
|
23
|
+
- CI 会严格检查代码格式,格式错误会导致构建失败
|
|
24
|
+
- 建议在提交前运行:`clang-format -i <file>`
|
|
25
|
+
|
|
26
|
+
## 硬件条件编译
|
|
27
|
+
|
|
28
|
+
项目会根据环境自动选择编译目标:
|
|
29
|
+
|
|
30
|
+
**检测优先级**:
|
|
31
|
+
1. CACHE 变量:`-DCUDA_ROOT=...` 或 `-DASCEND_ROOT=...`
|
|
32
|
+
2. 环境变量:`CUDA_HOME`/`CUDA_PATH` 或 `ASCEND_HOME`/`ASCEND_TOOLKIT_HOME`
|
|
33
|
+
3. 默认路径:`/usr/local/cuda` 或 `/usr/local/Ascend/ascend-toolkit/latest`
|
|
34
|
+
|
|
35
|
+
**编译目标**:
|
|
36
|
+
- **CUDA**: 检测成功后编译 CUDA 内核(`*.cu`)
|
|
37
|
+
- **GDR**: CUDA 后端下检测到 `libibverbs` 时,额外编译 GDR 拷贝测试实现
|
|
38
|
+
- **Ascend**: 检测成功后编译 Ascend 实现
|
|
39
|
+
- **模拟模式**: 无 GPU 时编译纯 CPU 模拟版本
|
|
40
|
+
|
|
41
|
+
相关源文件位于 `module/*/cuda`、`module/*/ascend`、`module/*/simu` 子目录。
|
|
42
|
+
GDR 实现位于 `module/copy/cuda/gdr`,复用 `copy` 的公共基类体系,并注册到 `copy`
|
|
43
|
+
主程序中。
|
|
44
|
+
|
|
45
|
+
## 模块结构
|
|
46
|
+
|
|
47
|
+
- `cmake/`: CMake 模块(`DetectRuntime.cmake` 运行时检测)
|
|
48
|
+
- `module/aio`: 异步 I/O 性能测试工具
|
|
49
|
+
- `module/copy`: 设备间内存拷贝性能测试
|
|
50
|
+
- `module/copy/cuda/gdr`: CUDA GDR/RDMA 拷贝测试实现
|
|
51
|
+
- `module/logger`: 日志库
|
|
52
|
+
- `module/trans`: 数据传输性能测试
|
|
53
|
+
- `vendor/`: 第三方依赖源码
|
|
54
|
+
|
|
55
|
+
## 依赖管理
|
|
56
|
+
|
|
57
|
+
第三方依赖源码放在 `vendor/` 下:
|
|
58
|
+
- fmt (11.2.0): `vendor/fmt`
|
|
59
|
+
|
|
60
|
+
## CI 流程
|
|
61
|
+
|
|
62
|
+
每次推送触发:lint -> build (Debug) -> build (Release)
|
|
63
|
+
|
|
64
|
+
- Lint 使用 cpp-linter-action,只检查变更的文件
|
|
65
|
+
- 构建失败会立即停止
|
|
66
|
+
|
|
67
|
+
## 注意事项
|
|
68
|
+
|
|
69
|
+
- 编译器标志包含 `-Werror`,所有警告都会导致编译失败
|
|
70
|
+
- `compile_commands.json` 在构建时自动生成在 `build/` 目录
|
|
71
|
+
- 构建产物位于 `build/module/` 下各模块目录
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.18)
|
|
2
|
+
project(dev-sandbox VERSION 1.0.0 LANGUAGES CXX)
|
|
3
|
+
|
|
4
|
+
# Runtime backend detection
|
|
5
|
+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
|
6
|
+
include(DetectRuntime)
|
|
7
|
+
detect_runtime_backend()
|
|
8
|
+
if (CUDA_FOUND)
|
|
9
|
+
enable_language(CUDA)
|
|
10
|
+
endif()
|
|
11
|
+
|
|
12
|
+
# C++ standard
|
|
13
|
+
set(CMAKE_CXX_STANDARD 17)
|
|
14
|
+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
15
|
+
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
16
|
+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
17
|
+
|
|
18
|
+
set(FLAGS_PUBLIC "-Wall -Werror -fPIC -Wl,-z,relro,-z,now")
|
|
19
|
+
set(FLAGS_DEBUG "-O0 -g")
|
|
20
|
+
set(FLAGS_RELEASE "-O3 -D_FORTIFY_SOURCE=2")
|
|
21
|
+
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
|
|
22
|
+
if(CMAKE_BUILD_TYPE_LOWER STREQUAL "debug")
|
|
23
|
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS_PUBLIC} ${FLAGS_DEBUG}")
|
|
24
|
+
else()
|
|
25
|
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS_PUBLIC} ${FLAGS_RELEASE}")
|
|
26
|
+
endif()
|
|
27
|
+
|
|
28
|
+
add_subdirectory(vendor)
|
|
29
|
+
add_subdirectory(module)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mag1c.H
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# cmake/DetectRuntime.cmake
|
|
2
|
+
# Runtime backend detection module
|
|
3
|
+
|
|
4
|
+
function(detect_runtime_backend)
|
|
5
|
+
set(RUNTIME_BACKEND "Simulation" PARENT_SCOPE)
|
|
6
|
+
|
|
7
|
+
# ============================================
|
|
8
|
+
# CUDA Detection
|
|
9
|
+
# ============================================
|
|
10
|
+
set(_CUDA_ROOT "")
|
|
11
|
+
|
|
12
|
+
# Priority: CACHE variable > Environment variable > Default path
|
|
13
|
+
if(DEFINED CACHE{CUDA_ROOT} AND NOT "$CACHE{CUDA_ROOT}" STREQUAL "")
|
|
14
|
+
set(_CUDA_ROOT "$CACHE{CUDA_ROOT}")
|
|
15
|
+
elseif(DEFINED ENV{CUDA_HOME})
|
|
16
|
+
set(_CUDA_ROOT "$ENV{CUDA_HOME}")
|
|
17
|
+
elseif(DEFINED ENV{CUDA_PATH})
|
|
18
|
+
set(_CUDA_ROOT "$ENV{CUDA_PATH}")
|
|
19
|
+
elseif(EXISTS "/usr/local/cuda")
|
|
20
|
+
set(_CUDA_ROOT "/usr/local/cuda")
|
|
21
|
+
endif()
|
|
22
|
+
|
|
23
|
+
if(_CUDA_ROOT)
|
|
24
|
+
find_path(_CUDA_INCLUDE_DIR cuda_runtime.h
|
|
25
|
+
PATHS "${_CUDA_ROOT}/include"
|
|
26
|
+
NO_DEFAULT_PATH
|
|
27
|
+
)
|
|
28
|
+
find_library(_CUDA_LIBRARY cudart
|
|
29
|
+
PATHS "${_CUDA_ROOT}/lib64" "${_CUDA_ROOT}/lib"
|
|
30
|
+
NO_DEFAULT_PATH
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
if(_CUDA_INCLUDE_DIR AND _CUDA_LIBRARY)
|
|
34
|
+
message(STATUS "Found CUDA runtime: ${_CUDA_ROOT}")
|
|
35
|
+
message(STATUS " Include: ${_CUDA_INCLUDE_DIR}")
|
|
36
|
+
message(STATUS " Library: ${_CUDA_LIBRARY}")
|
|
37
|
+
|
|
38
|
+
# Create imported target
|
|
39
|
+
add_library(CUDA::Runtime INTERFACE IMPORTED GLOBAL)
|
|
40
|
+
target_include_directories(CUDA::Runtime INTERFACE "${_CUDA_INCLUDE_DIR}")
|
|
41
|
+
target_link_libraries(CUDA::Runtime INTERFACE "${_CUDA_LIBRARY}")
|
|
42
|
+
|
|
43
|
+
# Set global variables
|
|
44
|
+
set(RUNTIME_BACKEND "CUDA" PARENT_SCOPE)
|
|
45
|
+
set(CUDA_FOUND TRUE PARENT_SCOPE)
|
|
46
|
+
set(CUDA_ROOT "${_CUDA_ROOT}" PARENT_SCOPE)
|
|
47
|
+
|
|
48
|
+
# Enable CUDA language
|
|
49
|
+
set(CMAKE_CUDA_COMPILER "${_CUDA_ROOT}/bin/nvcc" PARENT_SCOPE)
|
|
50
|
+
set(CMAKE_CUDA_ARCHITECTURES 75 80 86 89 90 PARENT_SCOPE)
|
|
51
|
+
|
|
52
|
+
return()
|
|
53
|
+
endif()
|
|
54
|
+
endif()
|
|
55
|
+
|
|
56
|
+
# ============================================
|
|
57
|
+
# Ascend Detection
|
|
58
|
+
# ============================================
|
|
59
|
+
set(_ASCEND_ROOT "")
|
|
60
|
+
|
|
61
|
+
if(DEFINED CACHE{ASCEND_ROOT} AND NOT "$CACHE{ASCEND_ROOT}" STREQUAL "")
|
|
62
|
+
set(_ASCEND_ROOT "$CACHE{ASCEND_ROOT}")
|
|
63
|
+
elseif(DEFINED ENV{ASCEND_HOME})
|
|
64
|
+
set(_ASCEND_ROOT "$ENV{ASCEND_HOME}")
|
|
65
|
+
elseif(DEFINED ENV{ASCEND_TOOLKIT_HOME})
|
|
66
|
+
set(_ASCEND_ROOT "$ENV{ASCEND_TOOLKIT_HOME}")
|
|
67
|
+
elseif(DEFINED ENV{ASCEND_HOME_PATH})
|
|
68
|
+
set(_ASCEND_ROOT "$ENV{ASCEND_HOME_PATH}")
|
|
69
|
+
elseif(EXISTS "/usr/local/Ascend/ascend-toolkit/latest")
|
|
70
|
+
set(_ASCEND_ROOT "/usr/local/Ascend/ascend-toolkit/latest")
|
|
71
|
+
endif()
|
|
72
|
+
|
|
73
|
+
if(_ASCEND_ROOT)
|
|
74
|
+
find_path(_ASCEND_INCLUDE_DIR acl/acl.h
|
|
75
|
+
PATHS "${_ASCEND_ROOT}/include"
|
|
76
|
+
NO_DEFAULT_PATH
|
|
77
|
+
)
|
|
78
|
+
find_library(_ASCEND_LIBRARY ascendcl
|
|
79
|
+
PATHS "${_ASCEND_ROOT}/lib64" "${_ASCEND_ROOT}/lib"
|
|
80
|
+
NO_DEFAULT_PATH
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
if(_ASCEND_INCLUDE_DIR AND _ASCEND_LIBRARY)
|
|
84
|
+
find_library(_ASCEND_RUNTIME_LIBRARY runtime
|
|
85
|
+
PATHS
|
|
86
|
+
"${_ASCEND_ROOT}/lib64"
|
|
87
|
+
"${_ASCEND_ROOT}/lib"
|
|
88
|
+
"${_ASCEND_ROOT}/runtime/lib64"
|
|
89
|
+
"${_ASCEND_ROOT}/runtime/lib"
|
|
90
|
+
"${_ASCEND_ROOT}/aarch64-linux/lib64"
|
|
91
|
+
"${_ASCEND_ROOT}/aarch64-linux/lib"
|
|
92
|
+
"/usr/local/Ascend/cann/aarch64-linux/lib64"
|
|
93
|
+
"/usr/local/Ascend/cann/aarch64-linux/lib"
|
|
94
|
+
NO_DEFAULT_PATH
|
|
95
|
+
)
|
|
96
|
+
find_path(_ASCEND_FFTS_INCLUDE_DIR
|
|
97
|
+
NAMES runtime/rt_ffts_plus.h rt_external_ffts.h
|
|
98
|
+
PATHS
|
|
99
|
+
"${_ASCEND_ROOT}/include"
|
|
100
|
+
"${_ASCEND_ROOT}/pkg_inc"
|
|
101
|
+
"${_ASCEND_ROOT}/pkg_inc/runtime"
|
|
102
|
+
"${_ASCEND_ROOT}/aarch64-linux/pkg_inc"
|
|
103
|
+
"${_ASCEND_ROOT}/aarch64-linux/pkg_inc/runtime"
|
|
104
|
+
"/usr/local/Ascend/cann/aarch64-linux/pkg_inc"
|
|
105
|
+
"/usr/local/Ascend/cann/aarch64-linux/pkg_inc/runtime"
|
|
106
|
+
NO_DEFAULT_PATH
|
|
107
|
+
)
|
|
108
|
+
if(_ASCEND_FFTS_INCLUDE_DIR)
|
|
109
|
+
set(_ASCEND_FFTS_INCLUDE_DIRS "${_ASCEND_FFTS_INCLUDE_DIR}")
|
|
110
|
+
get_filename_component(_ASCEND_FFTS_INCLUDE_PARENT
|
|
111
|
+
"${_ASCEND_FFTS_INCLUDE_DIR}" DIRECTORY)
|
|
112
|
+
if(_ASCEND_FFTS_INCLUDE_DIR MATCHES "/runtime$"
|
|
113
|
+
AND EXISTS "${_ASCEND_FFTS_INCLUDE_PARENT}")
|
|
114
|
+
list(APPEND _ASCEND_FFTS_INCLUDE_DIRS "${_ASCEND_FFTS_INCLUDE_PARENT}")
|
|
115
|
+
endif()
|
|
116
|
+
|
|
117
|
+
set(_ASCEND_FFTS_EXTRA_INCLUDE_CANDIDATES
|
|
118
|
+
"${_ASCEND_ROOT}/pkg_inc"
|
|
119
|
+
"${_ASCEND_ROOT}/pkg_inc/toolchain"
|
|
120
|
+
"${_ASCEND_ROOT}/pkg_inc/profiling"
|
|
121
|
+
"${_ASCEND_ROOT}/aarch64-linux/pkg_inc"
|
|
122
|
+
"${_ASCEND_ROOT}/aarch64-linux/pkg_inc/toolchain"
|
|
123
|
+
"${_ASCEND_ROOT}/aarch64-linux/pkg_inc/profiling"
|
|
124
|
+
"/usr/local/Ascend/cann/aarch64-linux/pkg_inc"
|
|
125
|
+
"/usr/local/Ascend/cann/aarch64-linux/pkg_inc/toolchain"
|
|
126
|
+
"/usr/local/Ascend/cann/aarch64-linux/pkg_inc/profiling")
|
|
127
|
+
foreach(_ASCEND_EXTRA_INCLUDE_DIR
|
|
128
|
+
${_ASCEND_FFTS_EXTRA_INCLUDE_CANDIDATES})
|
|
129
|
+
if(EXISTS "${_ASCEND_EXTRA_INCLUDE_DIR}")
|
|
130
|
+
list(APPEND _ASCEND_FFTS_INCLUDE_DIRS "${_ASCEND_EXTRA_INCLUDE_DIR}")
|
|
131
|
+
endif()
|
|
132
|
+
endforeach()
|
|
133
|
+
find_path(_ASCEND_PROF_COMMON_INCLUDE_DIR
|
|
134
|
+
NAMES prof_common.h
|
|
135
|
+
PATHS ${_ASCEND_FFTS_EXTRA_INCLUDE_CANDIDATES}
|
|
136
|
+
NO_DEFAULT_PATH
|
|
137
|
+
)
|
|
138
|
+
if(_ASCEND_PROF_COMMON_INCLUDE_DIR)
|
|
139
|
+
list(APPEND _ASCEND_FFTS_INCLUDE_DIRS
|
|
140
|
+
"${_ASCEND_PROF_COMMON_INCLUDE_DIR}")
|
|
141
|
+
endif()
|
|
142
|
+
find_path(_ASCEND_PROF_API_INCLUDE_DIR
|
|
143
|
+
NAMES prof_api.h toolchain/prof_api.h profiling/prof_api.h
|
|
144
|
+
PATHS ${_ASCEND_FFTS_EXTRA_INCLUDE_CANDIDATES}
|
|
145
|
+
NO_DEFAULT_PATH
|
|
146
|
+
)
|
|
147
|
+
if(_ASCEND_PROF_API_INCLUDE_DIR)
|
|
148
|
+
list(APPEND _ASCEND_FFTS_INCLUDE_DIRS
|
|
149
|
+
"${_ASCEND_PROF_API_INCLUDE_DIR}")
|
|
150
|
+
endif()
|
|
151
|
+
list(REMOVE_DUPLICATES _ASCEND_FFTS_INCLUDE_DIRS)
|
|
152
|
+
endif()
|
|
153
|
+
|
|
154
|
+
message(STATUS "Found Ascend runtime: ${_ASCEND_ROOT}")
|
|
155
|
+
message(STATUS " Include: ${_ASCEND_INCLUDE_DIR}")
|
|
156
|
+
message(STATUS " Library: ${_ASCEND_LIBRARY}")
|
|
157
|
+
if(_ASCEND_RUNTIME_LIBRARY AND _ASCEND_FFTS_INCLUDE_DIR)
|
|
158
|
+
message(STATUS " FFTS Includes: ${_ASCEND_FFTS_INCLUDE_DIRS}")
|
|
159
|
+
message(STATUS " Runtime Library: ${_ASCEND_RUNTIME_LIBRARY}")
|
|
160
|
+
else()
|
|
161
|
+
message(STATUS " FFTS support: disabled (missing FFTS header or libruntime)")
|
|
162
|
+
endif()
|
|
163
|
+
|
|
164
|
+
# Create imported target
|
|
165
|
+
add_library(Ascend::Runtime INTERFACE IMPORTED GLOBAL)
|
|
166
|
+
target_include_directories(Ascend::Runtime INTERFACE "${_ASCEND_INCLUDE_DIR}")
|
|
167
|
+
target_link_libraries(Ascend::Runtime INTERFACE "${_ASCEND_LIBRARY}")
|
|
168
|
+
|
|
169
|
+
# Set global variables
|
|
170
|
+
set(RUNTIME_BACKEND "Ascend" PARENT_SCOPE)
|
|
171
|
+
set(ASCEND_FOUND TRUE PARENT_SCOPE)
|
|
172
|
+
set(ASCEND_ROOT "${_ASCEND_ROOT}" PARENT_SCOPE)
|
|
173
|
+
if(_ASCEND_RUNTIME_LIBRARY AND _ASCEND_FFTS_INCLUDE_DIR)
|
|
174
|
+
set(HAVE_ASCEND_FFTS_RUNTIME TRUE PARENT_SCOPE)
|
|
175
|
+
set(ASCEND_RUNTIME_LIBRARY "${_ASCEND_RUNTIME_LIBRARY}" PARENT_SCOPE)
|
|
176
|
+
set(ASCEND_FFTS_INCLUDE_DIRS "${_ASCEND_FFTS_INCLUDE_DIRS}" PARENT_SCOPE)
|
|
177
|
+
endif()
|
|
178
|
+
|
|
179
|
+
return()
|
|
180
|
+
endif()
|
|
181
|
+
endif()
|
|
182
|
+
|
|
183
|
+
# ============================================
|
|
184
|
+
# Fallback to simulation mode
|
|
185
|
+
# ============================================
|
|
186
|
+
message(STATUS "No GPU runtime found, using CPU simulation mode")
|
|
187
|
+
endfunction()
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
add_executable(aio aio_main.cc)
|
|
2
|
+
target_sources(aio PRIVATE aio_impl.cc)
|
|
3
|
+
target_link_libraries(aio PRIVATE fmt::fmt)
|
|
4
|
+
|
|
5
|
+
# Select implementation based on runtime backend
|
|
6
|
+
if(RUNTIME_BACKEND STREQUAL "CUDA")
|
|
7
|
+
target_sources(aio PRIVATE host_buffer_cuda.cc)
|
|
8
|
+
target_link_libraries(aio PRIVATE CUDA::Runtime)
|
|
9
|
+
elseif(RUNTIME_BACKEND STREQUAL "Ascend")
|
|
10
|
+
target_sources(aio PRIVATE host_buffer_ascend.cc)
|
|
11
|
+
target_link_libraries(aio PRIVATE Ascend::Runtime)
|
|
12
|
+
else()
|
|
13
|
+
target_sources(aio PRIVATE host_buffer.cc)
|
|
14
|
+
endif()
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2026 Mag1c.H
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
* */
|
|
24
|
+
#ifndef AIO_AIO_ENGINE_H
|
|
25
|
+
#define AIO_AIO_ENGINE_H
|
|
26
|
+
|
|
27
|
+
#include <memory>
|
|
28
|
+
#include <unistd.h>
|
|
29
|
+
#include "aio_impl.h"
|
|
30
|
+
#include "block_opener.h"
|
|
31
|
+
|
|
32
|
+
namespace aio {
|
|
33
|
+
|
|
34
|
+
class AioEngine {
|
|
35
|
+
public:
|
|
36
|
+
struct IoShard {
|
|
37
|
+
BlockId id;
|
|
38
|
+
void* addr;
|
|
39
|
+
size_t length;
|
|
40
|
+
};
|
|
41
|
+
using IoTask = std::vector<IoShard>;
|
|
42
|
+
class IoWaiter {
|
|
43
|
+
public:
|
|
44
|
+
IoWaiter(size_t expected) noexcept : counter_(expected) {}
|
|
45
|
+
void SetEpilog(std::function<void(void)> finish) noexcept { finish_ = std::move(finish); }
|
|
46
|
+
void Done() noexcept
|
|
47
|
+
{
|
|
48
|
+
auto counter = this->counter_.load(std::memory_order_acquire);
|
|
49
|
+
while (counter > 0) {
|
|
50
|
+
auto desired = counter - 1;
|
|
51
|
+
if (this->counter_.compare_exchange_weak(counter, desired,
|
|
52
|
+
std::memory_order_acq_rel)) {
|
|
53
|
+
if (desired == 0) {
|
|
54
|
+
if (finish_) { finish_(); }
|
|
55
|
+
std::lock_guard<std::mutex> lg(this->mutex_);
|
|
56
|
+
this->cv_.notify_all();
|
|
57
|
+
}
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
void Wait() noexcept
|
|
63
|
+
{
|
|
64
|
+
std::unique_lock<std::mutex> lk(this->mutex_);
|
|
65
|
+
if (this->counter_ == 0) { return; }
|
|
66
|
+
this->cv_.wait(lk, [this] { return this->counter_ == 0; });
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private:
|
|
70
|
+
std::mutex mutex_;
|
|
71
|
+
std::condition_variable cv_;
|
|
72
|
+
std::atomic<size_t> counter_{0};
|
|
73
|
+
std::function<void(void)> finish_{nullptr};
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
AioEngine(const SpaceLayout* layout, const size_t nOpenWorker)
|
|
77
|
+
: aio_(std::make_unique<AioImpl>()),
|
|
78
|
+
opener_(std::make_unique<BlockOpener>(layout, nOpenWorker))
|
|
79
|
+
{
|
|
80
|
+
}
|
|
81
|
+
std::shared_ptr<IoWaiter> SubmitWrite(const IoTask& ioTask) { return Submit<true>(ioTask); }
|
|
82
|
+
std::shared_ptr<IoWaiter> SubmitRead(const IoTask& ioTask) { return Submit<false>(ioTask); }
|
|
83
|
+
|
|
84
|
+
private:
|
|
85
|
+
void OnIoCallback(std::shared_ptr<IoWaiter> w, int32_t fd, const BlockId& id,
|
|
86
|
+
const AioImpl::Result& result)
|
|
87
|
+
{
|
|
88
|
+
if (result.error != 0) {
|
|
89
|
+
fmt::println("Failed({}) to do io on block({}).", result.error, id);
|
|
90
|
+
}
|
|
91
|
+
::close(fd);
|
|
92
|
+
w->Done();
|
|
93
|
+
}
|
|
94
|
+
template <bool dump>
|
|
95
|
+
void OnOpenCallback(std::shared_ptr<IoWaiter> w, const IoShard& shard,
|
|
96
|
+
const BlockOpener::OpenResult& result)
|
|
97
|
+
{
|
|
98
|
+
if (result.error != 0) {
|
|
99
|
+
fmt::println("Failed({}) to do open on block({}).", result.error, shard.id);
|
|
100
|
+
if (result.fd >= 0) { ::close(result.fd); }
|
|
101
|
+
w->Done();
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
AioImpl::Io io;
|
|
105
|
+
io.fd = result.fd;
|
|
106
|
+
io.offset = 0;
|
|
107
|
+
io.length = shard.length;
|
|
108
|
+
io.buffer = shard.addr;
|
|
109
|
+
io.callback = [this, w, fd = result.fd, id = shard.id](AioImpl::Result ioResult) {
|
|
110
|
+
OnIoCallback(w, fd, id, ioResult);
|
|
111
|
+
};
|
|
112
|
+
if constexpr (dump) {
|
|
113
|
+
aio_->WriteAsync(std::move(io));
|
|
114
|
+
} else {
|
|
115
|
+
aio_->ReadAsync(std::move(io));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
template <bool dump>
|
|
119
|
+
std::shared_ptr<IoWaiter> Submit(const IoTask& ioTask)
|
|
120
|
+
{
|
|
121
|
+
const auto number = ioTask.size();
|
|
122
|
+
auto waiter = std::make_shared<IoWaiter>(number);
|
|
123
|
+
const auto flags = O_DIRECT | (dump ? (O_CREAT | O_WRONLY) : O_RDONLY);
|
|
124
|
+
std::list<BlockOpener::OpenTask> tasks;
|
|
125
|
+
for (size_t i = 0; i < number; ++i) {
|
|
126
|
+
BlockOpener::OpenTask task;
|
|
127
|
+
const auto& shard = ioTask[i];
|
|
128
|
+
task.id = shard.id;
|
|
129
|
+
task.flags = flags;
|
|
130
|
+
task.callback = [this, waiter, shard = ioTask[i]](BlockOpener::OpenResult result) {
|
|
131
|
+
OnOpenCallback<dump>(waiter, shard, result);
|
|
132
|
+
};
|
|
133
|
+
tasks.push_back(std::move(task));
|
|
134
|
+
}
|
|
135
|
+
opener_->Submit(std::move(tasks));
|
|
136
|
+
return waiter;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
std::unique_ptr<AioImpl> aio_;
|
|
140
|
+
std::unique_ptr<BlockOpener> opener_;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
} // namespace aio
|
|
144
|
+
|
|
145
|
+
#endif
|