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

Add partial specialization dtype_traits<const T>. #753

Merged
merged 1 commit into from
Oct 6, 2024

Conversation

hpkfft
Copy link
Contributor

@hpkfft hpkfft commented Oct 6, 2024

If a developer provides a specialization for, say, dtype_traits<__fp16> then this commit avoids his having also to provide a specialization for dtype_traits<const __fp16>.

@hpkfft
Copy link
Contributor Author

hpkfft commented Oct 6, 2024

As an aside, the C language has _Float16 defined in technical specification ISO/IEC TS 18661-3:2015.
Arm recommends that new code use the _Float16 data type instead of the __fp16 data type.
See: Arm Half-precision

C++23 has std::float16_t as well as std::bfloat16_t. See: Fixed width floating-point types

@wjakob
Copy link
Owner

wjakob commented Oct 6, 2024

This is great, thank you!

I am happy to accept further specializations, but they must be valid in c++17.

@wjakob wjakob merged commit 5ead8f0 into wjakob:master Oct 6, 2024
31 checks passed
@hpkfft hpkfft deleted the dtype_traits_const branch October 18, 2024 02:40
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.

2 participants