Skip to content
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

Draft: Add filter rule( gcc 9 and older does not support C++ 20 ) #55

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

YuriiPerets
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 96.29630% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.32%. Comparing base (883bc22) to head (bfd6ab9).

Files with missing lines Patch % Lines
src/bashi/versions.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #55      +/-   ##
==========================================
+ Coverage   95.14%   95.32%   +0.17%     
==========================================
  Files          10       10              
  Lines         701      727      +26     
  Branches      213      199      -14     
==========================================
+ Hits          667      693      +26     
- Misses         15       16       +1     
+ Partials       19       18       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

SimeonEhrig
SimeonEhrig previously approved these changes Oct 10, 2024
@@ -596,3 +596,139 @@ def test_not_valid_cuda_versions_for_ubuntu_d4(self):
reason_msg.getvalue(),
f"host compiler clang-cuda {clang_cuda_version} is not available in Ubuntu 20.04",
)

def test_valid_gcc_cxx_combinations_d5(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The corner cases C++ 17 and C++ 20 are missing (see comment in Versions.py). Please test it also.

# the latest supported cxx version must be added, even if the supported gcc version does not
# increase
GCC_CXX_SUPPORT: List[GccCxxSupport] = [
GccCxxSupport("14", "23"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about this again. Actual the GCC 15 (not released yet) also adds missing C++23 and maybe the GCC 16 will too. So my idea is not good. Therefore we remove the entry for C++23 and replace it with C++17.

Suggested change
GccCxxSupport("14", "23"),
GccCxxSupport("8", "17"),

The filter rule should still work. You need only to modify the tests. Sorry for the extra work.

# increase
GCC_CXX_SUPPORT: List[GccCxxSupport] = [
GccCxxSupport("14", "23"),
# GccCxxSupport("18", "26"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the comment.

# Rule: d5
# remove all unsupported gcc cxx version combinations
"""
if DEVICE_COMPILER in row and row[DEVICE_COMPILER].name == GCC:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'm just keeping it for the draft version

break
"""

for compiler_type in (HOST_COMPILER, DEVICE_COMPILER):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as note, could be that you need to modify the rule, if you implement the C++ support filter rule for nvcc. Because with the nvcc filter rule, the C++ support of the host compiler depends on the device compiler. Small example:
If the host and device compiler is GCC 11, it supports C++20. If the host compiler is GCC 11 and the device Compiler is NVCC 11.8, only up to C++17 is allowed.
On the other side, the rule already removes invalid combinations which can never happen. If we check GCC 11 + C++ 23, it will never pass independent if the device compiler is GCC or NVCC. Therefore we keep it.

I only write down my thoughts in case you get a covertable.exceptions.InvalidCondition exception when you implement the nvcc C++ standard filter rule, that you have an point for under investigating.


def test_remove_unsupported_cxx_versions_for_gcc(self):
test_param_value_pairs: List[ParameterValuePair] = parse_expected_val_pairs2(
[
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The corner cases ((HOST_COMPILER, GCC, 9), (CXX_STANDARD, 19)), and ((HOST_COMPILER, GCC, 9), (CXX_STANDARD, 20)), and ((HOST_COMPILER, GCC, 8), (CXX_STANDARD, 16)), and ((HOST_COMPILER, GCC, 8), (CXX_STANDARD, 17)), are missing.

@SimeonEhrig SimeonEhrig dismissed their stale review October 10, 2024 12:51

Clicket on the wrong button

removed_parameter_value_pairs: List[ParameterValuePair],
):
for compiler_type in (HOST_COMPILER, DEVICE_COMPILER):
remove_parameter_value_pairs_ranges(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the usage of remove_parameter_value_pairs_ranges() is not correct yet. Because in the end, we should be able to iterate of the list GCC_CXX_SUPPORT and call the function remove_parameter_value_pairs_ranges() with each combination of the GCC version and CXX_STANDARD.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's a temporary solution, I wanted to write the right test_results first, and then change it to a more general case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants