-
Notifications
You must be signed in to change notification settings - Fork 6k
[Cpp API Compatibility] Support Compat tests on Windows #78670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3704c6b
[Cpp API Compatibility] Support Compat tests on Windows
youge325 788cc8a
fix Windows Linking Error by adding missing export macro
youge325 f2a14e3
fix the same error
youge325 f6d6213
fix again
youge325 ff8ad58
Merge branch 'develop' into cWin
youge325 0f73dcb
fix tests on windows
youge325 51b26af
fix test_cuda_graph_static_mode_error
youge325 86220b7
fix coverage rate
youge325 6162a0d
Merge branch 'PaddlePaddle:develop' into cWin
youge325 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| // Copyright (c) 2026 PaddlePaddle Authors. All Rights Reserved. | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| #include <c10/core/DefaultDtype.h> | ||
| #include <c10/util/complex.h> | ||
| #include <c10/util/typeid.h> | ||
|
|
||
| namespace c10 { | ||
| static auto default_dtype = caffe2::TypeMeta::Make<float>(); | ||
| static auto default_dtype_as_scalartype = default_dtype.toScalarType(); | ||
| static auto default_complex_dtype = | ||
| caffe2::TypeMeta::Make<c10::complex<float>>(); | ||
|
|
||
| void set_default_dtype(caffe2::TypeMeta dtype) { | ||
| default_dtype = dtype; | ||
| default_dtype_as_scalartype = default_dtype.toScalarType(); | ||
| switch (default_dtype_as_scalartype) { | ||
| case ScalarType::Half: | ||
| default_complex_dtype = ScalarType::ComplexHalf; | ||
| break; | ||
| case ScalarType::Double: | ||
| default_complex_dtype = ScalarType::ComplexDouble; | ||
| break; | ||
| default: | ||
| default_complex_dtype = ScalarType::ComplexFloat; | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| const caffe2::TypeMeta get_default_dtype() { return default_dtype; } | ||
|
|
||
| ScalarType get_default_dtype_as_scalartype() { | ||
| return default_dtype_as_scalartype; | ||
| } | ||
|
|
||
| const caffe2::TypeMeta get_default_complex_dtype() { | ||
| return default_complex_dtype; | ||
| } | ||
| } // namespace c10 |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
最近发现用最新 develop 编译的包(比如 paddlecodec 0.2)给 release/3.4 会出现
get_default_dtype之类的符号缺失的问题,其实就是 ABI 兼容问题,按我理解只有编译到libpaddle.so/libphi.so的.cc文件对应接口变动才会有这类问题,.h文件应该不会导致这类问题,后面修改相关.cc接口需要多留意下潜在的 ABI 兼容性问题cc @BingooYang