-
Notifications
You must be signed in to change notification settings - Fork 23
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
Impossible to cast a float into an integer #441
Comments
Actually, I have just found a way:
Not sure what to do with this issue. I guess the GPU definitions of trunc, round, ceil, could potentially be enhanced. |
The comment above is wrong: the kernel above doesn' t raise an exception but doesn' t do anything either. I guess the instruction |
This is a known limitation, tracked in #65. |
Thank you !
Le jeu. 23 mai 2024, 10:27, Tim Besard ***@***.***> a écrit :
… This is a known limitation, tracked in #65
<#65>.
In your case, use unsafe_trunc instead, which doesn't generate an
exception (and thus doesn't require an allocation). It's unfortunate, but
adding overlay definitions to trunc is much too invasive, so time is
better spent working on a device-side allocator fixing #65
<#65>.
—
Reply to this email directly, view it on GitHub
<#441 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACDSKJM2TKXKDW5PL3K2M3ZDWSAPAVCNFSM6AAAAABIEYBLTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRWGUZDKOJUGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
It currently seems impossible (to me?) to convert a float into an integer inside a oneapi kernel.
I tried with several functions like
round(Int, ...)
,trunc(Int, ...)
and also withconvert(Int(rount(...)))
but I always get a compilation error.Here is a self contained example with the corresponding error log.
The text was updated successfully, but these errors were encountered: