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

Replace most of preprocessor usage in nvcomp adapter with constexpr #11980

Merged

Conversation

vuule
Copy link
Contributor

@vuule vuule commented Oct 24, 2022

Description

C++17's "constexpr if" provides the same functionality as #if directive, as used in the nvcomp adapter.
This PR replaces macros with constexpr variables and uses them as conditions in "constexpr if" statements.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@vuule vuule added cuIO cuIO issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Oct 24, 2022
@vuule vuule self-assigned this Oct 24, 2022
@github-actions github-actions bot added the libcudf Affects libcudf (C++/CUDA) code. label Oct 24, 2022
@codecov
Copy link

codecov bot commented Oct 25, 2022

Codecov Report

Base: 88.11% // Head: 86.89% // Decreases project coverage by -1.21% ⚠️

Coverage data is based on head (89d4d27) compared to base (5c2150e).
Patch coverage: 93.75% of modified lines in pull request are covered.

❗ Current head 89d4d27 differs from pull request most recent head f16d312. Consider uploading reports for the commit f16d312 to get more accurate results

Additional details and impacted files
@@               Coverage Diff                @@
##           branch-22.12   #11980      +/-   ##
================================================
- Coverage         88.11%   86.89%   -1.22%     
================================================
  Files               133      133              
  Lines             21982    21995      +13     
================================================
- Hits              19369    19113     -256     
- Misses             2613     2882     +269     
Impacted Files Coverage Δ
python/cudf/cudf/core/dtypes.py 96.64% <93.75%> (+0.11%) ⬆️
python/cudf/cudf/core/udf/strings_lowering.py 0.00% <0.00%> (-100.00%) ⬇️
python/cudf/cudf/core/udf/strings_typing.py 0.00% <0.00%> (-95.78%) ⬇️
python/strings_udf/strings_udf/lowering.py 0.00% <0.00%> (-84.40%) ⬇️
python/cudf/cudf/core/udf/__init__.py 50.00% <0.00%> (-47.06%) ⬇️
python/strings_udf/strings_udf/_typing.py 81.05% <0.00%> (-13.69%) ⬇️
python/cudf/cudf/core/udf/utils.py 97.00% <0.00%> (-2.00%) ⬇️
python/cudf/cudf/core/column/numerical.py 95.21% <0.00%> (-0.29%) ⬇️
python/strings_udf/strings_udf/__init__.py 84.31% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@vuule vuule marked this pull request as ready for review October 25, 2022 03:32
@vuule vuule requested a review from a team as a code owner October 25, 2022 03:32
Copy link
Contributor

@upsj upsj left a comment

Choose a reason for hiding this comment

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

nice clean-up :)

@vuule
Copy link
Contributor Author

vuule commented Oct 25, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 2ee41d0 into rapidsai:branch-22.12 Oct 25, 2022
@vuule vuule deleted the impr-nvcomp-adapter-constexpr branch October 25, 2022 08:43
vuule added a commit that referenced this pull request Oct 25, 2022
rapids-bot bot pushed a commit that referenced this pull request Oct 26, 2022
…nstexpr`" (#11999)

Reverts #11980

The PR was made under the assumption that `if constexpr` branches can contain invalid code, if the branch is not taken. However, this only holds for templates.

Authors:
  - Vukasin Milovanovic (https://github.com/vuule)

Approvers:
  - Nghia Truong (https://github.com/ttnghia)
  - Bradley Dice (https://github.com/bdice)

URL: #11999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuIO cuIO issue improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants