Skip to content

[SYCL] Change return type of frexp(float) to float - #23049

Open
bratpiorka wants to merge 1 commit into
intel:syclfrom
bratpiorka:rrudnick_frexp
Open

[SYCL] Change return type of frexp(float) to float#23049
bratpiorka wants to merge 1 commit into
intel:syclfrom
bratpiorka:rrudnick_frexp

Conversation

@bratpiorka

Copy link
Copy Markdown
Contributor

Change return type of frexp(float) and add test with static assertions for frexp return types.

Fixes #23041

@bratpiorka
bratpiorka requested a review from Maetveis August 28, 2026 14:14
@bratpiorka
bratpiorka marked this pull request as ready for review August 31, 2026 07:21
@bratpiorka
bratpiorka requested a review from a team as a code owner August 31, 2026 07:21
@Maetveis
Maetveis requested a review from bader September 1, 2026 06:36
@Maetveis

Maetveis commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Have you checked if any other return types are wrong in the wrapper header? This kind of issue is likely a result of a copy & paste error, so there might be other functions that are wrong.

Comment on lines +9 to +17
#include <type_traits>

static_assert(
std::is_same_v<decltype(std::frexp(0.0f, (int *)nullptr)), float>);
static_assert(
std::is_same_v<decltype(std::frexpf(0.0f, (int *)nullptr)), float>);
static_assert(
std::is_same_v<decltype(std::frexp(0.0, (int *)nullptr)), double>);
static_assert(std::is_same_v<decltype(std::frexp(0, (int *)nullptr)), double>);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is just my opinion, but I don't think testing like this makes much sense honestly.
There is no complicated type deduction going on in the declaration of frexp, reviewers can simply read the return type from the headers.
This kind of testing would maybe make sense if we checked that the return types of all cmath functions match what the C++ standard defines. That would have caught this regression.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok, I will just remove these checks since, as you wrote, they don't add much value here. About test for all cmatch functions - this should be a separate PR

@bratpiorka

Copy link
Copy Markdown
Contributor Author

Have you checked if any other return types are wrong in the wrapper header? This kind of issue is likely a result of a copy & paste error, so there might be other functions that are wrong.

yes, I checked the other functions, and there was only a problem with frexp

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.

icpx as of 2026.0 maps float overload of std::frexp to double on CUDA backend

3 participants