feat: add public C++ operator API#618
Draft
voltjia wants to merge 1 commit into
Draft
Conversation
Collaborator
Author
|
请列出几组通过这样暴露出的 API 的函数签名。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
include/infini/ops.hfor C++ consumers.infini::ops::functionalingenerated/include/infini/functional_ops.h.libinfiniops.infini::ops::functional::<OpName>.libinfiniops, pkg-config metadata, and CMake package metadata.Motivation
This is the first PR in the public operator API split. It adds the C++ source/link convenience layer first so the later stable C ABI can be implemented as a thin adapter over public C++ operator entrypoints instead of including backend kernel headers directly.
Closes #N/A
Type of Change
feat- new feature / new operator / new platformfix- bug fixperf- performance improvement (no behavioral change)refactor- code restructuring without behavior changetest- adding or fixing tests onlydocs- documentation onlybuild/ci- build system or CI configurationchore- tooling, formatting, or other non-code changes!in the Conventional Commits prefix or aBREAKING CHANGE:footer)Platforms Affected
WITH_CPU)WITH_NVIDIA)WITH_ILUVATAR)WITH_METAX)WITH_CAMBRICON)WITH_MOORE)WITH_ASCEND)WITH_TORCH)Test Results on Supported Platforms
pytestResulttests/test_cpp_api.py:1 passedssh nvidia, containeraccelerator-dev/nvidia:latest; build configured withWITH_CPU=ON,WITH_NVIDIA=ON.Full `pytest` output (optional)
Additional build checks on
ssh nvidiawithaccelerator-dev/nvidia:latest:Build emitted existing CUDA warnings around meaningless
constreturn qualifiers and partially overridden overloads.Benchmark / Performance Impact
N/A. This PR adds public API wrappers and build/install plumbing. It does not change operator kernels or dispatch selection.
Notes for Reviewers
infini::ops::functionalto avoid colliding with existing operator classes such asinfini::ops::Add.clang.cindexis unavailable in direct CMake builds.Checklist
Title, Branch, and Commits
feat: add public C++ operator API.<type>/...form:feat/cpp-operator-api.feat: add public C++ operator API.master.fixup!/squash!/wipcommits remain.Scope and Design
General Code Hygiene
git diff --checkpassed.C++ Specific
clang-formatversion 21 was not run in this session; remote build andgit diff --checkpassed.clang-tidywas not run in this session.new/deletewas added by this PR.Python Specific
ruff check/ruff format --checkwere not run in this session.Testing
tests/test_cpp_api.py.Build, CI, and Tooling
pip install .[dev]was not run.GENERATE_PYTHON_BINDINGS=ONpybind target still builds remotely.Documentation
Security and Safety