-
Notifications
You must be signed in to change notification settings - Fork 802
[SYCL] Support stdlib function div, ldiv, lldiv in device library #3262
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
Changes from 1 commit
784895a
6f13dd5
5967d33
e035475
54717e3
375416d
77b7cf2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,14 @@ | |
| #include "wrapper.h" | ||
|
|
||
| #ifdef __SPIR__ | ||
| DEVICE_EXTERN_C | ||
| div_t div(int x, int y) { return {x / y, x % y}; } | ||
|
||
|
|
||
| DEVICE_EXTERN_C | ||
| ldiv_t ldiv(long int x, long int y) { return {x / y, x % y}; } | ||
|
|
||
| DEVICE_EXTERN_C | ||
| lldiv_t lldiv(long long int x, long long int y) { return {x / y, x % y}; } | ||
| #if defined(_WIN32) | ||
| // Truncates a wide (16 or 32 bit) string (wstr) into an ASCII string (str). | ||
| // Any non-ASCII characters are replaced by question mark '?'. | ||
|
|
||
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 guess we'd better have a dedicated integer math file instead of placing this in the
crtportion, but we can do the clean-up later.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.
It seems that "div" is declared in instead of but it makes sense to group all "math related" items into one math file. I will update it later.
Thanks.