-
Notifications
You must be signed in to change notification settings - Fork 178
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
implement <cuda/std/numbers>
#3355
base: main
Are you sure you want to change the base?
Conversation
libcudacxx/include/cuda/std/numbers
Outdated
template <class _Tp> | ||
_CCCL_GLOBAL_CONSTANT _Tp e_v = __e<_Tp>::value; |
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.
I believe we should rather just require _CCCL_NO_VARIABLE_TEMPLATES
for the whole thing.
A user cannot instantiate the structs anyhow, so it does not really add that much value but forces us to always instantiate a type when we would only need a variable.
We should rather just specialize the variable templates with the values and have the generic case be assigned from _Ill_formed<_Tp>
. In that case we are static_asserting anyhow so paying that is fine
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.
The reason I did not wrap everything by _CCCL_NO_VARIABLE_TEMPLATES
is that I was not sure if there would be a need for these constants internally for C++11 (I know it's already deprecated), because I think it can be quite useful.
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.
We can always add the more expensive method when we need it but we should use the efficient way if we can
libcudacxx/test/libcudacxx/std/numerics/numbers/illformed.fail.cpp
Outdated
Show resolved
Hide resolved
/ok to test |
🟨 CI finished in 1h 34m: Pass: 95%/144 | Total: 1d 10h | Avg: 14m 14s | Max: 1h 15m | Hits: 140%/12680
|
Project | |
---|---|
CCCL Infrastructure | |
+/- | libcu++ |
CUB | |
Thrust | |
CUDA Experimental | |
python | |
CCCL C Parallel Library | |
Catch2Helper |
Modifications in project or dependencies?
Project | |
---|---|
CCCL Infrastructure | |
+/- | libcu++ |
+/- | CUB |
+/- | Thrust |
+/- | CUDA Experimental |
+/- | python |
+/- | CCCL C Parallel Library |
+/- | Catch2Helper |
🏃 Runner counts (total jobs: 144)
# | Runner |
---|---|
98 | linux-amd64-cpu16 |
19 | linux-amd64-gpu-v100-latest-1 |
16 | windows-amd64-cpu16 |
10 | linux-arm64-cpu16 |
1 | linux-amd64-gpu-h100-latest-1-testing |
This PR implements
<numbers>
from C++20 (P0631R8) and makes it available back to C++14 (no extra effort was required).