-
Notifications
You must be signed in to change notification settings - Fork 81
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
Compatibility: Only use sycl::half
if SYCL_CTS_ENABLE_HALF_TESTS is set
#872
base: main
Are you sure you want to change the base?
Conversation
} else if (std::is_same_v<std::remove_cv_t<CTS_TYPE>, double>) { | ||
} | ||
#endif | ||
if (std::is_same_v<std::remove_cv_t<CTS_TYPE>, double>) { |
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.
if (std::is_same_v<std::remove_cv_t<CTS_TYPE>, double>) { | |
if constexpr (std::is_same_v<std::remove_cv_t<CTS_TYPE>, double>) { |
sycl::half bitselect(sycl::half a, sycl::half b, sycl::half c); | ||
#endif |
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.
Probably we should re-group these declarations to
// float type overloads for all math functions.
...
#if SYCL_CTS_ENABLE_DOUBLE_TESTS
// double type overloads for all math functions.
...
#endif
#if SYCL_CTS_ENABLE_HALF_TESTS
// half type overloads for all math functions.
...
#endif
@@ -51,8 +51,12 @@ using has_atomic_support = contains<T, int, unsigned int, long, unsigned long, | |||
*/ | |||
template <typename T> | |||
using is_sycl_floating_point = |
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.
using is_sycl_floating_point = | |
using is_sycl_scalar_floating_point = |
From what I see, they are filtered out automatically: Lines 162 to 164 in 42e9081
|
g++-13 implements already https://en.cppreference.com/w/cpp/types/floating-point from C++23. @fknorr Go for it! :-) |
@fknorr Some merge from upstream? |
I was not aware of the _Float16 support in newer GCC - this PR might not be required anymore for SimSYCL, I can check after merging #870 . |
This PR improves compatibility with implementations that do not expose the
sycl::half
type (notably, SimSYCL built with GCC).There might be additional usages I missed, in tests that SimSYCL is currently unable to compile for other reasons.
Question to the reviewers: Is it necessary to exclude some translation units in CMake when the file names are
*fp16.cpp
or are these handled automatically?